x-generator: NSwag v14.0.8.0 (NJsonSchema v11.0.1.0 (Newtonsoft.Json v13.0.0.0))
openapi: 3.0.0
info:
  title: Global DCC API
  description: >2+

    # Authentication

    This API uses Basic authentication. Available users are `gdcc` and `sdm`.


    # Rate limiting

    There are currently no limits on how many requests and you can send to this API, but it can change later.
  version: 1.0.0
servers:
- url: https://eu-gdcc-prd.amcsplatform.com
paths:
  /api/v0/binary:
    post:
      tags:
      - Version 0 endpoints
      summary: Binary
      description: Calculate whatever native DCC understands
      operationId: Version0_Binary
      parameters:
      - name: roadNetId
        in: query
        required: true
        schema:
          type: string
          default: DK
          nullable: true
        x-position: 1
      requestBody:
        x-name: request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BinaryRequest'
        required: true
        x-position: 2
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BinaryReply'
        404:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        500:
          description: ''
  /api/v0/binary2:
    post:
      tags:
      - Version 0 endpoints
      summary: Binary2
      description: Calculate whatever native DCC understands, sending and receiving raw binary data. The version of the reply isstored in an integer in the first four bytes of the reply stream
      operationId: Version0_Binary2
      parameters:
      - name: roadNetId
        in: query
        required: true
        schema:
          type: string
          default: DK
          nullable: true
        x-position: 1
      - name: version
        in: query
        schema:
          type: integer
          format: int32
        x-position: 2
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                data:
                  type: string
                  format: binary
                  nullable: true
      responses:
        200:
          description: ''
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        404:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        500:
          description: ''
  /api/v0/distance:
    post:
      tags:
      - Version 0 endpoints
      summary: Distance
      description: Calculate distance
      operationId: Version0_Distance
      parameters:
      - name: roadNetId
        in: query
        required: true
        schema:
          type: string
          default: DK
          nullable: true
        x-position: 1
      requestBody:
        x-name: request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DistanceRequest'
        required: true
        x-position: 2
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DistanceReply'
        404:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        500:
          description: ''
  /api/v0/trace:
    post:
      tags:
      - Version 0 endpoints
      summary: Trace
      description: Calculate trace
      operationId: Version0_Trace
      parameters:
      - name: roadNetId
        in: query
        required: true
        schema:
          type: string
          default: DK
          nullable: true
        x-position: 1
      requestBody:
        x-name: request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TraceRequest'
        required: true
        x-position: 2
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceReply'
        404:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        500:
          description: ''
  /api/v0/traces:
    post:
      tags:
      - Version 0 endpoints
      summary: Traces
      description: Calculate multiple traces
      operationId: Version0_Traces
      parameters:
      - name: roadNetId
        in: query
        required: true
        schema:
          type: string
          default: DK
          nullable: true
        x-position: 1
      requestBody:
        x-name: request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MultiTraceRequest'
        required: true
        x-position: 2
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultiTraceReply'
        404:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        500:
          description: ''
  /api/v0/roadnets:
    get:
      tags:
      - Version 0 endpoints
      summary: Available roadNets
      description: Returns a list of all available roadNets. Returned roadNetId can be passed to other endpoints, like trace, distance, binary.
      operationId: Version0_RoadNets
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoadNetInfo'
        500:
          description: ''
