{
    "swagger": "2.0",
    "info": {
        "description": "Microservice which expose the assset ontology CRUD",
        "version": "0.0.1",
        "title": "Assets Microservice API",
        "contact": {}
    },
    "host": "dev-motion.cwbyminsait.com",
    "basePath": "/assets",
    "tags": [
        {
            "name": "asset-controller",
            "description": "Asset Controller"
        }
    ],
    "schemes": [
        "http",
        "https"
    ],
    "produces": [
        "application/json",
        "application/yaml",
        "text/plain"
    ],
    "paths": {
        "/v1/assets": {
            "get": {
                "tags": [
                    "asset-controller"
                ],
                "summary": "Get assets",
                "description": "Return the assets",
                "operationId": "getAssetsUsingGET",
                "parameters": [
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi"
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "size",
                        "in": "query",
                        "required": false,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "assetId",
                        "in": "query",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "currentDeviceId",
                        "in": "query",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "fromCreationDate",
                        "in": "query",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "toCreationDate",
                        "in": "query",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Request Successful, review the resulting object. ",
                        "schema": {
                            "$ref": "#/definitions/Asset model"
                        }
                    },
                    "400": {
                        "description": "Bad request, review the request param"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "500": {
                        "description": "Unexpected exception (Internal Server Error)"
                    }
                }
            },
            "post": {
                "tags": [
                    "asset-controller"
                ],
                "summary": "Asset creation",
                "description": "Create a new asset",
                "operationId": "createAssetUsingPOST",
                "consumes": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "in": "body",
                        "name": "asset",
                        "description": "asset",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Asset model"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Request Successful, review the resulting object. If infoError is not null, then a functional error has occurred in the back-end ",
                        "schema": {
                            "$ref": "#/definitions/Asset model"
                        }
                    },
                    "201": {
                        "description": "Created"
                    },
                    "400": {
                        "description": "Bad request, review the request param"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "500": {
                        "description": "Unexpected exception (Internal Server Error)"
                    }
                }
            }
        },
        "/v1/assets/{assetId}": {
            "get": {
                "tags": [
                    "asset-controller"
                ],
                "summary": "Get asset by assetId",
                "description": "Get asset by assetId",
                "operationId": "getByIdUsingGET",
                "parameters": [
                    {
                        "name": "assetId",
                        "in": "path",
                        "description": "assetId",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Updated Successful, review the resulting object.",
                        "schema": {
                            "$ref": "#/definitions/Asset model"
                        }
                    },
                    "400": {
                        "description": "Bad request, review the request param"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Asset not found."
                    },
                    "500": {
                        "description": "Unexpecte#/asset-controller/getAssetsUsingGETd exception (Internal Server Error)"
                    }
                }
            },
            "put": {
                "tags": [
                    "asset-controller"
                ],
                "summary": "Update an asset",
                "description": "Update the asset",
                "operationId": "putAssetUsingPUT",
                "consumes": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "in": "body",
                        "name": "asset",
                        "description": "asset",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Asset model"
                        }
                    },
                    {
                        "name": "assetId",
                        "in": "path",
                        "description": "assetId",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "201": {
                        "description": "Created"
                    },
                    "204": {
                        "description": "Updated Successful, review the resulting object.",
                        "schema": {
                            "$ref": "#/definitions/Asset model"
                        }
                    },
                    "400": {
                        "description": "Bad request, review the request param"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "500": {
                        "description": "Unexpected exception (Internal Server Error)"
                    }
                }
            },
            "delete": {
                "tags": [
                    "asset-controller"
                ],
                "summary": "Delete asset",
                "description": "Deleting the asset",
                "operationId": "deleteByIdUsingDELETE",
                "parameters": [
                    {
                        "name": "assetId",
                        "in": "path",
                        "description": "assetId",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "204": {
                        "description": "Deleted Successful, review the resulting object.",
                        "schema": {
                            "$ref": "#/definitions/Asset model"
                        }
                    },
                    "400": {
                        "description": "Bad request, review the request param"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "500": {
                        "description": "Unexpected exception (Internal Server Error)"
                    }
                }
            }
        },
        "/v1/assets/{assetId}/add-tracked-point": {
            "post": {
                "tags": [
                    "asset-controller"
                ],
                "summary": "Tracked Point Addition",
                "description": "Update the last position of an Asset ",
                "operationId": "addTrackedPointUsingPOST",
                "consumes": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "assetId",
                        "in": "path",
                        "description": "assetId",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "in": "body",
                        "name": "trackedPoint",
                        "description": "trackedPoint",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/TrackedPointDTO"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Request Successful, review the resulting object. If infoError is not null, then a functional error has occurred in the back-end ",
                        "schema": {
                            "$ref": "#/definitions/Asset model"
                        }
                    },
                    "201": {
                        "description": "Created"
                    },
                    "400": {
                        "description": "Bad request, review the request param"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "500": {
                        "description": "Unexpected exception (Internal Server Error)"
                    }
                }
            }
        }
    },
    "definitions": {
        "Asset model": {
            "type": "object",
            "properties": {
                "assetId": {
                    "type": "string",
                    "description": "Asset id",
                    "allowEmptyValue": false
                },
                "creationDate": {
                    "type": "string",
                    "description": "Asset creation date",
                    "allowEmptyValue": false
                },
                "currentDeviceId": {
                    "type": "string",
                    "description": "CurrentDeviceId for this asset",
                    "allowEmptyValue": false
                },
                "extrainfo": {
                    "description": "Asset extra info (no default fields)",
                    "allowEmptyValue": false,
                    "$ref": "#/definitions/JsonNode"
                },
                "geometry": {
                    "description": "Asset geometry data",
                    "allowEmptyValue": false,
                    "$ref": "#/definitions/GeometryDTO"
                },
                "histDevicesList": {
                    "type": "array",
                    "description": "Asset listHistDevices",
                    "allowEmptyValue": false,
                    "items": {
                        "type": "string"
                    }
                },
                "status": {
                    "type": "string",
                    "description": "Asset status",
                    "allowEmptyValue": false
                },
                "trackedPointList": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/TrackedPoint"
                    }
                },
                "type": {
                    "type": "string",
                    "description": "Asset type",
                    "allowEmptyValue": false
                }
            },
            "title": "Asset model"
        },
        "DataWrapperDTO«Asset model»": {
            "type": "object",
            "properties": {
                "data": {
                    "$ref": "#/definitions/Asset model"
                }
            },
            "title": "DataWrapperDTO«Asset model»"
        },
        "GeometryDTO": {
            "type": "object",
            "properties": {
                "coordinates": {
                    "type": "array",
                    "items": {
                        "type": "object"
                    }
                },
                "type": {
                    "type": "string"
                }
            },
            "title": "GeometryDTO"
        },
        "JsonNode": {
            "type": "object",
            "properties": {
                "array": {
                    "type": "boolean"
                },
                "bigDecimal": {
                    "type": "boolean"
                },
                "bigInteger": {
                    "type": "boolean"
                },
                "binary": {
                    "type": "boolean"
                },
                "boolean": {
                    "type": "boolean"
                },
                "containerNode": {
                    "type": "boolean"
                },
                "double": {
                    "type": "boolean"
                },
                "float": {
                    "type": "boolean"
                },
                "floatingPointNumber": {
                    "type": "boolean"
                },
                "int": {
                    "type": "boolean"
                },
                "integralNumber": {
                    "type": "boolean"
                },
                "long": {
                    "type": "boolean"
                },
                "missingNode": {
                    "type": "boolean"
                },
                "nodeType": {
                    "type": "string",
                    "enum": [
                        "ARRAY",
                        "BINARY",
                        "BOOLEAN",
                        "MISSING",
                        "NULL",
                        "NUMBER",
                        "OBJECT",
                        "POJO",
                        "STRING"
                    ]
                },
                "null": {
                    "type": "boolean"
                },
                "number": {
                    "type": "boolean"
                },
                "object": {
                    "type": "boolean"
                },
                "pojo": {
                    "type": "boolean"
                },
                "short": {
                    "type": "boolean"
                },
                "textual": {
                    "type": "boolean"
                },
                "valueNode": {
                    "type": "boolean"
                }
            },
            "title": "JsonNode"
        },
        "LinksDTO": {
            "type": "object",
            "properties": {
                "first": {
                    "type": "string"
                },
                "last": {
                    "type": "string"
                },
                "next": {
                    "type": "string"
                },
                "previous": {
                    "type": "string"
                },
                "self": {
                    "type": "string"
                }
            },
            "title": "LinksDTO"
        },
        "PaginationDTO": {
            "type": "object",
            "properties": {
                "links": {
                    "$ref": "#/definitions/LinksDTO"
                }
            },
            "title": "PaginationDTO"
        },
        "PaginationDataWrapperDTO«Asset model»": {
            "type": "object",
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Asset model"
                    }
                },
                "pagination": {
                    "$ref": "#/definitions/PaginationDTO"
                }
            },
            "title": "PaginationDataWrapperDTO«Asset model»"
        },
        "TrackedPoint": {
            "type": "object",
            "properties": {
                "gisElementList": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "latitude": {
                    "type": "number",
                    "format": "double"
                },
                "longitude": {
                    "type": "number",
                    "format": "double"
                },
                "status": {
                    "type": "string"
                },
                "trackedTime": {
                    "type": "string"
                }
            },
            "title": "TrackedPoint"
        },
        "TrackedPointDTO": {
            "type": "object",
            "properties": {
                "gisElementList": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "latitude": {
                    "type": "number",
                    "format": "double"
                },
                "longitude": {
                    "type": "number",
                    "format": "double"
                },
                "status": {
                    "type": "string"
                },
                "trackedTime": {
                    "type": "string"
                }
            },
            "title": "TrackedPointDTO"
        }
    }
}
