diff --git a/enums/icarBatchResultSeverityType.json b/enums/icarBatchResultSeverityType.json new file mode 100644 index 0000000..c314ae1 --- /dev/null +++ b/enums/icarBatchResultSeverityType.json @@ -0,0 +1,11 @@ +{ + "description": "Severity code to distinguish warnings and errors.", + + "type": "string", + + "enum": [ + "Information", + "Warning", + "Error" + ] + } \ No newline at end of file diff --git a/resources/icarBatchResult.json b/resources/icarBatchResult.json new file mode 100644 index 0000000..e087e80 --- /dev/null +++ b/resources/icarBatchResult.json @@ -0,0 +1,22 @@ +{ + "description": "Returned by a batch POST event to return identity (meta), errors, and warnings for a resource.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier created in the system for this event. SHOULD be a UUID." + }, + "meta": { + "$ref": "../types/icarMetaDataType.json", + "description": "Metadata for the posted resource. Allows specification of the source, source Id to synchronise data." + }, + "messages": { + "type": "array", + "description": "An arry of errors for this resource.", + "nullable": true, + "items": { + "$ref": "../resources/icarResponseMessageResource.json" + } + } + } +} \ No newline at end of file diff --git a/resources/icarResponseMessageResource.json b/resources/icarResponseMessageResource.json new file mode 100644 index 0000000..8f50b02 --- /dev/null +++ b/resources/icarResponseMessageResource.json @@ -0,0 +1,35 @@ +{ + "description": "An RFC7807 compliant problem response for JSON APIs.", + + "type": "object", + + "properties": { + "type": { + "type": "string", + "description": "Machine readable URI or code that defines the type of error or warning." + }, + "severity": { + "$ref": "../enums/icarBatchResultSeverityType.json", + "description": "Distinguish errors, warnings, and informational messages." + }, + "status": { + "type": "integer", + "description": "The HTTP status code applicable to this problem.", + "format": "int32", + "nullable": true + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization." + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized." + }, + "instance": { + "type": "string", + "description": "A URI reference or internal JSON document reference to the specific data item that caused the problem.", + "nullable": true + } + } +} \ No newline at end of file diff --git a/url-schemes/healthURLScheme.json b/url-schemes/healthURLScheme.json new file mode 100644 index 0000000..f5f4c47 --- /dev/null +++ b/url-schemes/healthURLScheme.json @@ -0,0 +1,656 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Health Diagnosis and Treatment API Specifications", + "description": "Specifications for messages that support livestock health and disease diagnosis and treatments.", + "version": "1.2", + "contact": { + "name": "Animal Data Exchange Working Group", + "url": "https://www.icar.org/index.php/technical-bodies/working-groups/animal-data-exchange-wg/", + "email": "icar@icar.org" + } + }, + "servers": [ + { + "url": "https://icar-ade.standard.com" + } + ], + "tags": [ + { + "name": "ADE-1.2-health", + "description": "Health messages approved by the working group" + } + ], + "paths": { + "/locations/{location-scheme}/{location-id}/diagnoses": { + "get": { + "operationId": "get-Diagnoses", + "summary": "Get the diagnoses for a certain location", + "description": "# Purpose\nProvides the animal health diagnoses for a location\n", + "tags": [ + "ADE-1.2-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the diagnoses for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarDiagnosisEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-Diagnosis", + "summary": "Add a single new diagnosis event", + "description": "# Purpose \nAllows a client to add a single animal health diagnosis event.\n", + "tags": [ + "ADE-1.2-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The health diagnosis event to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarDiagnosisEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarDiagnosisEvent" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/treatments": { + "get": { + "operationId": "get-Treatments", + "summary": "Get the treatments for a certain location", + "description": "# Purpose\nProvides the animal health treatments for a location\n", + "tags": [ + "ADE-1.2-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the treatments for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTreatmentEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-Treatment", + "summary": "Add a single new health treatment event", + "description": "# Purpose \nAllows a client to add a single animal health treatment event.\n", + "tags": [ + "ADE-1.2-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The health treatment event to create. \nA client MAY fill in the *ID* field with a client-generated UUID and the server MAY use this *ID*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTreatmentEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTreatmentEvent" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource." + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status." + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/treatment-programs": { + "get": { + "operationId": "get-Treatment-Programs", + "summary": "Get the treatment programs for a certain location", + "description": "# Purpose\nProvides the animal health treatment programs for a location\n", + "tags": [ + "ADE-1.2-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the treatment progams for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTreatmentProgramEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-Treatment-Program", + "summary": "Add a single new health treatment programme.", + "description": "# Purpose \nAllows a client to add a single animal health treatment programme.\n", + "tags": [ + "ADE-1.2-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The health treatment programme resource to create. \nA client MAY fill in the *ID* field with a client-generated UUID and the server MAY use this *ID*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\nThis applies to all resource *ID* and *meta* objects in the *icarTreatmentProgramEvent*.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTreatmentProgramEvent" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTreatmentProgramEvent" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource." + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status." + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/batches/{location-scheme}/{location-id}/diagnoses": { + "post": { + "operationId": "post-batch-Diagnosis", + "summary": "Add a single new diagnosis event", + "description": "# Purpose \nAllows a client to add a collection of animal health diagnosis events.\n", + "tags": [ + "ADE-1.2-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of health diagnosis events to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarDiagnosisEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/{location-scheme}/{location-id}/treatments": { + "post": { + "operationId": "post-batch-Treatments", + "summary": "Add a collection of health treatment events", + "description": "# Purpose \nAllows a client to add a collection of animal health treatment events.\n", + "tags": [ + "ADE-1.2-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of health treatment events to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTreatmentEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/{location-scheme}/{location-id}/treatment-programs": { + "post": { + "operationId": "post-batch-Treatment-Program", + "summary": "Add a collection of animal health treatment program events.", + "description": "# Purpose \nAllows a client to add a collection of animal health treatment program events.\n", + "tags": [ + "ADE-1.2-health" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of health treatment program events to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTreatmentProgramEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "batchResults": { + "type": "array", + "items": { + "$ref": "../resources/icarBatchResult.json" + } + }, + "error": { + "$ref": "../resources/icarResponseMessageResource.json" + }, + "icarDiagnosisEvent": { + "$ref": "../resources/icarDiagnosisEventResource.json" + }, + "icarDiagnosisEventCollection": { + "$ref": "../collections/icarDiagnosisEventCollection.json" + }, + "icarDiagnosisEventArray": { + "type": "array", + "items": { + "$ref": "../resources/icarDiagnosisEventResource.json" + } + }, + "icarTreatmentEvent": { + "$ref": "../resources/icarTreatmentEventResource.json" + }, + "icarTreatmentEventCollection": { + "$ref": "../collections/icarTreatmentEventCollection.json" + }, + "icarTreatmentEventArray": { + "type": "array", + "items": { + "$ref": "../resources/icarTreatmentEventResource.json" + } + }, + "icarTreatmentProgramEvent": { + "$ref": "../resources/icarTreatmentProgramEventResource.json" + }, + "icarTreatmentProgramEventCollection": { + "$ref": "../collections/icarTreatmentProgramEventCollection.json" + }, + "icarTreatmentProgramEventArray": { + "type": "array", + "items": { + "$ref": "../resources/icarTreatmentProgramEventResource.json" + } + } + }, + "parameters": { + "location-scheme": { + "name": "location-scheme", + "in": "path", + "description": "The scheme id for the location identifier.", + "required": true, + "schema": { + "type": "string" + } + }, + "location-id": { + "name": "location-id", + "in": "path", + "description": "The unique identifier for the location.", + "required": true, + "schema": { + "type": "string" + } + }, + "meta-modified-from": { + "name": "meta-modified-from", + "in": "query", + "description": "The start of the date-time range for the data to get in the request.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + "meta-modified-to": { + "name": "meta-modified-to", + "in": "query", + "description": "The end of the date-time range for the data to get in the request.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + "animal-scheme": { + "name": "animal-scheme", + "in": "query", + "description": "The scheme id for the animal identifier.", + "required": false, + "schema": { + "type": "string" + } + }, + "animal-id": { + "name": "animal-id", + "in": "query", + "description": "The unique identifier for the animal.", + "required": false, + "schema": { + "type": "string" + } + } + }, + "responses": { + "default": { + "description": "An error has occured while handling the request. Check the content of the message for the error details.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "A default response containing only a list of errors" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/url-schemes/milkURLScheme.json b/url-schemes/milkURLScheme.json new file mode 100644 index 0000000..0a89f30 --- /dev/null +++ b/url-schemes/milkURLScheme.json @@ -0,0 +1,962 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Milk recording and lactation information API Specifications", + "description": "Specifications for messages that support dairy milking visits, lactation, and related information.", + "version": "1.2", + "contact": { + "name": "Animal Data Exchange Working Group", + "url": "https://www.icar.org/index.php/technical-bodies/working-groups/animal-data-exchange-wg/", + "email": "icar@icar.org" + } + }, + "servers": [ + { + "url": "https://icar-ade.standard.com" + } + ], + "tags": [ + { + "name": "ADE-1.2-milk", + "description": "Milking-related messages approved by the working group" + } + ], + "paths": { + "/locations/{location-scheme}/{location-id}/milking-visits": { + "get": { + "operationId": "get-milking-visits", + "summary": "Get the milking-visits for a certain location", + "description": "# Purpose\nProvides the animal milking-visits for a location\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the diagnoses for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMilkingVisitEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-milking-visits", + "summary": "Add a single new milking-visits.", + "description": "# Purpose\nAllows a client to add a single milking-visits.\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The milking-visits to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMilkingVisitEventResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMilkingVisitEventResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/test-days": { + "get": { + "operationId": "get-test-day", + "summary": "Get the test-day for a certain location", + "description": "# Purpose\nProvides the animal test-day for a location\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the diagnoses for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTestDayCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-test-day", + "summary": "Add a single new test-day.", + "description": "# Purpose\nAllows a client to add a single test-day.\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The test-day to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTestDayResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTestDayResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/test-day-results": { + "get": { + "operationId": "get-test-day-result", + "summary": "Get the test-day-result for a certain location", + "description": "# Purpose\nProvides the animal test-day-result for a location\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the diagnoses for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTestDayResultEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-test-day-result", + "summary": "Add a single new test-day-result.", + "description": "# Purpose\nAllows a client to add a single test-day-result.\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The test-day-result to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTestDayResultEventResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTestDayResultEventResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/daily-milking-averages": { + "get": { + "operationId": "get-daily-milking-averages", + "summary": "Get the daily milking averages for a certain location", + "description": "# Purpose\nProvides the animal daily milking averages for a location\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the diagnoses for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarDailyMilkingAveragesCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/lactations": { + "get": { + "operationId": "get-lactations", + "summary": "Get the lactations for a certain location", + "description": "# Purpose\nProvides the animal lactation for a location\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the diagnoses for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarLactationCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/lactation-status-observations": { + "get": { + "operationId": "get-lactation-status-observations", + "summary": "Get the lactation status observations for a certain location", + "description": "# Purpose\nProvides the animal lactation status observations for a location\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the diagnoses for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarLactationStatusObservedEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-lactation-status-observation", + "summary": "Add a single new lactation status observation event.", + "description": "# Purpose\nAllows a client to add a single lactation status observation event.\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The lactation-status-observation to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarLactationStatusObservedEventResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarLactationStatusObservedEventResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/batches/locations/{location-scheme}/{location-id}/milking-visits": { + "post": { + "operationId": "post-batch-milking-visits", + "summary": "Add a single new milking-visits event", + "description": "# Purpose \nAllows a client to add a collection of milking visits.\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of {milking-visits:node} to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMilkingVisitEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/locations/{location-scheme}/{location-id}/test-days": { + "post": { + "operationId": "post-batch-test-days", + "summary": "Add batch of test-days.", + "description": "# Purpose \nAllows a client to add a collection of test-days.\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of test-days to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTestDayArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/locations/{location-scheme}/{location-id}/test-day-results": { + "post": { + "operationId": "post-batch-test-day-results", + "summary": "Add an array of test-day-results.", + "description": "# Purpose \nAllows a client to add a collection of test-day-result.\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of test day results to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarTestDayResultEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/locations/{location-scheme}/{location-id}/lactation-status-observations": { + "post": { + "operationId": "post-batch-lactation-status-observations", + "summary": "Add an array of lactation status observations.", + "description": "# Purpose \nAllows a client to add a collection of lactation status observations.\n", + "tags": [ + "ADE-1.2-milk" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of lactation status observations to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarLactationStatusObservedEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "batchResults": { + "type": "array", + "items": { + "$ref": "../resources/icarBatchResult.json" + } + }, + "error": { + "$ref": "../resources/icarResponseMessageResource.json" + }, + "icarMilkingVisitEventResource": { + "$ref": "../resources/icarMilkingVisitEventResource.json" + }, + "icarMilkingVisitEventCollection": { + "$ref": "../collections/icarMilkingVisitEventCollection.json" + }, + "icarMilkingVisitEventArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarMilkingVisitEventResource" + } + }, + "icarTestDayResource": { + "$ref": "../resources/icarTestDayResource.json" + }, + "icarTestDayCollection": { + "$ref": "../collections/icarTestDayCollection.json" + }, + "icarTestDayArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarTestDayResource" + } + }, + "icarTestDayResultEventResource": { + "$ref": "../resources/icarTestDayResultEventResource.json" + }, + "icarTestDayResultEventCollection": { + "$ref": "../collections/icarTestDayResultEventCollection.json" + }, + "icarTestDayResultEventArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarTestDayResultEventResource" + } + }, + "icarDailyMilkingAveragesCollection": { + "$ref": "../collections/icarDailyMilkingAveragesCollection.json" + }, + "icarLactationCollection": { + "$ref": "../collections/icarLactationCollection.json" + }, + "icarLactationStatusObservedEventResource": { + "$ref": "../resources/icarLactationStatusObservedEventResource.json" + }, + "icarLactationStatusObservedEventCollection": { + "$ref": "../collections/icarLactationStatusObservedEventCollection.json" + }, + "icarLactationStatusObservedEventArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarLactationStatusObservedEventResource" + } + } + }, + "parameters": { + "location-scheme": { + "name": "location-scheme", + "in": "path", + "description": "The scheme id for the location identifier.", + "required": true, + "schema": { + "type": "string" + } + }, + "location-id": { + "name": "location-id", + "in": "path", + "description": "The unique identifier for the location.", + "required": true, + "schema": { + "type": "string" + } + }, + "meta-modified-from": { + "name": "meta-modified-from", + "in": "query", + "description": "The start of the date-time range for the data to get in the request.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + "meta-modified-to": { + "name": "meta-modified-to", + "in": "query", + "description": "The end of the date-time range for the data to get in the request.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + "animal-scheme": { + "name": "animal-scheme", + "in": "query", + "description": "The scheme id for the animal identifier.", + "required": false, + "schema": { + "type": "string" + } + }, + "animal-id": { + "name": "animal-id", + "in": "query", + "description": "The unique identifier for the animal.", + "required": false, + "schema": { + "type": "string" + } + } + }, + "responses": { + "default": { + "description": "An error has occured while handling the request. Check the content of the message for the error details.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "A default response containing only a list of errors" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/url-schemes/registrationURLScheme.json b/url-schemes/registrationURLScheme.json new file mode 100644 index 0000000..cbc4c07 --- /dev/null +++ b/url-schemes/registrationURLScheme.json @@ -0,0 +1,1070 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Animal Registration and Movement API Specifications", + "description": "Specifications for messages that support livestock movement information and registration (sometimes called I&R).", + "version": "1.2", + "contact": { + "name": "Animal Data Exchange Working Group", + "url": "https://www.icar.org/index.php/technical-bodies/working-groups/animal-data-exchange-wg/", + "email": "icar@icar.org" + } + }, + "servers": [ + { + "url": "https://icar-ade.standard.com" + } + ], + "tags": [ + { + "name": "ADE-1.2-registration", + "description": "Registration and movement messages approved by the working group" + } + ], + "paths": { + "/locations/{location-scheme}/{location-id}/animals": { + "get": { + "operationId": "get-animals", + "summary": "Get the animals for a certain location", + "description": "# Purpose\nProvides the animals on a location\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the animals for the given location", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarAnimalCoreCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-animal", + "summary": "Add a single animal resource.", + "description": "# Purpose \nAllows a client to add a single animal resource. Many servers do not support adding animals, requiring a registration event instead.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The animal to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarAnimalCoreResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarAnimalCoreResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/births": { + "get": { + "operationId": "get-births", + "summary": "Get the births for a certain location", + "description": "# Purpose\nProvides the animal birth records for a location\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the birth or initial registration events for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementBirthEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-birth", + "summary": "Add a single new birth or initial registration event", + "description": "# Purpose \nAllows a client to add a single animal birth or initial registration event.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The birth event to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementBirthEventResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementBirthEventResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/deaths": { + "get": { + "operationId": "get-deaths", + "summary": "Get the deaths for a certain location", + "description": "# Purpose\nProvides the animal death records for a location\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the death events for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementDeathEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-death", + "summary": "Add a single new death event", + "description": "# Purpose \nAllows a client to add a single animal death event.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The death event to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementDeathEventResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementDeathEventResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/arrivals": { + "get": { + "operationId": "get-arrivals", + "summary": "Get the arrivals for a certain location", + "description": "# Purpose\nProvides the animal arrival records for a location\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the arrival events for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementArrivalEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-arrival", + "summary": "Add a single new arrival event", + "description": "# Purpose \nAllows a client to add a single animal arrival event.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The arrival event to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementArrivalEventResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementArrivalEventResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/locations/{location-scheme}/{location-id}/departures": { + "get": { + "operationId": "get-departures", + "summary": "Get the departures for a certain location", + "description": "# Purpose\nProvides the animal departure records for a location\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + }, + { + "$ref": "#/components/parameters/meta-modified-from" + }, + { + "$ref": "#/components/parameters/meta-modified-to" + } + ], + "responses": { + "200": { + "description": "Successful. The response contains the departure events for the given location.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementDepartureEventCollection" + } + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + }, + "post": { + "operationId": "post-single-departure", + "summary": "Add a single new departure event", + "description": "# Purpose \nAllows a client to add a single animal departure event.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The departure event to create. \nA client MAY fill in the *Id* field with a client-generated UUID and the server MAY use this *Id*.\nIf the server does not use the client-specified *ID* field it shall issue its own *ID* for the resource.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementDepartureEventResource" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a copy of the event, as modifed by the server.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementDepartureEventResource" + } + } + } + }, + "201": { + "description": "Created. The Location header contains the URI to the new resource.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the new resource." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/batches/{location-scheme}/{location-id}/animals": { + "post": { + "operationId": "post-batch-animals", + "summary": "Add an array of animal resources", + "description": "# Purpose \nAllows a client to add a collection of animal resources. Many servers do not support adding animals, requiring registration events instead.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of animal resources to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarAnimalCoreResourceArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/{location-scheme}/{location-id}/births": { + "post": { + "operationId": "post-batch-births", + "summary": "Add an array of birth or initial registration events", + "description": "# Purpose \nAllows a client to add a collection of animal birth events.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of birth events to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementBirthEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/{location-scheme}/{location-id}/deaths": { + "post": { + "operationId": "post-batch-deaths", + "summary": "Add an array of death events", + "description": "# Purpose \nAllows a client to add a collection of animal death events.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of death events to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementDeathEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/{location-scheme}/{location-id}/arrivals": { + "post": { + "operationId": "post-batch-arrivals", + "summary": "Add an array of arrival events", + "description": "# Purpose \nAllows a client to add a collection of animal arrival events.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of arrival events to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementArrivalEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + }, + "/batches/{location-scheme}/{location-id}/departures": { + "post": { + "operationId": "post-batch-departures", + "summary": "Add an array of departure events", + "description": "# Purpose \nAllows a client to add a collection of animal departure events.\n", + "tags": [ + "ADE-1.2-registration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/location-scheme" + }, + { + "$ref": "#/components/parameters/location-id" + } + ], + "requestBody": { + "required": true, + "description": "The collection of departure events to create. \nA client MAY fill in resource *Id*s with a client-generated UUID and the server MAY use these *Id*s.\nIf the server does not use the client-specified *Id* field it shall issue its own *Id*s for the resources.\nA client SHALL ensure that the *meta.source* and *meta.sourceId* fields are filled by the client.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/icarMovementDepartureEventArray" + } + } + } + }, + "responses": { + "200": { + "description": "Successful. The response contains a set of batch results, which may include warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + }, + "201": { + "description": "Created. The Location header contains URI to retrieve a set of batch results, which may include warnings.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains the URI to the results." + } + } + }, + "202": { + "description": "Accepted. The Location header contains a URI that the client can query for processing status.", + "headers": { + "Location": { + "schema": { + "type": "string", + "format": "uri" + }, + "description": "Contains a URI to query creation status." + } + } + }, + "default": { + "description": "The response contains a set of batch results, which may include errors and warnings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/batchResults" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "batchResults": { + "type": "array", + "items": { + "$ref": "../resources/icarBatchResult.json" + } + }, + "error": { + "$ref": "../resources/icarResponseMessageResource.json" + }, + "icarAnimalCoreCollection": { + "$ref": "../collections/icarAnimalCoreCollection.json" + }, + "icarMovementBirthEventCollection": { + "$ref": "../collections/icarMovementBirthEventCollection.json" + }, + "icarMovementDeathEventCollection": { + "$ref": "../collections/icarMovementDeathEventCollection.json" + }, + "icarMovementArrivalEventCollection": { + "$ref": "../collections/icarMovementArrivalEventCollection.json" + }, + "icarMovementDepartureEventCollection": { + "$ref": "../collections/icarMovementDepartureEventCollection.json" + }, + "icarAnimalCoreResource": { + "$ref": "../resources/icarAnimalCoreResource.json" + }, + "icarMovementBirthEventResource": { + "$ref": "../resources/icarMovementBirthEventResource.json" + }, + "icarMovementDeathEventResource": { + "$ref": "../resources/icarMovementDeathEventResource.json" + }, + "icarMovementArrivalEventResource": { + "$ref": "../resources/icarMovementArrivalEventResource.json" + }, + "icarMovementDepartureEventResource": { + "$ref": "../resources/icarMovementDepartureEventResource.json" + }, + "icarAnimalCoreResourceArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarAnimalCoreResource" + } + }, + "icarMovementBirthEventArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarMovementBirthEventResource" + } + }, + "icarMovementDeathEventArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarMovementDeathEventResource" + } + }, + "icarMovementArrivalEventArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarMovementArrivalEventResource" + } + }, + "icarMovementDepartureEventArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/icarMovementDepartureEventResource" + } + } + }, + "parameters": { + "location-scheme": { + "name": "location-scheme", + "in": "path", + "description": "The scheme id for the location identifier.", + "required": true, + "schema": { + "type": "string" + } + }, + "location-id": { + "name": "location-id", + "in": "path", + "description": "The unique identifier for the location.", + "required": true, + "schema": { + "type": "string" + } + }, + "meta-modified-from": { + "name": "meta-modified-from", + "in": "query", + "description": "The start of the date-time range for the data to get in the request.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + "meta-modified-to": { + "name": "meta-modified-to", + "in": "query", + "description": "The end of the date-time range for the data to get in the request.", + "schema": { + "type": "string", + "format": "date-time" + } + }, + "animal-scheme": { + "name": "animal-scheme", + "in": "query", + "description": "The scheme id for the animal identifier.", + "required": false, + "schema": { + "type": "string" + } + }, + "animal-id": { + "name": "animal-id", + "in": "query", + "description": "The unique identifier for the animal.", + "required": false, + "schema": { + "type": "string" + } + } + }, + "responses": { + "default": { + "description": "An error has occured while handling the request. Check the content of the message for the error details.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "A default response containing only a list of errors" + } + } + } + } + } + } +} \ No newline at end of file