components:
  schemas:
    BinaryReply:
      type: object
      description: A raw binary reply from the dcc
      additionalProperties: false
      properties:
        data:
          type: string
          description: The raw binary representation of a reply
          format: byte
          nullable: true
        messageVersion:
          type: integer
          description: The spc message version of the data in the reply
          format: int32
    ProblemDetails:
      type: object
      additionalProperties:
        nullable: true
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
    BinaryRequest:
      type: object
      description: A binary request. The format is that of the native dcc
      additionalProperties: false
      properties:
        data:
          type: string
          description: The raw binary representation of a request
          format: byte
          nullable: true
        messageVersion:
          type: integer
          description: The spc message version of the data in the request
          format: int32
    DistanceReply:
      allOf:
      - $ref: '#/components/schemas/DccReplyBase'
      - type: object
        description: The reply for a distance request
        additionalProperties: false
        properties:
          source:
            description: The source coordinate of the request
            nullable: true
            oneOf:
            - $ref: '#/components/schemas/Coordinate'
          circumstance:
            description: The circumstances of the request
            nullable: true
            oneOf:
            - $ref: '#/components/schemas/Circumstance'
          answers:
            type: array
            description: >-
              The found destinations. The order of the answers will not necessarily 

              match the input request destinations
            nullable: true
            items:
              $ref: '#/components/schemas/DistanceAnswer'
    Coordinate:
      type: object
      description: A coordinate
      additionalProperties: false
      properties:
        latitude:
          type: number
          description: Latitude in degrees, [-90;90]. Only the 6 first decimals are considered. In case of more decimals specified, it is rounded.
          format: decimal
          default: 55.699679
        longitude:
          type: number
          description: Longitude in degrees, ]-180;180]. Only the 6 first decimals are considered. In case of more decimals specified, it is rounded.
          format: decimal
          default: 12.531683
    Circumstance:
      type: object
      description: Circumstances for a calculation
      additionalProperties: false
      properties:
        optCriterion:
          description: The optimization criteria
          default: 1
          oneOf:
          - $ref: '#/components/schemas/OptimizationCriterion'
        calcDirection:
          description: The calculation direction
          default: 0
          oneOf:
          - $ref: '#/components/schemas/CalculationDirection'
        velocityProfile:
          description: The velocity profile used for the request
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/VelocityProfile'
        vehicleAttributes:
          description: Lower bound of the vehicle attributes
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/VehicleAttributes'
        vehicleRestrictionUsage:
          description: Flags on which road net restrictions are enabled in the calculation
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/VehicleRestrictionUsage'
        snapLimits:
          description: The snap limits used for the request
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/SnapLimits'
    OptimizationCriterion:
      type: integer
      description: An enumaration describing the criterion for optimizing a route
      x-enumNames:
      - ShortestPath
      - FastestPath
      - CostPath
      enum:
      - 0
      - 1
      - 2
    CalculationDirection:
      type: integer
      description: An enumeration describing the direction of the calculation
      x-enumNames:
      - Forward
      - Backward
      enum:
      - 0
      - 1
    VelocityProfile:
      type: object
      description: A class describing the velocity profile
      additionalProperties: false
      properties:
        roadConfigs:
          type: array
          description: A list of road congfigurations, one per road type
          nullable: true
          items:
            $ref: '#/components/schemas/RoadConfig'
        linkToLinkCosts:
          type: array
          description: An optional description of link to link costs. If set it must have exactly 16 elements to be valid
          nullable: true
          items:
            $ref: '#/components/schemas/LinkToLinkCost'
    RoadConfig:
      type: object
      description: A class describing a single road configuration
      additionalProperties: false
      properties:
        velocity:
          type: integer
          description: The velocity on the roadtype
          format: int32
          default: 80
        snapInAllowed:
          type: boolean
          description: Is snap-in allowed on this road type
          default: true
        snapInAddDistance:
          type: boolean
          description: Ignored if SnapInAllowed is false. Unsure what it does though
          default: true
        roadTypeIsDivided:
          type: boolean
          description: Should this road type be divided? (no zigzag collection or U-turn)
          default: true
    LinkToLinkCost:
      type: object
      description: A class describing a link to link cost.
      additionalProperties: false
      properties:
        cost:
          type: integer
          description: Cost of a link to link cost
          format: int32
          default: 0
        extraPenalty:
          type: integer
          description: Extra penalty of a link to link cost
          format: int32
          default: 0
    VehicleAttributes:
      type: object
      description: Attributes describing restrictions. The units depend on the road net
      additionalProperties: false
      properties:
        height:
          type: integer
          description: Height
          default: 0
        illegals:
          type: integer
          description: Flag containing illegal attributes
          default: 0
        length:
          type: integer
          description: 'Length '
          default: 0
        axisPressure:
          type: integer
          description: Axis pressure
          default: 0
        weight:
          type: integer
          description: Weight
          default: 0
    VehicleRestrictionUsage:
      type: object
      description: More restrictions on a lookup
      additionalProperties: false
      properties:
        ignoreOnewayRestrictions:
          type: boolean
          description: ???
          default: false
        ignoreTurnAndUturnRestrictions:
          type: boolean
          description: ???
          default: false
        ignoreDividers:
          type: boolean
          description: ???
          default: false
    SnapLimits:
      type: object
      description: Configure snap in limits
      additionalProperties: false
      properties:
        snapRadius:
          type: integer
          description: The allowed snapin radius in meters
          format: int32
          default: 1000
        addSnapInDist:
          type: boolean
          description: Should the snapin distance be included in the result
          default: false
    DistanceAnswer:
      type: object
      description: A single answer for a distance lookup
      additionalProperties: false
      properties:
        length:
          type: integer
          description: The length in meters
          format: int32
          default: 105
        duration:
          type: integer
          description: The duration in seconds
          format: int32
          default: 13
        cost:
          type: integer
          description: The cost of the lookup
          format: int32
          default: 13
        destination:
          description: The destination coordinate.
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Coordinate'
    DccReplyBase:
      type: object
      description: Base data used by all dcc replies
      x-abstract: true
      additionalProperties: false
      properties:
        backendRoadNetVersion:
          type: string
          description: The road net version used by the backend server that handled the request.
          nullable: true
        apiRoadNetVersion:
          type: string
          description: The latest road net version the handling api server knows of.
          nullable: true
    DistanceRequest:
      type: object
      description: A request to lookup 1xN distances
      additionalProperties: false
      properties:
        source:
          description: A required source for the calculation
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Coordinate'
        destinations:
          type: array
          description: The destinations for the calculation
          nullable: true
          items:
            $ref: '#/components/schemas/Coordinate'
        circumstance:
          description: The circumstances of the calculations, optional
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Circumstance'
        cache:
          description: Configure cache handling
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/CacheConfig'
    CacheConfig:
      type: object
      description: Configure cache handling
      additionalProperties: false
      properties:
        skipLookup:
          type: boolean
          description: Should the cache lookup be skipped
          default: false
        skipUpdate:
          type: boolean
          description: Should the cache update be skipped
          default: false
    TraceReply:
      allOf:
      - $ref: '#/components/schemas/DccReplyBase'
      - type: object
        description: The reply for a trace request.
        additionalProperties: false
        properties:
          source:
            description: The source coordinate of the request
            nullable: true
            oneOf:
            - $ref: '#/components/schemas/Coordinate'
          circumstance:
            description: The circumstances of the request
            nullable: true
            oneOf:
            - $ref: '#/components/schemas/Circumstance'
          answer:
            description: The found answer and trace
            nullable: true
            oneOf:
            - $ref: '#/components/schemas/TraceAnswer'
    TraceAnswer:
      allOf:
      - $ref: '#/components/schemas/DistanceAnswer'
      - type: object
        description: A single answer for a lookup
        additionalProperties: false
        properties:
          trace:
            type: array
            description: The coordinates between source and destination.
            nullable: true
            items:
              $ref: '#/components/schemas/Coordinate'
    TraceRequest:
      type: object
      description: A request to look up a single trace
      additionalProperties: false
      properties:
        source:
          description: A required source for the calculation
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Coordinate'
        destination:
          description: The destination for the calculation
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Coordinate'
        circumstance:
          description: The circumstances of the calculations, optional
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Circumstance'
        cache:
          description: Configure cache handling
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/CacheConfig'
    MultiTraceReply:
      type: object
      description: The reply for a MultiTraceRequest.
      additionalProperties: false
      properties:
        traces:
          type: array
          description: The calculated traces.
          nullable: true
          items:
            $ref: '#/components/schemas/TraceData'
        circumstance:
          description: The circumstances of the request.
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Circumstance'
        apiRoadNetVersion:
          type: string
          description: The latest road net version the handling api server knows of.
          nullable: true
    TraceData:
      type: object
      description: Trace data for a single trace.
      additionalProperties: false
      properties:
        source:
          description: The source coordinate of the request.
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Coordinate'
        answer:
          description: The found answer and trace.
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/TraceAnswer'
        backendRoadNetVersion:
          type: string
          description: The road net version used by the backend server that handled the request.
          nullable: true
    MultiTraceRequest:
      type: object
      description: A request to look up multiple traces
      additionalProperties: false
      properties:
        coordinatePairs:
          type: array
          description: A required source for the calculation
          nullable: true
          items:
            $ref: '#/components/schemas/CoordinatePair'
        circumstance:
          description: The circumstances of the calculations, optional
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Circumstance'
        cache:
          description: Configure cache handling
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/CacheConfig'
    CoordinatePair:
      type: object
      description: A pair of coordinates to calculate traces between.
      additionalProperties: false
      properties:
        source:
          description: The source for the calculation
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Coordinate'
        destination:
          description: The destination for the calculation
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/Coordinate'
    RoadNetInfo:
      type: object
      description: Properties of a road net that are exposed by the api
      additionalProperties: false
      required:
      - roadNetId
      - description
      properties:
        roadNetId:
          type: string
          description: Unique id for the road net
          default: DK
          minLength: 1
        description:
          type: string
          description: Detailed description of the road net
          default: Denmark
          minLength: 1
        version:
          type: string
          description: The currently active version of the roadnet. If null the default version is active
          nullable: true
  securitySchemes:
    Basic:
      type: http
      description: Provider Basic Authentication
      name: Authorization
      in: header
      scheme: basic
security:
- Basic: []
tags:
- name: Version 0 endpoints
