{
    "swagger": "2.0",
    "info": {
        "contact": {}
    },
    "paths": {
        "/api/v1/integration/about": {
            "get": {
                "description": "Get system version",
                "tags": [
                    "about",
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinSystemVersion"
                        }
                    }
                }
            }
        },
        "/api/v1/integration/acoustics/enabled": {
            "get": {
                "description": "Get whether acoustics is enabled or disabled",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    "204": {
                        "description": "No Content"
                    }
                }
            },
            "post": {
                "description": "Enable/disable acoustic imaging",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "408": {
                        "description": "Request Timeout"
                    },
                    "409": {
                        "description": "Conflict"
                    }
                }
            }
        },
        "/api/v1/integration/acoustics/mode": {
            "get": {
                "description": "Get acoustics mode (\"low-frequency\" or \"high-frequency\")",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "204": {
                        "description": "No Content"
                    }
                }
            },
            "post": {
                "description": "Set acoustics mode to either \"low-frequency\" or \"high-frequency\"",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "\"low-frequency\"",
                                "\"high-frequency\""
                            ],
                            "example": "\"low-frequency\""
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "408": {
                        "description": "Request Timeout"
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                }
            }
        },
        "/api/v1/integration/acoustics/range": {
            "get": {
                "description": "Get range",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/integrationapi.RangeResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "Set range",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/integrationapi.RangeResponse"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "409": {
                        "description": "Conflict"
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                }
            }
        },
        "/api/v1/integration/acoustics/salinity": {
            "get": {
                "description": "Get salinity for automatic speed of sound calculation. \"fresh\" or \"salt\".",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "204": {
                        "description": "No Content"
                    }
                }
            },
            "post": {
                "description": "Set salinity for automatic speed of sound calculation. \"fresh\" or \"salt\".",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "\"fresh\"",
                                "\"salt\""
                            ],
                            "example": "\"salt\""
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "408": {
                        "description": "Request Timeout"
                    },
                    "409": {
                        "description": "Conflict"
                    }
                }
            }
        },
        "/api/v1/integration/acoustics/speed_of_sound": {
            "get": {
                "description": "Get speed of sound. 0 means speed of sound is automatically calculated from configured water salinity and water temperature.",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "number"
                        }
                    },
                    "204": {
                        "description": "No Content"
                    }
                }
            },
            "post": {
                "description": "Set speed of sound. 0 means speed of sound is automatically calculated from configured water salinity and water temperature.",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "example": 1500
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "408": {
                        "description": "Request Timeout"
                    },
                    "409": {
                        "description": "Conflict"
                    }
                }
            }
        },
        "/api/v1/integration/output/imu-batch/enabled": {
            "get": {
                "description": "Get whether ImuBatch output is enabled",
                "tags": [
                    "acoustics",
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    "204": {
                        "description": "No Content"
                    }
                }
            },
            "post": {
                "description": "Enable/disable ImuBatch output",
                "tags": [
                    "integrationAPI"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "408": {
                        "description": "Request Timeout"
                    },
                    "409": {
                        "description": "Conflict"
                    }
                }
            }
        },
        "/api/v1/integration/status": {
            "get": {
                "description": "Get the status of the system",
                "tags": [
                    "status",
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinStatusResponse"
                        }
                    }
                }
            }
        },
        "/api/v1/integration/temperature": {
            "get": {
                "description": "Get the internal temperature of the Sonar in degrees Celsius",
                "tags": [
                    "status",
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "number"
                        }
                    }
                }
            }
        },
        "/api/v1/integration/time/manual": {
            "post": {
                "description": "Set time manually. Not allowed if already synchronized. 409 is returned if time is already synchronized.",
                "tags": [
                    "integrationAPI",
                    "time"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinManualTimeRequest"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "409": {
                        "description": "Already synchronized"
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                }
            }
        },
        "/api/v1/integration/time/ntp": {
            "get": {
                "description": "Get the NTP configuration",
                "tags": [
                    "integrationAPI",
                    "time"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinNTPConfigurationPayload"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                }
            },
            "post": {
                "description": "Set the NTP configuration. Configuration is persisted. After setting configuration the sonar will attempt to reach the configured NTP server.",
                "tags": [
                    "integrationAPI",
                    "time"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinNTPConfigurationPayload"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                }
            }
        },
        "/api/v1/integration/time/ntp/force-sync": {
            "post": {
                "description": "Attempt to force NTP sync within timeout. Return whether sync was achieved, the time status, and a human-readable message. 409 is returned if another force sync request is already ongoing",
                "tags": [
                    "integrationAPI",
                    "time"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinNTPForceSyncRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinNTPForceSyncResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "409": {
                        "description": "Another force sync is already ongoing"
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                }
            }
        },
        "/api/v1/integration/time/status": {
            "get": {
                "description": "Get the current time synchronization status",
                "tags": [
                    "integrationAPI",
                    "time"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinTimeStatusResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                }
            }
        },
        "/api/v1/integration/udp": {
            "get": {
                "description": "Get the current UDP configuration for how the Sonar outputs data.",
                "tags": [
                    "integrationAPI"
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinHandleUdpConfigPayload"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                }
            },
            "post": {
                "description": "Set UDP configuration for how the Sonar should output data.",
                "tags": [
                    "integrationAPI"
                ],
                "parameters": [
                    {
                        "description": " ",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/integrationapi.GinHandleUdpConfigPayload"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "500": {
                        "description": "Internal Server Error"
                    }
                }
            }
        }
    },
    "definitions": {
        "integrationapi.GinHandleUdpConfigPayload": {
            "type": "object",
            "properties": {
                "mode": {
                    "description": "Must be \"multicast\", \"unicast\" or \"disabled\"\n\nIf mode is \"disabled\", no UDP packets will be sent\n\nIf mode is \"multicast\", UDP packets will be sent on multicast\n\nIf mode is \"unicast\", UDP packets will be sent to the destination\nIP and port",
                    "type": "string",
                    "enum": [
                        "multicast",
                        "unicast",
                        "disabled"
                    ],
                    "example": "multicast"
                },
                "unicast_destination_ip": {
                    "description": "The destination IP address if mode is \"unicast\".\nIf mode is \"unicast\", this must be a valid IP address.\nOtherwise, this must be a valid IP adddress or empty string.",
                    "type": "string",
                    "example": "192.168.1.100"
                },
                "unicast_destination_port": {
                    "description": "The destination port if mode is \"unicast\".\nIf mode is \"unicast\", this must be a valid port.\nOtherwise, this must be a valid port or 0.",
                    "type": "integer",
                    "example": 12345
                }
            }
        },
        "integrationapi.GinManualTimeRequest": {
            "type": "object",
            "properties": {
                "now": {
                    "description": "Current system time in RFC3339.",
                    "type": "string"
                }
            }
        },
        "integrationapi.GinNTPConfigurationPayload": {
            "type": "object",
            "properties": {
                "ntp_address": {
                    "description": "address or \"auto\"",
                    "type": "string"
                }
            }
        },
        "integrationapi.GinNTPForceSyncRequest": {
            "type": "object",
            "properties": {
                "timeout_seconds": {
                    "description": "number of seconds to wait for sync to be achieved before cancelling the force sync request with success == false",
                    "type": "number"
                }
            }
        },
        "integrationapi.GinNTPForceSyncResponse": {
            "type": "object",
            "properties": {
                "message": {
                    "description": "human-readable message",
                    "type": "string"
                },
                "status": {
                    "$ref": "#/definitions/integrationapi.GinTimeStatusResponse"
                },
                "success": {
                    "description": "true if NTP sync was achieved within timeout, false otherwise. Important: callers that want to achieve sync with a specific address should check the returned status",
                    "type": "boolean"
                }
            }
        },
        "integrationapi.GinStatusResponse": {
            "type": "object",
            "properties": {
                "api": {
                    "description": "IntegrationAPI is the status of the UDP IntegrationAPI for external communication",
                    "allOf": [
                        {
                            "$ref": "#/definitions/integrationapi.GinSystemStatusEntryResponse"
                        }
                    ]
                },
                "systems_check": {
                    "description": "SystemsCheck is the status of internal processing of the Sonar",
                    "allOf": [
                        {
                            "$ref": "#/definitions/integrationapi.GinSystemStatusEntryResponse"
                        }
                    ]
                },
                "temperature": {
                    "description": "Temperature is the status of the Sonar temperature",
                    "allOf": [
                        {
                            "$ref": "#/definitions/integrationapi.GinSystemStatusEntryResponse"
                        }
                    ]
                },
                "time": {
                    "description": "Time is the status of system time",
                    "allOf": [
                        {
                            "$ref": "#/definitions/integrationapi.GinSystemStatusEntryResponse"
                        }
                    ]
                }
            }
        },
        "integrationapi.GinSystemStatusEntryResponse": {
            "type": "object",
            "properties": {
                "id": {
                    "description": "Unique ID for the status message",
                    "type": "string",
                    "example": "api-normal"
                },
                "message": {
                    "description": "Message is a human readable message describing the status",
                    "type": "string",
                    "example": "Integration API is operational"
                },
                "operational": {
                    "description": "Operational is true if the system is functional, false if it is not",
                    "type": "boolean",
                    "example": true
                },
                "status": {
                    "description": "Status is \"ok\", \"warning\", or \"error\"",
                    "type": "string",
                    "example": "ok"
                }
            }
        },
        "integrationapi.GinSystemVersion": {
            "type": "object",
            "properties": {
                "chipid": {
                    "type": "string",
                    "example": "0x12345678"
                },
                "hardware_revision": {
                    "type": "integer",
                    "example": 6
                },
                "is_ready": {
                    "type": "boolean",
                    "example": true
                },
                "product_id": {
                    "type": "integer",
                    "example": 21045
                },
                "product_name": {
                    "type": "string",
                    "example": "Sonar 3D-15"
                },
                "variant": {
                    "type": "string"
                },
                "version": {
                    "type": "string",
                    "example": "1.5.1 (v1.3.0-26-gedccab6.2025-07-11T06:14:03.837365)"
                },
                "version_short": {
                    "type": "string",
                    "example": "1.5.1"
                }
            }
        },
        "integrationapi.GinTimeStatusResponse": {
            "type": "object",
            "properties": {
                "ntp_seconds_since_last_sync": {
                    "description": "seconds since last NTP sync, or null if not synchronized",
                    "type": "integer"
                },
                "ntp_synced": {
                    "description": "true if synchronized to NTP source, false otherwise",
                    "type": "boolean"
                },
                "ntp_synced_to": {
                    "description": "address the sonar is synchronized to if NTP is synchronized, \"\" otherwise",
                    "type": "string"
                },
                "system_time": {
                    "description": "system time in RFC3339",
                    "type": "string"
                }
            }
        },
        "integrationapi.RangeResponse": {
            "type": "object",
            "properties": {
                "max": {
                    "type": "number",
                    "example": 15
                },
                "min": {
                    "type": "number",
                    "example": 0
                }
            }
        }
    }
}