openapi: 3.1.0
info:
  title: tooldata-api
  description: Tool diagnostic data API
  version: '1'
servers:
  - url: https://tooldata-api-test.milwaukeetool.com/
    x-amazon-apigateway-endpoint-configuration:
      disableExecuteApiEndpoint: true
    description: TEST API Environment
  - url: https://tooldata-api.milwaukeetool.com/
    x-amazon-apigateway-endpoint-configuration:
      disableExecuteApiEndpoint: true
    description: Production API Environment
paths:
  /v1/ble-advertisement-schema:
    get:
      responses:
        default:
          description: Default response for GET /v1/ble-advertisement-schema
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:ble-advertisement-api-retrieve_all-test/invocations
        connectionType: INTERNET
      tags:
        - ble-advertisement-schemas
    post:
      responses:
        default:
          description: Default response for POST /v1/ble-advertisement-schema
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:ble-advertisement-api-add-test/invocations
        connectionType: INTERNET
      tags:
        - ble-advertisement-schemas
  /v1/ble-advertisement-schema/{productHex}:
    get:
      responses:
        default:
          description: Default response for GET /v1/ble-advertisement-schema/{productHex}
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:ble-advertisement-api-retrieve_by_id-test/invocations
        connectionType: INTERNET
      tags:
        - ble-advertisement-schemas
    parameters:
      - name: productHex
        in: path
        description: Generated path parameter for productHex
        required: true
        schema:
          type: string
  /v1/ble-advertisement-schema/parse/raw:
    post:
      summary: Parse BLE advertisement schema raw data
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BleAdvertisementParseRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BleAdvertisementParseResponse'
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      security:
        - auth0-authorizer: []
      tags:
        - ble-advertisement-schemas
  /v1/buffered:
    get:
      responses:
        '200':
          description: Success response for GET /v1/buffered
          content:
            application/json:
              schema:
                type: object
                properties:
                  Item:
                    type: object
                    properties:
                      sequenceId:
                        type: number
                      mpbid:
                        type: string
                      cycleId:
                        type: string
                      memoryMapVersion:
                        type: string
                      memoryPointer:
                        type: string
                      progress:
                        type: string
              example:
                sequenceId: 1662561099032
                mpbid: 1000000
                cycleId: 5
                memoryMapVersion: 1
                memoryPointer: 1
                progress: COMPLETE
      security:
        - auth0-authorizer: []
      tags:
        - /v1/buffered
      parameters:
        - name: mpbid
          in: query
          description: Generated query parameter for mpbid
          required: true
          schema:
            type: string
        - name: sequenceId
          in: query
          description: Generated query parameter for sequenceId
          required: true
          schema:
            type: integer
  /buffered/v1/{mpbid}/{sequenceId}:
    post:
      responses:
        default:
          description: Default response for POST /v1/buffered
      security:
        - x-api-key: []
      tags:
        - /v1/buffered
      parameters:
        - name: mpbid
          in: path
          description: Generated path parameter for mpbid
          required: true
          schema:
            type: string
        - name: sequenceId
          in: path
          description: Generated path parameter for sequence id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - mpbid
                - dataType
              properties:
                mpbid:
                  type: string
                  minLength: 10
                  maxLength: 10
                dataType:
                  type: string
                  enum:
                    - sequential
                    - realtime
                sequenceId:
                  type: number
                totalEvents:
                  type: number
                userId:
                  type: string
                timestamp:
                  type: number
                generation:
                  type: number
                variableDefinitions:
                  type: array
                  items:
                    type: object
                    required:
                      - id
                      - length
                    properties:
                      id:
                        type: number
                      length:
                        type: number
                data:
                  type: array
                  items:
                    type: object
                    required:
                      - applicationId
                      - data
                    properties:
                      applicationId:
                        type: number
                      data:
                        type: array
                        items:
                          type: number
            example:
              mpbid: 1000000
              dataType: sequential
              sequenceId: 1231231234
              totalEvents: 123
              userId: 123
              timestamp: 1231231234
              generation: 123
              variableDefinitions:
                - id: 1
                  length: 1
              data:
                - applicationId: 1
                  data:
                    - 1
  /v1/buffered/create:
    put:
      responses:
        '200':
          description: Success response for PUT /v1/buffered/create
          content:
            application/json:
              schema:
                type: object
                properties:
                  Item:
                    type: object
                    properties:
                      s_id:
                        type: number
                      mpbid:
                        type: string
                      cycleId:
                        type: string
                      memoryMapVersion:
                        type: string
                      memoryPointer:
                        type: string
                      progress:
                        type: string
              example:
                sequenceId: 1231231234
                mpbid: 1000000
      security:
        - x-api-key: []
      tags:
        - /v1/buffered/create
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - mpbid
                - sequenceId
              properties:
                mpbid:
                  type: string
                sequenceId:
                  type: integer
    post:
      deprecated: true
      responses:
        '200':
          description: Success response for POST /v1/buffered/create
          content:
            application/json:
              schema:
                type: object
                properties:
                  sequenceId:
                    type: number
                  mpbid:
                    type: string
              example:
                sequenceId: 1231231234
                mpbid: 1000000
        '400':
          description: Invalid request body
        '500':
          description: Internal server error
      security:
        - x-api-key: []
      tags:
        - /v1/buffered/create
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - mpbid
                - memoryMapVersion
              properties:
                mpbid:
                  type: string
                  minLength: 10
                  maxLength: 10
                memoryMapVersion:
                  type: string
                cycleId:
                  type: string
                memoryPointer:
                  type: string
  /v1/buffered/lastread/{mpbid}:
    get:
      responses:
        '200':
          description: Success response for GET /v1/buffered/lastread/{mpbid}
          content:
            application/json:
              schema:
                type: object
                properties:
                  Item:
                    type: object
                    properties:
                      mpbid:
                        type: string
                      lastSequentialReadApplication:
                        type: string
                      lastRealtimeReadApplication:
                        type: string
              example:
                mpbid: 1000000
                lastSequentialReadApplication: 1
                lastRealtimeReadApplication: 1
      security:
        - x-api-key: []
      tags:
        - /v1/buffered/lastread/{mpbid}
      parameters:
        - name: mpbid
          in: path
          description: Generated path parameter for mpbid
          required: true
          schema:
            type: string
  /v1/data-logger/conversion-types:
    get:
      responses:
        default:
          description: Default response for GET /v1/data-logger/conversion-types
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:get-data-logger-conversion-types-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/data-logger/conversion-types
  /v1/data-logger/variables:
    get:
      responses:
        default:
          description: Default response for GET /v1/data-logger/variables
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:search-data-logger-variables-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/data-logger/variables
    post:
      responses:
        default:
          description: Default response for POST /v1/data-logger/variables
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:create-data-logger-variable-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/data-logger/variables
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - variableName
                - variableNumber
                - unit
                - conversion
                - sizeBytes
                - description
              properties:
                variableName:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: Descriptive name of what the variable represents
                variableNumber:
                  type: number
                  minimum: 1
                  maximum: 65535
                  description: >-
                    Unique identifier of the variable. Must be between 1 & 65535
                    (inclusive)
                unit:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: Unit of measurement for variables. E.g. RPM or mV or mA
                conversion:
                  type: number
                  description: Tells you how to convert the value to human readable format
                sizeBytes:
                  type: number
                  description: Amount of bytes used to represent the value of this variable
                description:
                  type: string
  /v1/data-logger/variables/{variableNumber}:
    get:
      responses:
        default:
          description: Default response for GET /v1/data-logger/variables/{variableNumber}
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:get-data-logger-variables-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      parameters:
        - name: variableNumber
          in: path
          required: true
          schema:
            type: number
      tags:
        - /v1/data-logger/variables/{variableNumber}
    put:
      responses:
        default:
          description: Default response for PUT /v1/data-logger/variables/{variableNumber}
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:update-data-logger-variable-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      parameters:
        - name: variableNumber
          in: path
          required: true
          schema:
            type: number
      tags:
        - /v1/data-logger/variables/{variableNumber}
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                variableName:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: Descriptive name of what the variable represents
                unit:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: Unit of measurement for variables. E.g. RPM or mV or mA
                conversion:
                  type: number
                  description: Tells you how to convert the value to human readable format
                sizeBytes:
                  type: number
                  description: Amount of bytes used to represent the value of this variable
                description:
                  type: string
    delete:
      responses:
        default:
          description: >-
            Default response for DELETE
            /v1/data-logger/variables/{variableNumber}
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:delete-data-logger-variable-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      parameters:
        - name: variableNumber
          in: path
          required: true
          schema:
            type: number
      tags:
        - /v1/data-logger/variables/{variableNumber}
    parameters:
      - name: variableNumber
        in: path
        description: Generated path parameter for variableNumber
        required: true
        schema:
          type: string
  /v1/firmware/event:
    post:
      responses:
        default:
          description: Default response for POST /v1/firmware/event
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:firmware-data-capture-post-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/firmware/event
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - mpbid
                - sourceFirmwareVersion
                - targetFirmwareVersion
                - statusCode
                - startTimestamp
                - endTimestamp
                - partNumber
                - bootLoaderType
              properties:
                startTimestamp:
                  description: >-
                    Unix epoch timestamp (UTC) representing when the firmware
                    flashing process started
                  type: number
                  example: 1620668566765
                endTimestamp:
                  type: number
                  description: >-
                    Unix epoch timestamp (UTC) representing when the firmware
                    flashing process ended
                  example: 1620668580488
                mpbid:
                  example: '0000000000'
                  type: string
                  minLength: 10
                  maxLength: 10
                  description: The unique MPBID of the tool receiving the updated firmware
                sourceFirmwareVersion:
                  minLength: 7
                  description: >-
                    Firmware version on the tool before flashing. Read from
                    memory address 0x000D. Can be either Milwaukee Tool
                    variation semver or HEX format. If semver format is used,
                    include all 4 version fields. If HEX format is used, it
                    should be 4bytes/8 characters in length. 
                  example: 0.0.0.2
                  type: string
                targetFirmwareVersion:
                  minLength: 7
                  description: >-
                    Firmware version on the tool after flashing. Read from
                    memory address 0x000D. Can be either Milwaukee Tool
                    variation semver or HEX format. Can be either semver or HEX
                    format. If semver format is used, include all 4 version
                    fields. If HEX format is used, it should be 4bytes/8
                    characters in length.
                  example: '01020304'
                  type: string
                firmwareImageLength:
                  description: >-
                    Length in bytes of the firmware image file being used for
                    flashing
                  example: 46864
                  type: number
                firmwareSource:
                  description: >-
                    Number representing source of the firmware. 0 =
                    None/Unknown, 1 = SideLoaded 2 = Artifactory
                  type: number
                  example: 2
                statusCode:
                  description: |-
                    Number representing status of the flash. Use 0 for success. 
                      success = 0,
                      signatureError = 1,
                      digestCompareError = 2,
                      crcCheckError = 3,
                      copyError = 4,
                      startUpCRCError = 5,
                      headerMismatchError = 6,
                      genericError = 7,
                      inProgress = 8,
                      lengthError = 9,
                  type: number
                  minimum: 0
                  maximum: 9
                  example: 0
                errorMessage:
                  description: >-
                    Optional descriptive error message to provide additional
                    context if an error occurred
                  type: string
                  example: Lost Connection
                clientVersion:
                  type: string
                  description: The version of the client doing the flashing
                  example: 1.0.0
                username:
                  example: example@milwaukeetool.com
                  type: string
                  description: Email address of the user doing the flashing
                filename:
                  example: g4drill1.bin
                  type: string
                  description: Name of the firmware file
                bootLoaderType:
                  description: >-
                    Number representing the type of the boot loader. Either 1 =
                    Slim or 2 = Standard
                  type: number
                  example: 1
                client:
                  description: What client was used to send the data e.g. ServiceApp
                  type: string
                  example: ServiceApp
                partNumber:
                  description: >-
                    This is the firmware part number of the tool being flashed.
                    Read from memory address 0x0009
                  type: string
                  example: '898002239'
                releaseType:
                  description: >-
                    This is the firmware release type that comes from
                    Artifactory if the firmware source is Artifactory
                  type: string
                  example: prototype
                uniqueDeviceId:
                  description: >-
                    The Unique Device ID of the MCU in the tool. Can be variable
                    in length by product. Read from memory address 0x007E
                  type: string
                  example: A1B2C3D40110022003300440
  /v1/hydraulic/async/{mpbid}:
    post:
      responses:
        default:
          description: Default response for POST /v1/hydraulic/async/{mpbid}
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        integrationSubtype: EventBridge-PutEvents
        credentials: arn:aws:iam::695256104809:role/tool-data-apigateway-eventbridge-invoke
        requestParameters:
          EventBusName: tool-data
          Resources: $context.authorizer.claims $request.path.mpbid
          Detail: $request.body
          DetailType: HYDRAULIC
          Source: ${stageVariables.event_bridge_stage_variable}
        payloadFormatVersion: '1.0'
        type: aws_proxy
        connectionType: INTERNET
        timeoutInMillis: 29000
      parameters:
        - name: mpbid
          in: path
          required: true
          schema:
            type: string
      tags:
        - /v1/hydraulic/async/{mpbid}
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - TotalEvents
                - TotalFullPressureEvents
                - EventsUntilNextService
              properties:
                TotalEvents:
                  type: integer
                TotalFullPressureEvents:
                  type: integer
                EventsUntilNextService:
                  type: integer
                Events:
                  type: array
                  items:
                    type: object
                    required:
                      - RecordedOn
                      - EventIndex
                      - PeakPressure
                      - PeakPressureMet
                    properties:
                      RecordedOn:
                        type: string
                      EventIndex:
                        type: integer
                      PeakPressure:
                        type: integer
                      PeakPressureMet:
                        type: boolean
                      EventType:
                        type: integer
    parameters:
      - name: mpbid
        in: path
        description: Generated path parameter for mpbid
        required: true
        schema:
          type: string
  /v1/tooldata:
    get:
      responses:
        default:
          description: Default response for GET /v1/tooldata
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        payloadFormatVersion: '1.0'
        type: http_proxy
        httpMethod: GET
        uri: https://onekeyapigw.milwaukeetool.com/prod/tooldata
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata
    post:
      responses:
        '200':
          description: >-
            A successful response will provide the ID of the newly created tool
            data read document.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      docId:
                        type: string
                        example: 65084eb740aac18c0b321415
              example:
                message: success
                data:
                  docId: 65084eb740aac18c0b321415
        default:
          description: Default response for POST /v1/tooldata
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:tool-diagnostics-validate-request-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - mpbid
                - timestamp
                - memoryMapVersion
                - sourceId
                - data
              properties:
                mpbid:
                  type: string
                  minLength: 10
                  maxLength: 10
                  example: FFFE000000
                timestamp:
                  type: number
                  description: >-
                    The timestamp of the data being sent in milliseconds since
                    epoch
                  example: 1616425200000
                memoryMap:
                  type: number
                  description: >-
                    The version of the memory map that the tool is using. Same
                    as memoryMapVersion
                  example: 1
                memoryMapVersion:
                  type: number
                  description: The version of the memory map that the tool is using
                  example: 1
                sourceId:
                  type: number
                  description: >-
                    The source of the data being sent. See [Source
                    Types](/docs/Tool%20Usage%20Data/Tool%20Memory%20Maps/Create%20&%20Edit/Fields#source-types)
                  example: 18
                svCode:
                  type: string
                  description: The service code of the data being sent.
                  example: SV1234
                serialNumber:
                  type: string
                  description: The serial number of the tool
                  example: '123456789'
                clientInfo:
                  type: object
                  required:
                    - hostName
                  properties:
                    ipAddress:
                      type: string
                      example: 123.123.123.123
                    version:
                      type: string
                      example: 1.0.0
                    userName:
                      type: string
                      example: testuser@milwaukeetool.com
                    hostName:
                      type: string
                      example: testhost
                tags:
                  $ref: '#/components/schemas/KeyValuePair'
                  description: Optional tags to add to the data being sent.
                data:
                  type: array
                  items:
                    type: object
                    required:
                      - addressHex
                      - valueHex
                    description: >-
                      The data read from the tool. canNodeId, canIndex, and
                      canSubIndex should be sent together if the data is from
                      CAN. There should only be a canNodeId or a
                      productInternalSubsystemId, not both.
                    properties:
                      addressHex:
                        type: string
                        description: The address of the data being sent in hex
                        example: '0000'
                      description:
                        type: string
                        description: The description of the data being sent (optional)
                        example: MPBID
                      valueHex:
                        type: string
                        description: The value of the data being sent in hex
                        example: FFFE000000
                      parameter:
                        type: string
                        description: The MX parameter of the data being sent (optional)
                        example: 464554434D494458
                      canNodeId:
                        type: string
                        description: The CAN node ID of the data being sent (optional)
                        example: '01'
                      canIndex:
                        type: string
                        description: The CAN index of the data being sent (optional)
                        example: '0000'
                      canSubIndex:
                        type: string
                        description: The CAN subindex of the data being sent (optional)
                        example: '02'
                      productInternalSubsystemId:
                        type: integer
                        description: >-
                          The product internal subsystem ID of the data being
                          sent (optional)
                        example: 1
            examples:
              Example without Tags:
                $ref: '#/components/examples/ToolReadV1RequestExample'
              Example with Tags:
                $ref: '#/components/examples/ToolReadV1RequestExampleWithTags'
  /v1/tooldata/all-products-warranty-info:
    get:
      responses:
        default:
          description: Default response for GET /v1/tooldata/all-products-warranty-info
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: GET
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:get-product-warranty-data-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/all-products-warranty-info
  /v1/tooldata/battery-pack-pcba:
    get:
      responses:
        default:
          description: Default response for GET /v1/tooldata/battery-pack-pcba
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:okat-battery-pack-pcba-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/battery-pack-pcba
    put:
      responses:
        default:
          description: Default response for PUT /v1/tooldata/battery-pack-pcba
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:okat-battery-pack-pcba-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/battery-pack-pcba
    post:
      responses:
        default:
          description: Default response for POST /v1/tooldata/battery-pack-pcba
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:okat-battery-pack-pcba-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/battery-pack-pcba
  /v1/tooldata/diagnostics/parsed:
    get:
      responses:
        default:
          description: Default response for GET /v1/tooldata/diagnostics/parsed
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:okat-diagnostics-parsed-histogram-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/diagnostics/parsed
  /v1/tooldata/enumeration-dictionary:
    get:
      responses:
        default:
          description: Default response for GET /v1/tooldata/enumeration-dictionary
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: GET
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:enumeration-dictionary-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/enumeration-dictionary
    put:
      responses:
        default:
          description: Default response for PUT /v1/tooldata/enumeration-dictionary
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: PUT
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:enumeration-dictionary-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/enumeration-dictionary
    post:
      responses:
        default:
          description: Default response for POST /v1/tooldata/enumeration-dictionary
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:enumeration-dictionary-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/enumeration-dictionary
    delete:
      responses:
        default:
          description: Default response for DELETE /v1/tooldata/enumeration-dictionary
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: DELETE
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:enumeration-dictionary-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/enumeration-dictionary
  /v1/tooldata/enumeration-dictionary/entry:
    get:
      responses:
        default:
          description: Default response for GET /v1/tooldata/enumeration-dictionary/entry
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: GET
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:enumeration-dictionary-entry-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/enumeration-dictionary/entry
    put:
      responses:
        default:
          description: Default response for PUT /v1/tooldata/enumeration-dictionary/entry
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: PUT
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:enumeration-dictionary-entry-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/enumeration-dictionary/entry
    post:
      responses:
        default:
          description: Default response for POST /v1/tooldata/enumeration-dictionary/entry
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:enumeration-dictionary-entry-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/enumeration-dictionary/entry
    delete:
      responses:
        default:
          description: >-
            Default response for DELETE
            /v1/tooldata/enumeration-dictionary/entry
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: DELETE
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:enumeration-dictionary-entry-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/enumeration-dictionary/entry
  /v1/tooldata/memory-map:
    get:
      summary: Get Memory Map
      description: >-
        Retrieves memory map definitions for a specified product and memory map
        version. Memory maps describe OpenLink addresses within a product's
        memory, what data is stored at those addresses, and how to parse and
        display that data.
      parameters:
        - name: product
          in: query
          required: true
          schema:
            type: integer
          description: The product ID (decimal format) to retrieve the memory map for.
          example: 298
        - name: memory_map_version
          in: query
          required: true
          schema:
            type: integer
          description: The version of the memory map to retrieve.
          example: 4
      responses:
        '200':
          description: Successfully retrieved memory map
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryMapResponse'
              example:
                message: success
                error: false
                data:
                  - id: 116379
                    product_id: 273
                    memory_map_version: 2
                    memory_address: '00000000'
                    data_length_hex: '002'
                    label: MEMORY MAP VERSION
                    is_local_histogram: 1
                    local_histogram_parse_type_id: 1
                    local_histogram_data_labels: null
                    data_length_int: 2
                    parameter: null
                    byte_swapped: 0
                    binary: 0
                    module_id: null
                    is_state_transition: 0
                    is_final_event_state: 0
                    product: 265
                    is_pcba_part_number: 0
                    comparator_value: null
                    product_id_hex: '0x0111'
                    created_at: '2024-06-18T21:04:46.000Z'
                    updated_at: '2024-06-18T21:04:46.000Z'
                    scale_value: null
                    enumeration_dictionary_uuid: null
                    byte_swap_word_length: 1
                    created_by: null
                    updated_by: null
                    mx_tool_segment_count: null
                    parse_offset_address: null
                    parse_segment_length: null
                    parent_field: null
                    can_nodeid: null
                    can_index: null
                    can_subindex: null
                    sub_labels: null
                    signed: 0
                    number_config: null
                    product_internal_subsystem_id: null
                  - id: 116381
                    product_id: 273
                    memory_map_version: 2
                    memory_address: '00000002'
                    data_length_hex: '004'
                    label: SW PART NUMBER
                    is_local_histogram: 1
                    local_histogram_parse_type_id: 1
                    local_histogram_data_labels: null
                    data_length_int: 4
                    parameter: null
                    byte_swapped: 0
                    binary: 0
                    module_id: null
                    is_state_transition: 0
                    is_final_event_state: 0
                    product: 265
                    is_pcba_part_number: 1
                    comparator_value: null
                    product_id_hex: '0x0111'
                    created_at: '2024-06-18T21:04:46.000Z'
                    updated_at: '2024-06-18T21:04:46.000Z'
                    scale_value: null
                    enumeration_dictionary_uuid: null
                    byte_swap_word_length: 1
                    created_by: null
                    updated_by: null
                    mx_tool_segment_count: null
                    parse_offset_address: null
                    parse_segment_length: null
                    parent_field: null
                    can_nodeid: null
                    can_index: null
                    can_subindex: null
                    sub_labels: null
                    signed: 0
                    number_config: null
                    product_internal_subsystem_id: null
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Error Retrieving Data
                  data:
                    type: array
                    example: []
                    items:
                      type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Memory map not found for the specified product and version
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: no data to return
                  error:
                    type: boolean
                    example: false
                  data:
                    type: array
                    items:
                      type: object
                    example: []
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: boolean
                    example: true
                  sql:
                    type: string
              examples:
                Product Not Found:
                  value:
                    message: >-
                      No matching product found. Verify ${productIdHex} exists
                      in ${stage}
                    error: true
                    sql: insertQueryString
                Unknown Error:
                  value:
                    message: unknown error
                    error: true
                    sql: insertQueryString
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:okat-memory-map-api-get-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/memory-map
    put:
      summary: Update Memory Map
      description: >-
        Updates an existing memory map definition for a specified product and
        memory map version. This endpoint allows you to modify the memory map
        data including field definitions, addresses, and parsing configurations.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryMapRequestBody'
            example:
              product: 530
              product_id: 530
              memory_map_version: 5
              data:
                - id: 892981
                  BINARY: '0'
                  BYTE_SWAP_WORD_LENGTH: '1'
                  BYTE_SWAPPED: '0'
                  CAN_INDEX: ''
                  CAN_NODEID: ''
                  CAN_SUBINDEX: '0000'
                  PRODUCT_INTERNAL_SUBSYSTEM_ID: ''
                  COMPARATOR_VALUE: ''
                  FIELD_SIZE: '2'
                  ENUMERATION_DICTIONARY_UUID: ''
                  IS_FINAL_EVENT_STATE: '0'
                  IS_PARSED: '1'
                  IS_PCBA_PART_NUMBER: '0'
                  COMMAND: MEMORY MAP VERSION
                  PARSED_DATA_LABELS: ''
                  PARSED_DATA_SUB_LABELS: ''
                  SIGNED: '0'
                  PARSE_TYPE_ID: '1'
                  HEX_ADDRESS: '0000'
                  MODULE_ID: ''
                  MX_TOOL_SEGMENT_COUNT: ''
                  PARAMETER: ''
                  PARENT_FIELD: ''
                  PARSE_OFFSET_ADDRESS: ''
                  PARSE_SEGMENT_LENGTH: ''
                  PRODUCT: '551'
                  SCALE_VALUE: ''
                  NUMBER_CONFIG: ''
                  ELEMENT_COUNT: ''
                - id: 892982
                  BINARY: '0'
                  BYTE_SWAP_WORD_LENGTH: '1'
                  BYTE_SWAPPED: '0'
                  CAN_INDEX: ''
                  CAN_NODEID: ''
                  CAN_SUBINDEX: '0000'
                  PRODUCT_INTERNAL_SUBSYSTEM_ID: ''
                  COMPARATOR_VALUE: ''
                  FIELD_SIZE: '5'
                  ENUMERATION_DICTIONARY_UUID: ''
                  IS_FINAL_EVENT_STATE: '0'
                  IS_PARSED: '1'
                  IS_PCBA_PART_NUMBER: '0'
                  COMMAND: MPBID
                  PARSED_DATA_LABELS: ''
                  PARSED_DATA_SUB_LABELS: ''
                  SIGNED: '0'
                  PARSE_TYPE_ID: ''
                  HEX_ADDRESS: '0004'
                  MODULE_ID: ''
                  MX_TOOL_SEGMENT_COUNT: ''
                  PARAMETER: ''
                  PARENT_FIELD: ''
                  PARSE_OFFSET_ADDRESS: ''
                  PARSE_SEGMENT_LENGTH: ''
                  PRODUCT: '551'
                  SCALE_VALUE: ''
                  NUMBER_CONFIG: ''
                  ELEMENT_COUNT: ''
              created_by: waad|C4DMlijjMl0qlMF_2I9jXuwIDxHK3j7qXo0xRzCyvd0
              updated_by: waad|C4DMlijjMl0qlMF_2I9jXuwIDxHK3j7qXo0xRzCyvd0
              updated_at: '2026-04-15T12:40:14.027Z'
      responses:
        '200':
          description: Memory map updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: success
                  error:
                    type: boolean
                    example: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: no data to update
                  error:
                    type: boolean
                    example: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          description: Internal Error Writing Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Error Writing Data
                  error:
                    type: boolean
                    example: true
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:okat-memory-map-api-put-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/memory-map
    post:
      summary: Create Memory Map
      description: >-
        Creates a new memory map definition for a specified product and memory
        map version. Memory maps define the structure and parsing rules for tool
        memory data, including OpenLink addresses, field sizes, and display
        configurations.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryMapRequestBody'
            example:
              product: 530
              product_id: 530
              memory_map_version: 5
              data:
                - id: 892981
                  BINARY: '0'
                  BYTE_SWAP_WORD_LENGTH: '1'
                  BYTE_SWAPPED: '0'
                  CAN_INDEX: ''
                  CAN_NODEID: ''
                  CAN_SUBINDEX: '0000'
                  PRODUCT_INTERNAL_SUBSYSTEM_ID: ''
                  COMPARATOR_VALUE: ''
                  FIELD_SIZE: '2'
                  ENUMERATION_DICTIONARY_UUID: ''
                  IS_FINAL_EVENT_STATE: '0'
                  IS_PARSED: '1'
                  IS_PCBA_PART_NUMBER: '0'
                  COMMAND: MEMORY MAP VERSION
                  PARSED_DATA_LABELS: ''
                  PARSED_DATA_SUB_LABELS: ''
                  SIGNED: '0'
                  PARSE_TYPE_ID: '1'
                  HEX_ADDRESS: '0000'
                  MODULE_ID: ''
                  MX_TOOL_SEGMENT_COUNT: ''
                  PARAMETER: ''
                  PARENT_FIELD: ''
                  PARSE_OFFSET_ADDRESS: ''
                  PARSE_SEGMENT_LENGTH: ''
                  PRODUCT: '551'
                  SCALE_VALUE: ''
                  NUMBER_CONFIG: ''
                  ELEMENT_COUNT: ''
                - id: 892982
                  BINARY: '0'
                  BYTE_SWAP_WORD_LENGTH: '1'
                  BYTE_SWAPPED: '0'
                  CAN_INDEX: ''
                  CAN_NODEID: ''
                  CAN_SUBINDEX: '0000'
                  PRODUCT_INTERNAL_SUBSYSTEM_ID: ''
                  COMPARATOR_VALUE: ''
                  FIELD_SIZE: '5'
                  ENUMERATION_DICTIONARY_UUID: ''
                  IS_FINAL_EVENT_STATE: '0'
                  IS_PARSED: '1'
                  IS_PCBA_PART_NUMBER: '0'
                  COMMAND: MPBID
                  PARSED_DATA_LABELS: ''
                  PARSED_DATA_SUB_LABELS: ''
                  SIGNED: '0'
                  PARSE_TYPE_ID: ''
                  HEX_ADDRESS: '0004'
                  MODULE_ID: ''
                  MX_TOOL_SEGMENT_COUNT: ''
                  PARAMETER: ''
                  PARENT_FIELD: ''
                  PARSE_OFFSET_ADDRESS: ''
                  PARSE_SEGMENT_LENGTH: ''
                  PRODUCT: '551'
                  SCALE_VALUE: ''
                  NUMBER_CONFIG: ''
                  ELEMENT_COUNT: ''
                - id: 892983
                  BINARY: '0'
                  BYTE_SWAP_WORD_LENGTH: '1'
                  BYTE_SWAPPED: '0'
                  CAN_INDEX: ''
                  CAN_NODEID: ''
                  CAN_SUBINDEX: '0000'
                  PRODUCT_INTERNAL_SUBSYSTEM_ID: ''
                  COMPARATOR_VALUE: ''
                  FIELD_SIZE: '4'
                  ENUMERATION_DICTIONARY_UUID: ''
                  IS_FINAL_EVENT_STATE: '0'
                  IS_PARSED: '1'
                  IS_PCBA_PART_NUMBER: '0'
                  COMMAND: SW PART NUMBER
                  PARSED_DATA_LABELS: ''
                  PARSED_DATA_SUB_LABELS: ''
                  SIGNED: '0'
                  PARSE_TYPE_ID: '1'
                  HEX_ADDRESS: '0009'
                  MODULE_ID: ''
                  MX_TOOL_SEGMENT_COUNT: ''
                  PARAMETER: ''
                  PARENT_FIELD: ''
                  PARSE_OFFSET_ADDRESS: ''
                  PARSE_SEGMENT_LENGTH: ''
                  PRODUCT: '551'
                  SCALE_VALUE: ''
                  NUMBER_CONFIG: ''
                  ELEMENT_COUNT: ''
              created_by: waad|C4DMlijjMl0qlMF_2I9jXuwIDxHK3j7qXo0xRzCyvd0
              updated_by: waad|C4DMlijjMl0qlMF_2I9jXuwIDxHK3j7qXo0xRzCyvd0
              updated_at: '2026-04-15T12:40:14.027Z'
      responses:
        '200':
          description: Memory map created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: success
                  error:
                    type: boolean
                    example: false
        '400':
          description: Bad Request - Invalid input data
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: no data to insert
                  error:
                    type: boolean
                    example: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          description: Internal Error Writing Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: >-
                      No matching product found. Verify ${productIdHex} exists
                      in ${stage}
                  error:
                    type: boolean
                    example: true
                  sql:
                    type: string
                    example: insertQueryString
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:okat-memory-map-api-post-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/memory-map
  /v1/tooldata/product:
    get:
      summary: Get Product Metadata
      description: >-
        This endpoint returns product metadata. If a product ID is provided, a
        single product will be returned. If no product ID is provided, all
        products will be returned.
      parameters:
        - name: productid
          in: query
          required: false
          schema:
            type: string
            description: >-
              Product ID in hex format with prefix `0x`. Note: If this parameter
              is not provided, all products will be returned. Also note: when
              querying for a single product, additional information is returned
              (e.g. - imageUrl)
          example: '0x0001'
      responses:
        '200':
          description: Successfully retrieved ALL products
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllProductsResponse'
        '201':
          description: Successfully retrieved SINGLE product
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleProductResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              example:
                error: Forbidden
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                error: Internal Server Error
                message: An unexpected error occurred
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:product-api-get-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/product
    put:
      summary: Update a single product info
      responses:
        default:
          description: Default response for PUT /v1/tooldata/product
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:product-api-put-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/product
    post:
      summary: Create a new product definition
      responses:
        default:
          description: Default response for POST /v1/tooldata/product
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:product-api-post-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/product
  /v1/tooldata/product/blemoduletypes:
    get:
      responses:
        default:
          description: Default response for GET /v1/tooldata/product/blemoduletypes
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:ble-module-types-api-get-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/product/blemoduletypes
  /v1/tooldata/product/platformtypes:
    get:
      responses:
        default:
          description: Default response for GET /v1/tooldata/product/platformtypes
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:product-platform-types-api-get-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/product/platformtypes
  /v1/tooldata/service-instance:
    get:
      summary: Get service instance images
      description: Retrieve Images associated with a SV Code.
      parameters:
        - name: mpbid
          in: query
          schema:
            type: string
          description: MPBID to query service instances
          example: 01320008F8
        - name: svcode
          in: query
          schema:
            type: string
          description: SVCode to query service instances
          example: SV1234567
        - name: nonopenlink
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
          description: Flag to query non-open link tools
          example: 'false'
        - name: serialNumber
          in: query
          schema:
            type: string
          description: Serial number to query service instances for reports
          example: K16AD193900033
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ServiceInstance'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
    put:
      summary: Update service instance image
      description: Update a record for the images associated with a SV Code.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageCaptureValues'
      responses:
        '200':
          description: Successfully updated image
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ServiceInstance'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
    post:
      summary: Create new service instance image
      description: Create a record for images associated with a SV Code.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageCaptureValues'
      responses:
        '200':
          description: Successfully created image
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ServiceInstance'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
  /v1/tooldata/service-instance/image:
    put:
      summary: Update service instance image
      description: Update a record for the images associated with a SV Code.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageCaptureValues'
      responses:
        '200':
          description: Successfully updated image
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ServiceInstance'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
    post:
      summary: Create new service instance image
      description: Create a record for images associated with a SV Code.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageCaptureValues'
      responses:
        '200':
          description: Successfully created image
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ServiceInstance'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
    delete:
      summary: Delete service instance image
      description: Delete a record for the images associated with a SV Code.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteServiceInstanceImageRequest'
      responses:
        '200':
          description: Successfully deleted image
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ServiceInstance'
        '400':
          $ref: '#/components/responses/BadRequestParams'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
  /v1/tooldata/service-instance/report:
    post:
      summary: Generate report
      description: Generate PDF report for the service event.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Report'
      responses:
        '200':
          description: Successfully generated report
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
    get:
      summary: Get report
      description: Generate PDF report from a previous service event.
      parameters:
        - name: ulid
          in: query
          required: true
          schema:
            type: string
          description: ULID identifier for the report
          example: 01JDJ5VWM7P2VJY9Y6T9CS79J0
      responses:
        '200':
          description: Successfully retrieved report
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
  /v1/tooldata/service-instance/rework:
    post:
      summary: Save rework data
      description: Save data for the reworks.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReworkData'
      responses:
        '200':
          description: Successfully saved rework data
          content:
            application/json:
              schema:
                type: string
                example: Success
        '400':
          $ref: '#/components/responses/BadRequestParams'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
    get:
      summary: Get rework records
      description: Retrieve rework records based on query parameters
      parameters:
        - name: reworkId
          in: query
          schema:
            type: string
          example: 01JDJ5VWM7P2VJY9Y6T9CS79J0
      responses:
        '200':
          description: Successfully retrieved rework records
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReworkData'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
  /v1/tooldata/service-instance/calibration:
    post:
      summary: Create impact wrench calibration
      description: Save the calibration data for tools calibrated at PRC.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImpactWrenchCalibration'
      responses:
        '200':
          description: Successfully created calibration
          content:
            application/json:
              schema:
                type: string
                example: Success
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - Service Instance
  /v1/tooldata/tag:
    post:
      summary: Create tag.
      description: >
        This endpoint creates a new tag (used for tagging tool data). The
        request body must include the tag's "name", "type", and "queryLabel". 
        If the tag's type is "object", the request body must also contain a
        "properties" array of defined objects.  Each property object must
        contain "name", "type" (i.e., "string", "number", or "boolean"),
        "queryLabel", and "required" fields. If the tag's type is an "enum", the
        request body must also have a "properties" array which contains the
        possible values for the tag.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagRequestBody'
            examples:
              Object Tag:
                $ref: '#/components/examples/TagsObjectTagRequestExample'
              Enum Tag:
                $ref: '#/components/examples/TagsEnumTagRequestExample'
              String Tag:
                $ref: '#/components/examples/TagsStringTagRequestExample'
              Number Tag:
                $ref: '#/components/examples/TagsNumberTagRequestExample'
              Boolean Tag:
                $ref: '#/components/examples/TagsBooleanTagRequestExample'
      responses:
        '201':
          description: Successful response for POST /v1/tooldata/tag
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TagData'
              examples:
                Object Tag:
                  $ref: '#/components/examples/TagsObjectTagResponseExample'
                Enum Tag:
                  $ref: '#/components/examples/TagsEnumTagResponseExample'
                String Tag:
                  $ref: '#/components/examples/TagsStringTagResponseExample'
                Number Tag:
                  $ref: '#/components/examples/TagsNumberTagResponseExample'
                Boolean Tag:
                  $ref: '#/components/examples/TagsBooleanTagResponseExample'
        '400':
          $ref: '#/components/responses/BadRequestBody'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - x-api-key: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:process-event-data-create-tool-tag-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/tag
  /v1/tooldata/tag/{tagId}:
    get:
      summary: Get tag by ID.
      description: Get tag by ID.
      parameters:
        - name: tagId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/TagId'
      responses:
        '200':
          description: Successful response for GET /v1/tooldata/tag/{tagId}
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TagData'
              examples:
                Object Tag:
                  $ref: '#/components/examples/TagsObjectTagResponseExample'
                Enum Tag:
                  $ref: '#/components/examples/TagsEnumTagResponseExample'
                String Tag:
                  $ref: '#/components/examples/TagsStringTagResponseExample'
                Number Tag:
                  $ref: '#/components/examples/TagsNumberTagResponseExample'
                Boolean Tag:
                  $ref: '#/components/examples/TagsBooleanTagResponseExample'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        integrationSubtype: Lambda-Proxy
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        requestParameters:
          integration.request.path.tagId: method.request.path.tagId
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: GET
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:process-event-data-get-tool-tag-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/tag/{tagId}
    patch:
      summary: Update tag by ID.
      description: Update tag by ID.
      parameters:
        - name: tagId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/TagId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagUpdateRequestBody'
            examples:
              Object Tag:
                $ref: '#/components/examples/TagsObjectTagRequestExample'
              Enum Tag:
                $ref: '#/components/examples/TagsEnumTagRequestExample'
              String Tag:
                $ref: '#/components/examples/TagsStringTagRequestExample'
              Number Tag:
                $ref: '#/components/examples/TagsNumberTagRequestExample'
              Boolean Tag:
                $ref: '#/components/examples/TagsBooleanTagRequestExample'
      responses:
        '200':
          description: Successful response for PATCH /v1/tooldata/tag/{tagId}
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TagData'
              examples:
                Object Tag:
                  $ref: '#/components/examples/TagsObjectTagResponseExample'
                Enum Tag:
                  $ref: '#/components/examples/TagsEnumTagResponseExample'
                String Tag:
                  $ref: '#/components/examples/TagsStringTagResponseExample'
                Number Tag:
                  $ref: '#/components/examples/TagsNumberTagResponseExample'
                Boolean Tag:
                  $ref: '#/components/examples/TagsBooleanTagResponseExample'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        integrationSubtype: Lambda-Proxy
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        requestParameters:
          integration.request.path.tagId: method.request.path.tagId
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: PATCH
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:process-event-data-patch-tool-tag-by-id-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/tag/{tagId}
  /v1/tooldata/tags:
    get:
      summary: Get all tags.
      description: Get all tags.
      responses:
        '200':
          description: Successful retrieving tags response for GET /v1/tooldata/tags
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTagsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: GET
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:process-event-data-get-tool-tags-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/tags
  /v1/tooldata/tags/query:
    get:
      summary: Get tags by query.
      description: Get tags based on specified query parameters.
      parameters:
        - name: name
          in: query
          description: The name of the resource
          schema:
            type: string
        - name: type
          in: query
          description: The type of the resource
          schema:
            type: string
            example: string
        - name: limit
          in: query
          description: The maximum number of results to return
          schema:
            type: integer
            minimum: 1
            maximum: 100
            example: 10
        - name: orderBy
          in: query
          description: Field to order the results by
          schema:
            type: string
            enum:
              - name
              - type
              - createdAt
              - updatedAt
        - name: orderDirection
          in: query
          description: Order direction of the results
          schema:
            type: string
            enum:
              - ascending
              - descending
              - asc
              - desc
              - '1'
              - '-1'
      responses:
        '200':
          description: Successful retrieving tags response for GET /v1/tooldata/tags/query
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTagsResponse'
              examples:
                Object Tag:
                  $ref: '#/components/examples/TagsObjectTagResponseExample'
                Enum Tag:
                  $ref: '#/components/examples/TagsEnumTagResponseExample'
                String Tag:
                  $ref: '#/components/examples/TagsStringTagResponseExample'
                Number Tag:
                  $ref: '#/components/examples/TagsNumberTagResponseExample'
                Boolean Tag:
                  $ref: '#/components/examples/TagsBooleanTagResponseExample'
        '400':
          $ref: '#/components/responses/BadRequestQueryParameters'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: GET
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:process-event-data-get-tool-tags-by-query-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/tags
  /v1/tooldata/toolread/{toolreadId}:
    parameters:
      - name: toolreadId
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/ToolReadId'
    get:
      summary: Get a toolread document by ID.
      responses:
        '200':
          description: Successful response for GET /v1/tooldata/toolread/{toolreadId}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolReadResponse'
              examples:
                'Response Example #1':
                  $ref: '#/components/examples/ToolReadResponseExample'
        '400':
          $ref: '#/components/responses/BadRequestId'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        integrationSubtype: Lambda-Proxy
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        requestParameters:
          integration.request.path.toolreadId: method.request.path.toolreadId
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: GET
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:process-event-data-get-tool-read-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/toolread/{toolreadId}
    patch:
      summary: Update a toolread document by ID.
      description: >
        This endpoint updates a toolread document by it's ID. The request url
        must include the ID of the toolread document to be updated. The request
        body should only contain the data to be updated. Currently, the only
        attributes that can be updated are: "mpbid", "serialNumber",
        "productId", "batteryPackPcbaId", "memoryMapVersion", "sourceId", and
        "tags".
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolReadUpdateRequestBody'
      responses:
        '200':
          description: Successful response for PATCH /v1/tooldata/toolread/{toolreadId}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolReadResponse'
              examples:
                'Response Example #1':
                  $ref: '#/components/examples/ToolReadResponseExample'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      tags:
        - /v1/tooldata/toolread/{toolreadId}
  /v1/tooldata/toolread/parse:
    post:
      summary: >-
        Parse tool read data, with an option to persist the results to the
        database.
      x-internal: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolReadParseRequestBody'
            examples:
              Parse Tool Data and Persist (like a normal tool data upload):
                $ref: '#/components/examples/ToolReadParseRequestExample'
              Parse Tool Data and Do Not Persist (like a normal tool data upload):
                $ref: '#/components/examples/ToolReadParseRequestNoPersistExample'
      responses:
        '200':
          description: Successfully reparsed the tool read data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolReadResponse'
              examples:
                Parse Tool Data and Persist (like a normal tool data upload):
                  $ref: '#/components/examples/ToolReadResponseExample'
                Parse Tool Data and Persist:
                  $ref: >-
                    #/components/examples/ToolReadParseWithPersistResponseExample
                Parse Tool Data and Do Not Persist:
                  $ref: '#/components/examples/ToolReadParseResponseExample'
                Bad Parsed Tool Data:
                  $ref: '#/components/examples/ToolReadParseBadDataResponseExample'
        '400':
          $ref: '#/components/responses/BadRequestId'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: PUT
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:process-event-data-reparse-toolread-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 290001
      tags:
        - /v1/tooldata/toolread/parse
  /v1/tooldata/toolreads/reparse:
    post:
      summary: Reparse multiple toolread documents.
      description: >
        Reparse ToolRead documents that match the request filters and start the
        reprocessing workflow.


        At least one filter field must be provided, or set `reparseAll` to
        `true` to match all ToolRead documents.

        Empty filter values (for example `{ "ids": [] }`) are not treated as
        filters.


        When `reparseAll` is `true`, no filter criteria are applied. Optional
        `sort`, `skip`, and `limit` values still control which documents are
        selected.
      x-internal: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolReadReparseRequestBody'
            examples:
              By an Array of ToolRead IDs:
                $ref: '#/components/examples/ToolReadReparseRequestIdsExample'
              By an Array of ToolRead IDs with Version:
                $ref: >-
                  #/components/examples/ToolReadReparseRequestIdsAndMMVersionExample
              By an Array of MPBIDs:
                $ref: '#/components/examples/ToolReadReparseRequestMpbidsExample'
              By an Array of Serial Numbers:
                $ref: >-
                  #/components/examples/ToolReadReparseRequestSerialNumbersExample
              By an Array of Product IDs:
                $ref: '#/components/examples/ToolReadReparseRequestProductIdsExample'
              By Parse Status:
                $ref: '#/components/examples/ToolReadReparseRequestParseStatusExample'
              By Parse Error Codes:
                $ref: '#/components/examples/ToolReadReparseRequestParseErrorsExample'
              By Tags:
                $ref: '#/components/examples/ToolReadReparseRequestTagsExample'
              By Custom Date Range:
                $ref: '#/components/examples/ToolReadReparseRequestDateRangeExample'
              By Combination of Filters:
                $ref: '#/components/examples/ToolReadReparseRequestCombinationExample'
              Reparse All ToolReads:
                $ref: '#/components/examples/ToolReadReparseRequestReparseAllExample'
              Reparse All with Limit:
                $ref: >-
                  #/components/examples/ToolReadReparseRequestReparseAllWithLimitExample
      responses:
        '200':
          description: Successfully re-parsed the tool data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolReadReparseManyResponse'
              examples:
                'Response Example #1':
                  $ref: '#/components/examples/ToolReadReparseManyResponseExample'
        '400':
          $ref: '#/components/responses/BadRequestBody'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - auth0-authorizer: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:process-event-data-reparse-toolreads-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/toolread/reparse
  /v1/tooldata/toolreads/query:
    get:
      summary: Get toolreads by query
      description: Get toolreads based on specified query parameters
      parameters:
        - in: query
          name: mpbid
          schema:
            type: string
          description: Filter documents by mpbid field
          example: 006700ec12
        - in: query
          name: serialNumber
          schema:
            type: string
          description: Filter documents by serialNumber field
          example: J64AD195200734
        - in: query
          name: productId
          schema:
            type: string
          description: Filter documents by productId field
          example: '0067'
        - in: query
          name: batteryPackPcbaId
          schema:
            type: string
          description: Filter documents by batteryPackPcbaId field
          example: ''
        - in: query
          name: parseStatus
          schema:
            type: string
            enum:
              - PARSED
              - NOT_PARSED
              - IN_PROCESS
              - ERROR
          description: Filter documents by parseStatus field
          example: PARSED
        - in: query
          name: memoryMapVersion
          schema:
            type: number
          description: Filter documents by memoryMapVersion field
          example: 3
        - in: query
          name: sourceId
          schema:
            type: number
          description: Filter documents by sourceId field
          example: 18
        - in: query
          name: platformtag
          schema:
            type: string
            enum:
              - M12
              - M18
              - MX
              - ONEKEY
              - Other
          description: Filter documents by tags.PLATFORM field
          example: M18
        - in: query
          name: customernametag
          schema:
            type: string
            example: dataplatform@milwaukeetool.com
        - in: query
          name: tagQueryLabelName
          description: >-
            This is the name of the tag's queryLabel. Use the Tag's queryLabel
            when filtering by a tag.
          schema:
            type: string
            example: tagValue
        - in: query
          name: updatedAt
          schema:
            type: string
            format: date-time (ISO 8601 format)
          description: Filter documents by updatedAt field
          example: '2023-11-30T14:52:07.855Z'
        - in: query
          name: createdAt
          schema:
            type: string
            format: date-time (ISO 8601 format)
          description: Filter documents by createdAt field
          example: '2023-11-30T14:52:03.143Z'
        - in: query
          name: updatedAtStart
          schema:
            type: string
            format: date-time (ISO 8601 format)
          description: Filter documents by updatedAt Date Range (Start Date)
          example: '2023-11-30T14:52:07.855Z'
        - in: query
          name: updatedAtEnd
          schema:
            type: string
            format: date-time (ISO 8601 format)
          description: Filter documents by updatedAt Date Range (End Date)
          example: '2023-11-30T16:52:03.143Z'
        - in: query
          name: createdAtStart
          schema:
            type: string
            format: date-time (ISO 8601 format)
          description: Filter documents by createdAt Date Range (Start Date)
          example: '2023-11-30T14:52:07.855Z'
        - in: query
          name: createdAtEnd
          schema:
            type: string
            format: date-time (ISO 8601 format)
          description: Filter documents by createdAt Date Range (End Date)
          example: '2023-11-30T15:52:03.143Z'
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 100
          description: The maximum number of results to return
          example: 100
        - in: query
          name: sort
          schema:
            type: string
          description: Field to sort the results by (Use a leading "-" for "desc")
          example: '-createdAt'
        - in: query
          name: skip
          schema:
            type: integer
            minimum: 0
          description: The number of results to skip
          example: 5
      responses:
        '200':
          description: >-
            Successful retrieving toolreads response for GET
            /v1/tooldata/toolreads
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolReadResponseNoData'
              examples:
                'Response Example #1':
                  $ref: '#/components/examples/ToolReadResponseNoDataExample'
        '400':
          $ref: '#/components/responses/BadRequestQueryParameters'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        integrationSubtype: Lambda-Proxy
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: GET
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:process-event-data-get-toolreads-by-query-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/toolreads/query
  /v1/tooldata/tool-electronics-state:
    get:
      responses:
        default:
          description: Default response for GET /v1/tooldata/tool-electronics-state
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: GET
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:get-tool-electronics-state-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/tool-electronics-state
    put:
      responses:
        default:
          description: Default response for PUT /v1/tooldata/tool-electronics-state
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: PUT
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:put-tool-electronics-state-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/tool-electronics-state
    post:
      responses:
        default:
          description: Default response for POST /v1/tooldata/tool-electronics-state
      security:
        - auth0-lambda: []
      x-amazon-apigateway-integration:
        credentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        payloadFormatVersion: '2.0'
        type: aws_proxy
        httpMethod: POST
        uri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:post-tool-electronics-state-api-test/invocations
        connectionType: INTERNET
        timeoutInMillis: 29000
      tags:
        - /v1/tooldata/tool-electronics-state
  /v2/buffered/create:
    post:
      responses:
        '200':
          description: >-
            Returns back the sequence created for the new upload along with the
            last successfully parsed application ids for sequential and realtime
            data types
          content:
            application/json:
              schema:
                type: object
                properties:
                  mpbid:
                    type: string
                    minLength: 10
                    maxLength: 10
                  sequenceId:
                    type: integer
                  lastSequentialReadApplication:
                    type: integer
                  lastRealtimeReadApplication:
                    type: integer
              examples:
                example1:
                  value:
                    mpbid: '0001000000'
                    sequenceId: 1
                    lastSequentialReadApplication: 0
                    lastRealtimeReadApplication: 0
      security:
        - x-api-key: []
      tags:
        - /v2/buffered/create
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - mpbid
                - memoryMapVersion
              properties:
                mpbid:
                  type: string
                  minLength: 10
                  maxLength: 10
                memoryMapVersion:
                  type: string
                cycleId:
                  type: string
                memoryPointer:
                  type: string
            example:
              sequenceId: 1231231234
              mpbid: 1000000
              memoryMapVersion: 1
              cycleId: 1231231234
              memoryPointer: 1
  /v1/unit-replacement:
    post:
      summary: Record the replacement of a unit
      tags:
        - UnitReplacement
      description: Create a record to indicate that one unit has been replaced by another
      security:
        - auth0-authorizer: []
      requestBody:
        description: Request body for unit replacement
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                oldSerialNumber:
                  type: string
                  example: XYZ789
                newSerialNumber:
                  type: string
                  example: ABC123
                svCode:
                  type: string
                  example: SV123
                createdBy:
                  type: string
                  example: jim.bob@milwaukeetool.com
      responses:
        '200':
          description: Unit successfully marked replaced
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnitReplacementRecord'
        '400':
          description: Bad request
          content:
            application/json:
              example:
                error: Bad Request
                message: Error message
        '409':
          description: Conflict
          content:
            application/json:
              example:
                error: Conflict
                message: Entry for Serial Number already exists
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                error: Internal Server Error
                message: An unexpected error occurred
  /v1/unit-replacements:
    get:
      summary: Get unit replacement record
      tags:
        - UnitReplacement
      description: Retrieve unit replacement record objects.
      operationId: getUnitReplacement
      parameters:
        - name: oldSerialNumber
          in: query
          required: false
          description: Only return objects that match with this old serial number
          schema:
            type: string
        - name: newSerialNumber
          in: query
          required: false
          description: Only return objects that match with this new serial number
          schema:
            type: string
        - name: page
          in: query
          required: false
          description: 'Which page of data to return (default: 1)'
          schema:
            type: number
        - name: pageSize
          in: query
          required: false
          description: 'How many records to return on each page (default: 10)'
          schema:
            type: number
      security:
        - auth0-authorizer: []
      responses:
        '200':
          description: Successfully retrieved unit replacement record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnitReplacementSearchResult'
              example:
                data:
                  - oldSerialNumber: XYZ789
                    newSerialNumber: ABC123
                    svCode: SV123
                    createdAt: '2021-01-11T00:00:00.000Z'
                    createdBy: Andrew
                  - oldSerialNumber: ABC123
                    newSerialNumber: ABC456
                    svCode: SV123
                    createdAt: 1661280000
                    createdBy: Andrew
                currentPage: 1
                totalPages: 1
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                error: Internal Server Error
                message: An unexpected error occurred
  /v1/unit-replacement/history:
    get:
      summary: Get unit replacement history for a single unit
      tags:
        - UnitReplacement
      description: >-
        Retrieve the unit replacement history for a specific serial number. For
        retrieving the entire chain of replacement events where a particular
        {sn} was involved
      operationId: getUnitReplacementHistory
      parameters:
        - name: serialNumber
          in: query
          required: true
          description: Serial number of the unit for which history is to be retrieved
          schema:
            type: string
      security:
        - auth0-authorizer: []
      responses:
        '200':
          description: >-
            Successfully retrieved unit replacement history. Most recent
            replacement event is first in the array.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    oldSerialNumber:
                      type: string
                      example: XYZ789
                    newSerialNumber:
                      type: string
                      example: ABC123
                    svCode:
                      type: string
                      example: SV123
                    createdAt:
                      type: string
                      example: '2021-01-11T00:00:00.000Z'
                    uuid:
                      type: string
                      example: 12345678-1234-1234-1234-123456789012
              example:
                - oldSerialNumber: ABC123
                  newSerialNumber: ABC456
                  svCode: SV111
                  createdAt: '2021-01-11T00:00:00.000Z'
                  uuid: 12345678-1234-1234-1234-123456789012
                - oldSerialNumber: ABC456
                  newSerialNumber: ABC789
                  svCode: SV222
                  createdAt: '2021-01-11T00:00:00.000Z'
                  uuid: 12345678-1234-1234-1234-123456789012
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                error: Internal Server Error
                message: An unexpected error occurred
components:
  securitySchemes:
    auth0-lambda:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authorizer:
        identitySource: $request.header.Authorization
        authorizerUri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:auth0-authorizer-test:11/invocations
        authorizerCredentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        authorizerPayloadFormatVersion: '2.0'
        authorizerResultTtlInSeconds: 0
        type: request
        enableSimpleResponses: true
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      x-amazon-apigateway-authorizer:
        identitySource: $request.header.x-api-key
        authorizerUri: >-
          arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:695256104809:function:api-key-authorizer-test:21/invocations
        authorizerCredentials: arn:aws:iam::695256104809:role/apigateway-lambda-invoke
        authorizerPayloadFormatVersion: '2.0'
        authorizerResultTtlInSeconds: 0
        type: request
        enableSimpleResponses: true
    auth0-authorizer:
      type: oauth2
      flows: {}
      x-amazon-apigateway-authorizer:
        identitySource: $request.header.Authorization
        jwtConfiguration:
          audience:
            - https://tooldata-api-test.milwaukeetool.com/
            - onekeyapi.milwaukeetool.com
          issuer: https://idtest.milwaukeetool.com/
        type: jwt
  schemas:
    BleAdvertisementParseResponse:
      type: object
      properties:
        ParsedResults:
          type: array
          items:
            type: object
            properties:
              RawByte:
                type: string
                example: 65010000008A0064
              StaticRules:
                description: The next state to execute (or undefined)
                type: object
                example:
                  company-code: 0
                  mpbid_parsed: '0x0'
                  locked: false
                  coincell: 0
                  recentflag: < 1 hour
                  bluetooth-firmware-version: 0
                  tool-firmware-version: 0
                  service-state: Non-Functional, needs service
                  total-trigger-pulls: 0
                  tool-advertisement-sequence-number: 0
              CustomRules:
                type: object
                example:
                  total-cycles: 25856
        BLEDefinitionStatus:
          type: string
          example: Draft
    BleAdvertisementParseRequest:
      type: object
      required:
        - ProductHex
        - RawBytes
      properties:
        ProductHex:
          type: string
          example: '0000'
        RawBytes:
          type: array
          items:
            type: string
            example: 65010000008A0064
        BLE_Definition_JSON:
          $ref: '#/components/schemas/BleAdvertisementDefinition'
    BleAdvertisementDefinition:
      type: object
      properties:
        ActiveStatus:
          type: integer
          example: 0
        LastModifiedBy:
          type: string
          example: jimbo@milwaukeetool.com
        ProductHex:
          type: string
          example: '0000'
        TotalBits:
          type: integer
          example: 176
        StaticRules:
          type: array
          items:
            type: object
            properties:
              StartBit:
                type: integer
                example: 0
              Length:
                type: integer
                example: 16
              DataType:
                type: string
                example: int
              FieldName:
                type: string
                example: company-code
              Codes:
                type: array
                items:
                  type: object
                  properties:
                    Value:
                      type: integer
                      example: 0
                    Name:
                      type: string
                      example: Thing that 0 code represents
        CustomRules:
          type: array
          items:
            type: object
            properties:
              BLEFirmwareVersion:
                type: integer
                example: 1
              ToolFirmwareVersion:
                type: integer
                example: 2
              ToolAdvertisementSequenceNumber:
                type: integer
                example: 5
              StartBit:
                type: integer
                example: 104
              Length:
                type: integer
                example: 16
              DataType:
                type: string
                example: int
              FieldName:
                type: string
                example: total-cycles
              EndianType:
                type: string
                example: little
    MemoryMapRequestBody:
      type: object
      properties:
        product:
          type: number
          example: 298
        product_id:
          type: number
          example: 298
        memory_map_version:
          type: number
          example: 4
        data:
          type: array
          items:
            $ref: '#/components/schemas/MemoryMapDataObject'
        created_by:
          type: string
          example: waad|Vrs7FJkdFFSCPJm1sikMiC4ucmlHKSX84dtqBRjou7Q
        updated_by:
          type: string
          example: waad|Vrs7FJkdFFSCPJm1sikMiC4ucmlHKSX84dtqBRjou7Q
        updated_at:
          type: string
          format: date-time
          example: '2024-11-15T22:39:21.783Z'
    MemoryMapDataObject:
      type: object
      properties:
        id:
          type: number
          description: The ID of the memory map entry
          example: 589285
        BINARY:
          type: string
          enum:
            - '1'
            - '0'
          example: '0'
        BYTE_SWAP_WORD_LENGTH:
          type: string
          example: '1'
        BYTE_SWAPPED:
          type: string
          enum:
            - '1'
            - '0'
          example: '0'
        CAN_INDEX:
          type: string
          example: '0000'
        CAN_NODEID:
          type: string
          example: '0000'
        CAN_SUBINDEX:
          type: string
          example: '0000'
        COMPARATOR_VALUE:
          type: string
          example: ''
        FIELD_SIZE:
          type: string
          example: '2'
        ENUMERATION_DICTIONARY_UUID:
          type: string
          example: ''
        IS_FINAL_EVENT_STATE:
          type: string
          enum:
            - '1'
            - '0'
          example: '0'
        IS_PARSED:
          type: string
          enum:
            - '1'
            - '0'
          example: '1'
        IS_PCBA_PART_NUMBER:
          type: string
          enum:
            - '1'
            - '0'
          example: '0'
        COMMAND:
          type: string
          example: M18 CONNECTION TIMEOUT COUNTER
        PARSED_DATA_LABELS:
          type: string
          description: The labels used for the parsed data
          example: >-
            0-14 min, 14-28 min, 28-43 min, 43-57 min, 57-71 min, 71-86 min,
            86-100 min, 100-114 min, 114-129 min, 129-143 min, 143-158 min,
            158-172 min
        PARSED_DATA_SUB_LABELS:
          type: string
          description: The sub labels used for the parsed data
          example: 0-60 min, 60-121 min, 121-182 min
        PARSE_TYPE_ID:
          type: string
          example: '5'
        HEX_ADDRESS:
          type: string
          example: 40C4
        MODULE_ID:
          type: string
          example: ''
        MX_TOOL_SEGMENT_COUNT:
          type: string
          example: ''
        PARAMETER:
          type: string
          example: ''
        PARENT_FIELD:
          type: string
          example: ''
        PARSE_OFFSET_ADDRESS:
          type: string
          example: ''
        PARSE_SEGMENT_LENGTH:
          type: string
          example: ''
        PRODUCT:
          type: string
          example: '310'
        SCALE_VALUE:
          type: string
          example: ''
        SIGNED:
          type: string
          description: Is this value signed?
          enum:
            - '0'
            - '1'
          example: '0'
        NUMBER_CONFIG:
          type: string
          description: >-
            The number configuration for parsing fixed point floats, represented
            in Q Notation
          example: '7.8'
        ELEMENT_COUNT:
          type: string
          description: The number of elements in an array field
          example: ''
        PRODUCT_INTERNAL_SUBSYSTEM_ID:
          type: integer
          description: >-
            This is used to specify a specific subsystem to read from for
            products with internal subsystems.
          example: 1
    MemoryMapResponse:
      type: object
      description: Response containing memory map definition for a product and version.
      properties:
        message:
          type: string
          description: Status message indicating the result of the operation
          example: success
        error:
          type: boolean
          description: Indicates whether an error occurred
          example: false
        data:
          type: array
          description: Array of memory map field definitions
          items:
            $ref: '#/components/schemas/MemoryMapEntryV1'
    MemoryMapEntryV1:
      type: object
      description: A single memory map entry defining a field in tool memory.
      properties:
        id:
          type: integer
          description: Unique identifier for this memory map entry
          example: 116379
        product_id:
          type: integer
          description: The product ID this entry belongs to
          example: 273
        memory_map_version:
          type: integer
          description: The version of the memory map
          example: 2
        memory_address:
          type: string
          description: The hex address in tool memory where this field starts
          example: '00000000'
        data_length_hex:
          type: string
          description: The length of the data field in hex format
          example: '002'
        label:
          type: string
          description: Human-readable label for this field
          example: MEMORY MAP VERSION
        is_local_histogram:
          type: integer
          enum:
            - 0
            - 1
          description: Indicates if this field is a local histogram
          example: 1
        local_histogram_parse_type_id:
          type:
            - integer
            - 'null'
          description: Parse type ID for local histogram interpretation
          example: 1
        local_histogram_data_labels:
          type:
            - string
            - 'null'
          description: Labels for local histogram data segments
          example: null
        data_length_int:
          type: integer
          description: The length of the data field as an integer (bytes)
          example: 2
        parameter:
          type:
            - string
            - 'null'
          description: Additional parameter for field parsing
          example: null
        byte_swapped:
          type: integer
          enum:
            - 0
            - 1
          description: Indicates if bytes are swapped (little-endian)
          example: 0
        binary:
          type: integer
          enum:
            - 0
            - 1
          description: Indicates if the field contains binary data
          example: 0
        module_id:
          type:
            - string
            - 'null'
          description: Module identifier for grouped fields
          example: null
        is_state_transition:
          type: integer
          enum:
            - 0
            - 1
          description: Indicates if this field represents a state transition
          example: 0
        is_final_event_state:
          type: integer
          enum:
            - 0
            - 1
          description: Indicates if this is a final event state
          example: 0
        product:
          type: integer
          description: Product number
          example: 265
        is_pcba_part_number:
          type: integer
          enum:
            - 0
            - 1
          description: Indicates if this field contains a PCBA part number
          example: 0
        comparator_value:
          type:
            - string
            - 'null'
          description: Value used for comparison operations
          example: null
        product_id_hex:
          type: string
          description: Product ID in hexadecimal format
          example: '0x0111'
        created_at:
          type: string
          format: date-time
          description: Timestamp when the entry was created
          example: '2024-06-18T21:04:46.000Z'
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the entry was last updated
          example: '2024-06-18T21:04:46.000Z'
        scale_value:
          type:
            - number
            - 'null'
          description: Scale factor applied when parsing the value
          example: null
        enumeration_dictionary_uuid:
          type:
            - string
            - 'null'
          description: UUID reference to enumeration dictionary for value mapping
          example: null
        byte_swap_word_length:
          type: integer
          description: Word length for byte swapping operations
          example: 1
        created_by:
          type:
            - string
            - 'null'
          description: User who created this entry
          example: null
        updated_by:
          type:
            - string
            - 'null'
          description: User who last updated this entry
          example: null
        mx_tool_segment_count:
          type:
            - integer
            - 'null'
          description: MX tool segment count for parsing
          example: null
        parse_offset_address:
          type:
            - string
            - 'null'
          description: Offset address for parsing
          example: null
        parse_segment_length:
          type:
            - integer
            - 'null'
          description: Length of each parse segment
          example: null
        parent_field:
          type:
            - string
            - 'null'
          description: Reference to parent field for nested structures
          example: null
        can_nodeid:
          type:
            - string
            - 'null'
          description: CAN bus node ID
          example: null
        can_index:
          type:
            - string
            - 'null'
          description: CAN bus index
          example: null
        can_subindex:
          type:
            - string
            - 'null'
          description: CAN bus subindex
          example: null
        sub_labels:
          type:
            - string
            - 'null'
          description: Sub-labels for parsed data segments
          example: null
        signed:
          type: integer
          enum:
            - 0
            - 1
          description: Indicates if the value is signed
          example: 0
        number_config:
          type:
            - string
            - 'null'
          description: Number configuration for parsing fixed point floats (Q notation)
          example: null
        product_internal_subsystem_id:
          type:
            - integer
            - 'null'
          description: Internal subsystem ID for products with subsystems
          example: null
    TagMetadata:
      type: object
      properties:
        createdOn:
          type: integer
          example: 1700164623195
        createdBy:
          type:
            - string
            - 'null'
        createdBySource:
          type:
            - string
            - 'null'
        createdBySourceVersion:
          type:
            - string
            - 'null'
        lastUpdatedOn:
          type: integer
          example: 1700164623195
        lastUpdatedBy:
          type:
            - string
            - 'null'
    TagId:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: Document (MongoDB) ID for a tag
      example: 651b14ae2a1336f3184f0a46
    ToolReadId:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: Document (MongoDB) ID for a tool read document
      example: 65565faad9419ffb44c51ac7
    TagRequestBody:
      type: object
      required:
        - name
        - type
        - description
        - inputMode
        - queryLabel
      properties:
        name:
          type: string
          description: The name of the tag.
          example: OBJECTTAG
        type:
          type: string
          description: The type of tag.
          enum:
            - string
            - number
            - boolean
            - enum
            - array
            - object
          example: object
        inputMode:
          type: string
          description: Edit tag permissions.
          enum:
            - user
            - system
          example: user
        description:
          type: string
          description: The description of the tag.
          example: A tag for testing purposes.
        queryLabel:
          type: string
          description: The query label
          example: objecttag
        properties:
          type: array
          description: >-
            The properties of the tag, which can be an array of objects or
            primitive values.
          items:
            oneOf:
              - $ref: '#/components/schemas/TagPropertiesDefinition'
              - anyOf:
                  - type: string
                    description: Any string value.
                  - type: boolean
                    description: True or False.
                  - type: number
                    description: Any number value.
    TagUpdateRequestBody:
      type: object
      required:
        - type
        - inputMode
        - queryLabel
        - properties
      properties:
        name:
          type: string
          description: The name of the tag.
          example: OBJECTTAG
        type:
          type: string
          description: The type of tag.
          enum:
            - string
            - number
            - boolean
            - enum
            - array
            - object
          example: object
        inputMode:
          type: string
          description: Edit tag permissions.
          enum:
            - user
            - system
          example: user
        description:
          type: string
          description: The description of the tag.
          example: A tag for testing purposes.
        queryLabel:
          type: string
          description: The query label
          example: objecttag
        properties:
          type: array
          description: >-
            The properties of the tag, which can be an array of objects or
            primitive values.
          items:
            oneOf:
              - $ref: '#/components/schemas/TagPropertiesDefinition'
              - anyOf:
                  - type: string
                    description: Any string value.
                  - type: boolean
                    description: True or False.
                  - type: number
                    description: Any number value.
    TagPropertiesDefinition:
      type: object
      required:
        - name
        - type
        - description
        - queryLabel
        - required
      properties:
        name:
          type: string
          description: The name of the subproperty for this tag.
          example: MAINPROP
        type:
          type: string
          description: The type of subproperty for this tag.
          enum:
            - string
            - number
            - boolean
            - enum
            - array
            - object
          example: string
        description:
          type: string
          description: The description to use for the subproperty of this tag.
          example: This is a description of the subproperty for this object tag.
        queryLabel:
          type: string
          description: The query label to use for the subproperty of this tag.
          example: mainpropquerylabel
        required:
          type: boolean
          description: Whether the subproperty is required.
          example: false
    ToolReadRawData:
      type: array
      items:
        type: object
        properties:
          raw:
            type: string
            example: 65010000008A0064
          address:
            type: string
            example: '0002'
          parameter:
            type: string
            example: 464554434D54434B
          parseTypeId:
            type: number
            example: 2
          description:
            type: string
            example: U16 ARRAY CHART
          canNodeId:
            type: string
            example: '0001'
          canIndex:
            type: string
            example: '0000'
          canSubIndex:
            type: string
            example: '0001'
          productInternalSubsystemId:
            type: integer
            description: >-
              The product internal subsystem ID of the data being sent
              (optional)
            example: 1
          parseOffsetAddress:
            type: string
            example: ''
          comparatorValue:
            type: string
            example: ''
          isFinalEventState:
            type: boolean
            example: false
          parsed:
            oneOf:
              - type: object
              - type: string
              - type: number
              - type: boolean
              - type: array
            examples:
              - - label: Label 1
                  value: 243
                  displayOrder: 0
                - label: Label 2
                  value: 15
                  displayOrder: 1
              - '2023-07-14T21:14:39.000Z'
              - 5
              - false
              - - '359480064'
                - '1907221064'
                - '3783000999'
                - '4129016752'
                - '2784592456'
                - '0'
                - '0'
                - '0'
                - '0'
                - '0'
              - '8900': 15104
                5C01: 15616
                8A00: 515
                8B00: 11266
          _id:
            type: string
            example: 655e715dcde7f8ebe0b7738d
    ToolReadDocument:
      type: object
      properties:
        _id:
          type: string
          example: 65565faad9419ffb44c51ac7
        mpbid:
          type: string
          example: FFFF000000
        serialNumber:
          type: string
          example: J64AD195200734
        productId:
          type: string
          example: '0xFFFE'
        batteryPackPcbaId:
          type: string
          example: ''
        platformId:
          type: number
          example: 2
        parseStatus:
          type: string
          enum:
            - PARSED
            - NOT_PARSED
            - IN_PROCESS
            - ERROR
          example: PARSED
        memoryMapVersion:
          type: number
          example: 3
        data:
          $ref: '#/components/schemas/ToolReadRawData'
        version:
          type: number
          example: 1
        schemaVersion:
          type: number
          example: 1
        parseErrors:
          type: array
          items:
            $ref: '#/components/schemas/ToolReadParseErrors'
        updates:
          type: array
          items:
            $ref: '#/components/schemas/ToolReadUpdates'
        tags:
          type: object
          properties:
            SERVICECODE:
              type: string
              example: SV2024
            ENVIRONMENT:
              type: string
              example: test
            PLATFORM:
              type: string
              example: M18
            LOCATION:
              type: string
              example: Brookfield_WI_53005
            CUSTOMER:
              type: object
              properties:
                NAME:
                  type: string
                  example: dataplatform@milwaukeetool.com
                CRMNUMBER:
                  type: string
                  example: '123456'
        tagErrors:
          type: array
          items:
            $ref: '#/components/schemas/ToolReadTagErrors'
        createdAt:
          type: string
          format: date-time (ISO 8601 format)
          example: '2023-11-16T19:57:03.397Z'
        updatedAt:
          type: string
          format: date-time (ISO 8601 format)
          example: '2023-11-16T19:57:03.397Z'
    ToolReadDocumentNoData:
      type: object
      properties:
        _id:
          type: string
          example: 65565faad9419ffb44c51ac7
        mpbid:
          type: string
          example: FFFE000000
        serialNumber:
          type: string
          example: J64AD195200734
        productId:
          type: string
          example: '0xFFFE'
        batteryPackPcbaId:
          type: string
          example: ''
        parseStatus:
          type: string
          enum:
            - PARSED
            - NOT_PARSED
            - IN_PROCESS
            - ERROR
          example: PARSED
        memoryMapVersion:
          type: number
          example: 51
        version:
          type: number
          example: 1
        schemaVersion:
          type: number
          example: 1
        parseErrors:
          type: array
          items:
            $ref: '#/components/schemas/ToolReadParseErrors'
        updates:
          type: array
          items:
            $ref: '#/components/schemas/ToolReadUpdates'
        tags:
          type: object
          properties:
            EXTERNALID:
              type: string
              example: SV2024
            PROJECTNUMBER:
              type: string
              example: '123456'
            ENVIRONMENT:
              type: string
              example: test
            PLATFORM:
              type: string
              example: M18
            LOCATION:
              type: string
              example: Brookfield_WI_53005
            CUSTOMER:
              type: object
              properties:
                NAME:
                  type: string
                  example: dataplatform@milwaukeetool.com
                CRMNUMBER:
                  type: string
                  example: '123456'
        tagErrors:
          type: array
          items:
            $ref: '#/components/schemas/ToolReadTagErrors'
        createdAt:
          type: string
          format: date-time (ISO 8601 format)
          example: '2023-11-16T19:57:03.397Z'
        updatedAt:
          type: string
          format: date-time (ISO 8601 format)
          example: '2023-11-16T19:57:03.397Z'
    ToolReadUpdateRequestBody:
      type: object
      properties:
        mpbid:
          type: string
          example: FFFE000000
        serialNumber:
          type: string
          example: J64AD195200734
        productId:
          type: string
          example: '0067'
        batteryPackPcbaId:
          type: string
          example: ''
        memoryMapVersion:
          type: number
          example: 51
        sourceId:
          type: number
          example: 18
        tags:
          type: object
          properties:
            SERVICECODE:
              type: string
              example: SV123
            ENVIRONMENT:
              type: string
              example: test
            PLATFORM:
              type: string
              example: M18
            LOCATION:
              type: string
              example: Brookfield_WI_53005
            CUSTOMER:
              type: object
              properties:
                NAME:
                  type: string
                  example: dataplatform@milwaukeetool.com
                CRMNUMBER:
                  type: string
                  example: '123456'
            SOURCE:
              type: string
              example: QuickLink Web
    ToolReadUpdates:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time (ISO 8601 format)
          example: '2024-05-21T16:30:07.235Z'
        device:
          type: object
          properties:
            name:
              type: string
              example: QuickLink Web
            version:
              type: string
              example: 1.0.639
        user:
          type: string
          example: bobby.smith@milwaukeetool.com
        isMostRecent:
          type: boolean
          description: >-
            Indicates if this is the most recent update for the tool read, only
            exist on the most recent update
          example: true
    ToolReadParseErrors:
      type: object
      properties:
        code:
          type: string
          example: ''
        message:
          type: string
          example: ''
        context:
          type: string
          example: ''
    ToolReadTagErrors:
      type: object
      properties:
        code:
          type: string
          example: INVALID_TAG_NAME
        message:
          type: string
          example: No matching tag found in database.
    ToolReadResponse:
      type: array
      items:
        $ref: '#/components/schemas/ToolReadDocument'
      example:
        description: Example response for tool read data.
        value:
          - _id: 66c606315f2dd4941f0ae931
            memoryMapVersion: 51
            mpbid: FFFE000000
            productId: '0xFFFE'
            batteryPackPcbaId: '56'
            serialNumber: '1234567890'
            parseStatus: PARSED
            sourceId: 3
            data:
              - raw: '0101'
                address: '0000'
                parseTypeId: 1
                description: INTEGER
                parsed: 257
                _id: 66db3f143ab7f9d566d14cc0
              - raw: '01020304050607080910'
                address: '0002'
                parseTypeId: 2
                description: U16 ARRAY CHART
                parsed:
                  - label: Label 1
                    value: 258
                    displayOrder: 0
                  - label: Label 2
                    value: 772
                    displayOrder: 1
                  - label: Label 3
                    value: 1286
                    displayOrder: 2
                  - label: Label 4
                    value: 1800
                    displayOrder: 3
                  - label: Label 5
                    value: 2320
                    displayOrder: 4
                _id: 66db3f143ab7f9d566d14cc1
              - raw: 0064B1BABF
                address: 000C
                parseTypeId: 4
                description: TIMESTAMP
                parsed: '2023-07-14T21:14:39.000Z'
                _id: 66db3f143ab7f9d566d14cc2
            tagErrors: []
            parseErrors: []
            version: 1
            schemaVersion: 1
            platformId: 2
            updates:
              - device:
                  name: postman
                  version: '0.1'
                user: dataplatform@milwaukeetool.com
                timestamp: '2024-07-29T20:49:52.720Z'
                isMostRecent: true
              - device:
                  name: postman
                  version: '0.1'
                user: dataplatform@milwaukeetool.com
                timestamp: '2024-07-27T20:49:52.720Z'
            tags:
              EXTERNALID: SV2025
              PROJECTNUMBER: '123456'
              ENVIRONMENT: TEST
              PLATFORM: M18
              LOCATION: Greenwood_IN_46143
              CUSTOMER:
                NAME: dataplatform@milwaukeetool.com
                CRMNUMBER: ''
              SOURCE: quicklink-web
              QUICKLINKUSERMODE: Engineer
            createdAt: '2024-09-06T17:42:37.537Z'
            updatedAt: '2024-09-06T17:42:44.505Z'
    ToolReadResponseNoData:
      type: object
      properties:
        data:
          type: array
          description: An array of Tool Read Documents.
          items:
            $ref: '#/components/schemas/ToolReadDocumentNoData'
        totalCount:
          type: number
          description: The total number of results.
          example: 1
    ToolReadReparseManyResponse:
      type: object
      properties:
        reprocessingToolReadsTotalCount:
          type: number
          description: The number of ToolRead documents queued for reprocessing.
          example: 42
    ToolReadReparseRequestBody:
      description: >
        Provide at least one filter, or set `reparseAll` to `true`.

        Filter fields must contain at least one value. Empty arrays and empty
        objects are not valid filters.
      oneOf:
        - title: Reparse all ToolReads
          allOf:
            - $ref: '#/components/schemas/ToolReadReparseRequestBodyProperties'
            - type: object
              required:
                - reparseAll
              properties:
                reparseAll:
                  type: boolean
                  enum:
                    - true
                  description: >-
                    When true, allows reparsing without filters by matching all
                    ToolRead documents. Does not override sort, skip, or limit.
                  example: true
        - title: Reparse by filter
          allOf:
            - $ref: '#/components/schemas/ToolReadReparseRequestBodyProperties'
            - $ref: '#/components/schemas/ToolReadReparseRequestBodyFilterRequired'
    ToolReadReparseRequestBodyProperties:
      type: object
      properties:
        ids:
          type: array
          minItems: 1
          description: An array of Tool Read Document IDs to reparse.
          example:
            - 65565faad9419ffb44c51ac7
            - 65565faad9419ffb44c51ac8
        memoryMapVersion:
          type: number
          description: The version of the memory map to use during reparsing.
          example: 51
        mpbids:
          type: array
          minItems: 1
          description: >-
            An array of MPBIDs to use to find matching ToolRead Documents to
            reparse.
          example:
            - FFFE000000
            - 010C003638
        productIds:
          type: array
          minItems: 1
          description: >-
            An array of Product IDs to use to find matching ToolRead Documents
            to reparse.
          example:
            - '0xFFFE'
            - '0x010C'
        serialNumbers:
          type: array
          minItems: 1
          description: >-
            An array of Serial Numbers to use to find matching ToolRead
            Documents to reparse.
          example:
            - J64AD195200734
            - J64AD195200735
        parseStatus:
          type: string
          enum:
            - PARSED
            - NOT_PARSED
            - IN_PROCESS
            - ERROR
          description: Reparse ToolRead Documents by parse status.
          example: ERROR
        parseErrors:
          type: object
          minProperties: 1
          description: Reparse ToolRead Documents by specific parse error code(s).
          example:
            code: ERR0001
        tags:
          type: object
          minProperties: 1
          description: Reparse ToolRead Documents by specific tags.
          example:
            EXTERNALID: SV2025
            PROJECTNUMBER: '123457'
        dateRange:
          type: object
          description: >-
            An object containing a start and end date to use to find matching
            ToolRead Documents to reparse.
          required:
            - startDate
            - endDate
          properties:
            startDate:
              type: string
              format: date-time
              example: '2023-11-16T19:57:03.397Z'
            endDate:
              type: string
              format: date-time
              example: '2023-11-18T19:57:03.397Z'
        sort:
          type: string
          description: >-
            Sort field for matching documents. Prefix with `-` for descending
            order.
          enum:
            - _id
            - '-_id'
            - created
            - '-created'
            - createdAt
            - '-createdAt'
            - updatedAt
            - '-updatedAt'
          example: _id
        skip:
          type: integer
          minimum: 0
          description: Number of matching documents to skip before selecting results.
          example: 0
        limit:
          type: integer
          minimum: 0
          description: >-
            Maximum number of matching documents to reprocess. A value of `0`
            means no limit.
          example: 100
        reparseAll:
          type: boolean
          description: >-
            Optional when filters are provided. Set to `true` only when no
            filters are supplied.
          example: true
    ToolReadReparseRequestBodyFilterRequired:
      anyOf:
        - type: object
          required:
            - ids
          properties:
            ids:
              type: array
              minItems: 1
        - type: object
          required:
            - memoryMapVersion
        - type: object
          required:
            - mpbids
          properties:
            mpbids:
              type: array
              minItems: 1
        - type: object
          required:
            - productIds
          properties:
            productIds:
              type: array
              minItems: 1
        - type: object
          required:
            - serialNumbers
          properties:
            serialNumbers:
              type: array
              minItems: 1
        - type: object
          required:
            - parseStatus
        - type: object
          required:
            - parseErrors
          properties:
            parseErrors:
              type: object
              minProperties: 1
        - type: object
          required:
            - tags
          properties:
            tags:
              type: object
              minProperties: 1
        - type: object
          required:
            - dateRange
          properties:
            dateRange:
              type: object
              required:
                - startDate
                - endDate
              properties:
                startDate:
                  type: string
                  format: date-time
                endDate:
                  type: string
                  format: date-time
    ToolReadParseRequestBody:
      type: object
      required:
        - mpbid
        - timestamp
        - sourceId
        - memoryMapVersion
        - data
      properties:
        persist:
          type: boolean
          description: Whether to persist the parsed data to the database.
          default: false
        mpbid:
          type: string
          minLength: 10
          maxLength: 10
        timestamp:
          type: number
          description: The timestamp of the data being sent in milliseconds since epoch.
        memoryMapVersion:
          type: number
        sourceId:
          type: number
          description: >-
            The source of the data being sent. See [Source
            Types](/docs/Tool%20Usage%20Data/Tool%20Memory%20Maps/Create%20&%20Edit/Fields#source-types).
        svCode:
          type: string
          description: The service code of the data being sent.
        serialNumber:
          type: string
          description: The serial number of the tool.
        clientInfo:
          type: object
          required:
            - hostName
          properties:
            ipAddress:
              type: string
              format: ipv4
            version:
              type: string
            userName:
              type: string
            hostName:
              type: string
            userLocality:
              type: string
        tags:
          $ref: '#/components/schemas/KeyValuePair'
        data:
          type: array
          items:
            $ref: '#/components/schemas/ToolReadDataObjectV2'
    KeyValuePair:
      type: object
      additionalProperties:
        oneOf:
          - type: string
          - type: number
          - type: object
          - type: boolean
    ToolReadDataObjectV2:
      type: object
      required:
        - raw
        - address
      description: >-
        The data read from the tool. canNodeId, canIndex, and canSubIndex should
        be sent together if the data is from CAN.
      properties:
        raw:
          type: string
          description: The value of the data being sent in hex.
        address:
          type: string
          description: The address of the data being sent in hex.
        description:
          type: string
          description: The description of the data being sent (optional).
        parameter:
          type: string
          description: The MX parameter of the data being sent (optional).
        canNodeId:
          type: string
          description: The CAN node ID of the data being sent (optional).
        canIndex:
          type: string
          description: The CAN index of the data being sent (optional).
        canSubIndex:
          type: string
          description: The CAN subindex of the data being sent (optional).
        productInternalSubsystemId:
          type: integer
          description: The product internal subsystem ID of the data being sent (optional).
        parseOffsetAddress:
          type: string
        comparatorValue:
          type: string
        isFinalEventState:
          type: boolean
    GetTagsResponse:
      type: array
      items:
        $ref: '#/components/schemas/TagData'
      example:
        - _id: 650d9b336d30fc9199691b55
          name: CUSTOMER
          queryLabel: customerobjecttag
          type: object
          inputMode: user
          description: A default tag for the customer name and crmnumber.
          properties:
            - name: CRMNUMBER
              type: string
              queryLabel: customercrmnumbertag
              required: false
            - name: NAME
              type: string
              queryLabel: customernametag
              required: false
          metadata:
            createdOn: 1700164623195
            lastUpdatedOn: 1700164623195
          createdAt: '2023-11-16T19:57:03.397Z'
          updatedAt: '2023-11-16T19:57:03.397Z'
        - _id: 65d7680bc7df323ee08df418
          name: STRINGTAGEXAMPLE
          type: string
          properties: []
          description: An example of a string tag.
          queryLabel: stringtag
          inputMode: user
          metadata:
            createdOn: 1697216134294
            createdBy: null
            createdBySource: null
            createdBySourceVersion: null
            lastUpdatedOn: 1697216134294
            lastUpdatedBy: null
          version: 1
          createdAt: '2023-10-13T16:55:34.518Z'
          updatedAt: '2023-10-13T16:55:34.518Z'
          __v: 0
        - _id: 65d7680bc7df323ee08df419
          name: BOOLEANTAGEXAMPLE
          type: boolean
          properties: []
          description: An example of a boolean tag.
          queryLabel: booleantag
          inputMode: user
          metadata:
            createdOn: 1697216134294
            createdBy: null
            createdBySource: null
            createdBySourceVersion: null
            lastUpdatedOn: 1697216134294
            lastUpdatedBy: null
          version: 1
          createdAt: '2023-10-13T16:55:34.518Z'
          updatedAt: '2023-10-13T16:55:34.518Z'
          __v: 0
        - _id: 65d7680bc7df323ee08df420
          name: NUMBERTAGEXAMPLE
          type: number
          properties: []
          description: An example of a number tag.
          queryLabel: numbertag
          inputMode: user
          metadata:
            createdOn: 1697216134294
            createdBy: null
            createdBySource: null
            createdBySourceVersion: null
            lastUpdatedOn: 1697216134294
            lastUpdatedBy: null
          version: 1
          createdAt: '2023-10-13T16:55:34.518Z'
          updatedAt: '2023-10-13T16:55:34.518Z'
          __v: 0
    TagData:
      type: object
      properties:
        _id:
          type: string
          description: The ID of the tag.
          example: 650d9b336d30fc9199691b55
        name:
          type: string
          description: The name of the tag.
        queryLabel:
          type: string
          description: The query label to use for querying toolreads by tags.
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - enum
            - array
            - object
          description: The type of tag.
        inputMode:
          type: string
          enum:
            - user
            - system
          description: Edit tag permissions.
        description:
          type: string
          description: The description of the tag.
        properties:
          type: array
          description: >-
            The properties of the tag. Can be an array of objects, an array of
            primitive values (strings, booleans, numbers), or defaults to an
            empty array.
          items:
            oneOf:
              - $ref: '#/components/schemas/TagPropertiesDefinition'
              - anyOf:
                  - type: string
                    description: Any string value.
                  - type: boolean
                    description: True or False.
                  - type: number
                    description: Any number value.
        metadata:
          $ref: '#/components/schemas/TagMetadata'
          description: The metadata of the tag.
        createdAt:
          type: string
          format: date-time
          example: '2023-11-16T19:57:03.397Z'
          description: The date and time the tag was created.
        updatedAt:
          type: string
          format: date-time
          example: '2023-11-16T19:57:03.397Z'
          description: The date and time the tag was last updated.
        version:
          type: integer
          example: 1
          description: The version of the tag.
        __v:
          type: integer
          example: 0
          description: The document's default versioning.
    UnitReplacementRecord:
      type: object
      properties:
        oldSerialNumber:
          type: string
          example: XYZ789
        newSerialNumber:
          type: string
          example: ABC123
        svCode:
          type: string
          example: SV123
        createdAt:
          type: string
          format: date-time
          example: '2023-09-19T15:01:58.365Z'
        createdBy:
          type: string
          example: jim.bob@milwaukeetool.com
        uuid:
          type: string
          example: 12345678-1234-1234-1234-123456789012
    UnitReplacementSearchResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/UnitReplacementRecord'
        currentPage:
          type: integer
          example: 1
        totalPages:
          type: integer
          example: 1
    AllProductsResponse:
      type: object
      properties:
        message:
          type: string
          example: Success
        error:
          type: boolean
          example: false
        data:
          type: array
          items:
            $ref: '#/components/schemas/Product'
    SingleProductResponse:
      type: object
      properties:
        message:
          type: string
          example: Success
        error:
          type: boolean
          example: false
        data:
          $ref: '#/components/schemas/Product'
    Product:
      type: object
      properties:
        id:
          type: integer
          description: The decimal representation of the Product ID
          example: 1
        description:
          type: string
          description: A description of what the product is
          example: M18™ 1/2" Compact Brushless Drill/Driver
        platform_id:
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
          description: '`1=M12, 2=M18, 3=MX, 4=Tick/BLE-Module, 5=Other`'
        end_product_base_model_number:
          type: string
          description: The North America model number (or Cat. No.)
          example: '2701'
        model_emea:
          type: string
          description: The EMEA model number (or Cat. No.)
          example: M18 BLDD-0
        model_anz:
          type: string
          description: The ANZ model number (or Cat. No.)
          example: M18BLDD-0
        model_ap:
          type: string
          description: The AP model number (or Cat. No.)
          example: M18BLDD-0
        product_id:
          type: string
          description: The hexadecimal representation of the Product ID
          example: '0x0001'
        default_product_id:
          type: string
          description: >-
            Typically the same as product_id, but can be different in cases
            where the electronics and/or firmware from one product are shared
            with another
          example: '0x0001'
        internal_one_key:
          type: integer
          description: >-
            `0=No, 1=Yes` Yes if this product is an 'Internal OneKey' product.
            Mutually exclusive with `embedded_tick_capable` and
            `insertable_tick_ptt_capable`
          enum:
            - 0
            - 1
        embedded_tick_capable:
          type: integer
          description: >-
            `0=No, 1=Yes` Yes if this product is an 'Embedded Tick' product.
            Mutually exclusive with `internal_one_key` and
            `insertable_tick_ptt_capable`
          enum:
            - 0
            - 1
        insertable_tick_ptt_capable:
          type: integer
          description: >-
            `0=No, 1=Yes` Yes if this product is a 'OneKey Card' product.
            Mutually exclusive with `internal_one_key` and
            `embedded_tick_capable`
          enum:
            - 0
            - 1
        mx_product_key_generated:
          type: integer
          description: '`0=No, 1=Yes`. This field is not used.'
        mx_product_key:
          type:
            - integer
            - 'null'
          description: This field is not used.
        created_at:
          type: string
          format: date-time
          description: ISO 8601 format
          example: '2023-09-19T15:01:58.365Z'
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 format
          example: '2023-09-19T15:01:58.365Z'
        vpin_project_number:
          type:
            - number
            - 'null'
          description: The VPIN project number
          example: '12345'
        ble_module_id:
          type:
            - integer
            - 'null'
          description: >-
            `null=no ble module, 1=BLE112, 2=BLE113 , 3=BGM11S , 4=BlueNRG ,
            6=BGM220, 7=BGM13S`
          enum:
            - null
            - 1
            - 2
            - 3
            - 4
            - 6
            - 7
        platform_name:
          type: string
          description: Only returned when retrieving a single product. The platform name
          example: M18
        ble_module_name:
          type:
            - string
            - 'null'
          description: Only returned when retrieving a single product. The BLE module name
          example: BLE112
        p_id:
          type: integer
          description: >-
            Only returned when retrieving a single product. The decimal
            representation of the Product ID. Same as `id` field
          example: 1
        title:
          type: string
          description: >-
            Only returned when retrieving a single product. The product title
            from milwaukeetool.com. Maybe differ from `description` field
          example: M18™ 1/2" Compact Brushless Drill/Driver
        imageUrl:
          type: string
          description: >-
            Only returned when retrieving a single product. URL to the product
            image from milwaukeetool.com. Note: If no image is available, then
            this field will be a URL to a generic 'no image' image
          example: >-
            https://cdn.milwaukeetool.com/-/media/Products/Power-Tools/Cordless/Drills/2701-20_2.png?h=220&w=220&hash=EF7EA644E099E9E630BD3C41ED328FE4
        subsystem_count:
          type: number
          description: >-
            The number of external subsystems. If not specified, the default
            value is assumed to be 1, which is the main Tool MCU.
          example: 2
        internal_subsystems:
          type: array
          items:
            type: object
            properties:
              id:
                type: number
                description: The unique id of the internal subsystem
                example: 1
              subsystem_id:
                type: integer
                description: >-
                  The subsystem or node id of the internal subsystem. This is
                  stored as an integer but would be used as a hex in the Gateway
                  Access command.
                example: 9
              name:
                type: string
                description: The name of the internal subsystem
                example: Orca
            description: The internal subsystems of the product
            example:
              id: 1
              subsystem_id: 9
              name: Orca
    DocumentId:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: Document ID (24-character hexadecimal string)
      example: 65565faad9419ffb44c51ab8
    HexId:
      type: string
      pattern: ^0x[0-9A-Fa-f]+$
      maxLength: 12
      description: >-
        ID in Hexadecimal format, must begin with '0x', and has a max limit of
        12 characters.
      example: '0xFF03'
    Update:
      type: object
      properties:
        device:
          type: object
          properties:
            name:
              type: string
            version:
              type: string
        user:
          type: string
        timestamp:
          type: string
          format: date-time
        isMostRecent:
          type: boolean
          description: >-
            Indicates if this is the most recent update for the tool read, only
            exist on the most recent update.
    Error:
      type: object
      properties:
        error:
          type: string
    ProductLabelInspectionContents:
      type: object
      properties:
        cameraOutputOCRText:
          type: string
          description: Raw string output from the camera's OCR after evaluating the label
          example: M18 FUEL 1/2 HAMMER DRILL 2904-20 SN:K51AD2345678
        systemFinalOCRText:
          type: string
          description: String output from the fixture with corrections applied
          example: M18 FUEL 1/2 IN. HAMMER DRILL 2904-20 SN:K51AD2345678
        modelSource:
          type: string
          description: Source model used for OCR
          example: Cognex
        modelType:
          type: string
          description: Model type identifier (eg. Model Name + Version)
          example: 3800 series 16 MP
        bornOnDate:
          type: string
          nullable: true
          description: Date stamped on the product label, null if not present
          example: '2024-01-15'
        mpbid:
          type: string
          nullable: true
          description: Product identifier, null if not present
          example: 01320008F8
        serialNumberInternal:
          type: string
          nullable: true
          description: Internal serial number, null if not present
          example: K51AD2345678
        productType:
          type: string
          enum:
            - Tool
            - Battery
            - Charger
            - IoTSpecific
            - PortablePower
            - Adapter
            - Other
            - TBD
          description: Product type
          example: Tool
        productPlatform:
          type: string
          description: Product platform
          example: M18
        productModelName:
          type: string
          description: Product model name
          example: FUEL 1/2 IN. HAMMER DRILL
        cameraProgram:
          type: string
          description: Camera program identifier
          example: Job-0
    ServiceInstance:
      type: object
      properties:
        id:
          type: string
          example: 01JA8SHMF49PR8TTQYE9Q340DP
        mpbid:
          type: string
          example: 01320008F8
        svCode:
          type: string
          example: SV1234567
        productLabelInspectionContents:
          $ref: '#/components/schemas/ProductLabelInspectionContents'
    NonWarrantableReasons:
      type: object
      properties:
        outOfWarranty:
          type: boolean
          example: false
        housingDamage:
          type: boolean
          example: false
        missingParts:
          type: boolean
          example: false
        ingressWater:
          type: boolean
          example: false
        other:
          type: boolean
          example: false
        comments:
          type: string
          example: Something
    ImageCaptureValues:
      type: object
      properties:
        id:
          type: string
          example: 01JA8SHMF49PR8TTQYE9Q340DP
        mpbid:
          type: string
          example: 01320008F8
        svCode:
          type: string
          example: SV1234567
        position:
          type: string
          example: Top
        nonWarrantableReasons:
          $ref: '#/components/schemas/NonWarrantableReasons'
        imageContent:
          type: string
          example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB=
        timestamp:
          type: number
          example: 1729019562642
        userId:
          type: string
          example: bcbd01ae-cc21-444f-bb33-b4fa2f948b22
        userEmail:
          type: string
          example: Jared.Chapiewsky@milwaukeetool.com
        userLocality:
          type: string
          example: Madison_WI_53707
        notes:
          type: string
          example: Notes
        productLabelInspectionContents:
          $ref: '#/components/schemas/ProductLabelInspectionContents'
    DeleteServiceInstanceImageRequest:
      type: object
      properties:
        id:
          type: string
          example: 01JA8SHMF49PR8TTQYE9Q340DP
        mpbid:
          type: string
          example: 01320008F8
        svCode:
          type: string
          example: SV1234567
    ReportAddress:
      type: object
      properties:
        line1:
          type: string
          example: 123 Tree St
        city:
          type: string
          example: Cityville
        state:
          type: string
          example: WI
        zipCode:
          type: string
          example: '54614'
    Service:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/ReportAddress'
        technicianName:
          type: string
          example: John Doe
        phone:
          type: string
          example: 555-555-5555
        fax:
          type: string
          example: 555-555-5555
        comments:
          type: string
          example: stuff
    Report:
      type: object
      properties:
        id:
          type: string
          example: 01JDJ7MSMRKT8S147T1QR1G92Y
        svCode:
          type: string
          example: SV1234567
        reportType:
          type: number
          example: 1
        userId:
          type: string
          example: bcbd01ae-cc21-444f-bb33-b4fa2f948b22
        mpbid:
          type: string
          example: 01320008F8
        language:
          type: string
          example: en
        service:
          $ref: '#/components/schemas/Service'
        companyLogo?:
          type: string
        address:
          $ref: '#/components/schemas/ReportAddress'
        customer:
          type: object
          properties:
            name:
              type: string
              example: Jenny Doe
            phone:
              type: string
              example: 555-867-5309
            email:
              type: string
              example: jenny@milwaukeetool.com
            address:
              $ref: '#/components/schemas/ReportAddress'
        tool:
          type: object
          properties:
            description:
              type: string
              example: M18™  FORCE LOGIC™ 750 MCM Dieless Crimper
            modelNumber:
              type: string
              example: 2877-20
            serialNumber:
              type: string
              example: K16AD193900033
        report:
          type: object
          properties:
            createdDate:
              type: string
              example: '2024-11-25T17:59:21.370Z'
            hydraulic:
              type: boolean
              example: true
            dtw:
              type: object
            impactWrench:
              type: object
            laserCalibration:
              type: object
    ReworkData:
      type: object
      required:
        - reworkId
      properties:
        reworkId:
          type: string
          example: 01JDJ5VWM7P2VJY9Y6T9CS79J0
        timestamp:
          type: number
          example: 1732550336
      additionalProperties: true
    ImpactWrenchCalibration:
      type: object
      required:
        - mpbid
      properties:
        mpbid:
          type: string
          example: 01320008F8
        userId:
          type: string
          example: bcbd01ae-cc21-444f-bb33-b4fa2f948b22
        modelNumber:
          type: string
          example: '48111850'
        serialNumber:
          type: string
          example: G29NDCBC 221104 6195992
        calibrationDate:
          type: string
          example: '2024-01-02 12:31:23Z'
        certifiedBy:
          type: string
  responses:
    BadRequest:
      description: Bad Request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            bad_request_example_id:
              value:
                error: Invalid ID
              description: The ID was invalid.
            bad_request_example_body:
              value:
                error: Invalid request body
              description: The request body was invalid.
    BadRequestBody:
      description: Bad Request Body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            bad_request_example:
              value:
                error: Invalid request body
              description: The request body was invalid.
    BadRequestId:
      description: Bad Request ID.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            bad_request_example:
              value:
                error: Invalid ID
              description: The ID was invalid.
    BadRequestQueryParameters:
      description: Bad Request Query Parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            bad_request_example:
              value:
                error: Invalid query parameters
              description: The query parameters were invalid.
    Unauthorized:
      description: Unauthorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorized_example:
              value:
                error: Unauthorized
              description: User does not have permission to access this resource.
    Forbidden:
      description: Forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            forbidden_example:
              value:
                error: Forbidden
              description: User does not have permission to access this resource.
    NotFound:
      description: Not Found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            not_found_example:
              value:
                error: Not Found
              description: The resource was not found.
    InternalServerError:
      description: Internal Server Error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            internal_server_error_example:
              value:
                error: Internal Server Error
              description: An error occurred on the server.
    BadRequestParams:
      description: Required parameters are missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            bad_request_example_body:
              value:
                error: Required parameters are missing.
              description: Missing required parameters.
  examples:
    TagsObjectTagRequestExample:
      description: Example request for creating a tag.
      value:
        name: ObjectTagExample
        type: object
        description: This is an example object tag.
        inputMode: user
        queryLabel: objectTagExampleQueryLabel
        properties:
          - name: Property1
            type: string
            description: This is an example string property.
            queryLabel: property1QueryLabel
            required: true
          - name: Property2
            type: boolean
            description: This is an example boolean property.
            queryLabel: property2QueryLabel
            required: false
    TagsObjectTagResponseExample:
      description: Example response for creating a tag.
      value:
        - _id: 66c606315f2dd4941f0ae935
          name: OBJECTTAGEXAMPLE
          type: object
          description: This is an example object tag.
          inputMode: user
          queryLabel: objecttagexamplequerylabel
          properties:
            - name: PROPERTY1
              type: string
              description: This is an example string property.
              queryLabel: property1querylabel
              required: true
            - name: PROPERTY2
              type: boolean
              description: This is an example boolean property.
              queryLabel: property2querylabel
              required: false
          metadata:
            createdOn: 1697216134294
            createdBy: null
            createdBySource: null
            createdBySourceVersion: null
            lastUpdatedOn: 1697216134294
            lastUpdatedBy: null
          version: 1
          createdAt: '2023-10-13T16:55:34.518Z'
          updatedAt: '2023-10-13T16:55:34.518Z'
          __v: 0
    TagsStringTagRequestExample:
      description: Example request for creating a tag.
      value:
        name: StringTagExample
        type: string
        description: This is an example string tag.
        properties: []
        inputMode: user
        queryLabel: stringTagExampleQueryLabel
    TagsStringTagResponseExample:
      description: Example response for creating a tag.
      value:
        - _id: 66c606315f2dd4941f0ae935
          name: STRINGTAGEXAMPLE
          type: string
          description: This is an example string tag.
          inputMode: user
          queryLabel: stringtagexamplequerylabel
          properties: []
          metadata:
            createdOn: 1697216134294
            createdBy: null
            createdBySource: null
            createdBySourceVersion: null
            lastUpdatedOn: 1697216134294
            lastUpdatedBy: null
          version: 1
          createdAt: '2023-10-13T16:55:34.518Z'
          updatedAt: '2023-10-13T16:55:34.518Z'
          __v: 0
    TagsNumberTagRequestExample:
      description: Example request for creating a tag.
      value:
        name: NumberTagExample
        type: number
        description: This is an example number tag.
        properties: []
        inputMode: user
        queryLabel: numberTagExampleQueryLabel
    TagsNumberTagResponseExample:
      description: Example response for creating a tag.
      value:
        - _id: 66c606315f2dd4941f0ae935
          name: NUMBERTAGEXAMPLE
          type: number
          description: This is an example number tag.
          inputMode: user
          queryLabel: numbertagexamplequerylabel
          properties: []
          metadata:
            createdOn: 1697216134294
            createdBy: null
            createdBySource: null
            createdBySourceVersion: null
            lastUpdatedOn: 1697216134294
            lastUpdatedBy: null
          version: 1
          createdAt: '2023-10-13T16:55:34.518Z'
          updatedAt: '2023-10-13T16:55:34.518Z'
          __v: 0
    TagsBooleanTagRequestExample:
      description: Example request for creating a tag.
      value:
        name: BooleanTagExample
        type: boolean
        description: This is an example boolean tag.
        properties: []
        inputMode: user
        queryLabel: booleantagexamplequerylabel
    TagsBooleanTagResponseExample:
      description: Example response for creating a tag.
      value:
        - _id: 66c606315f2dd4941f0ae935
          name: BOOLEANTAGEXAMPLE
          type: boolean
          description: This is an example boolean tag.
          inputMode: user
          queryLabel: booleantagexamplequerylabel
          properties: []
          metadata:
            createdOn: 1697216134294
            createdBy: null
            createdBySource: null
            createdBySourceVersion: null
            lastUpdatedOn: 1697216134294
            lastUpdatedBy: null
          version: 1
          createdAt: '2023-10-13T16:55:34.518Z'
          updatedAt: '2023-10-13T16:55:34.518Z'
          __v: 0
    TagsEnumTagRequestExample:
      description: Example request for creating a tag.
      value:
        name: EnumTagExample
        type: enum
        description: This is an example enum tag.
        inputMode: user
        queryLabel: enumTagExampleQueryLabel
        properties:
          - enumstring
          - stringvalue
          - 'true'
          - '123456'
          - '654321'
    TagsEnumTagResponseExample:
      description: Example response for creating a tag.
      value:
        - _id: 66c606315f2dd4941f0ae935
          name: ENUMTAGEXAMPLE
          type: enum
          description: This is an example enum tag.
          inputMode: user
          queryLabel: enumtagexamplequerylabel
          properties:
            - enumstring
            - stringvalue
            - 'true'
            - '123456'
            - '654321'
          metadata:
            createdOn: 1697216134294
            createdBy: null
            createdBySource: null
            createdBySourceVersion: null
            lastUpdatedOn: 1697216134294
            lastUpdatedBy: null
          version: 1
          createdAt: '2023-10-13T16:55:34.518Z'
          updatedAt: '2023-10-13T16:55:34.518Z'
          __v: 0
    ToolReadResponseExample:
      description: Example response for tool read data.
      value:
        - _id: 66c606315f2dd4941f0ae931
          memoryMapVersion: 51
          mpbid: FFFE000000
          productId: '0xFFFE'
          batteryPackPcbaId: '56'
          serialNumber: '1234567890'
          parseStatus: PARSED
          sourceId: 3
          data:
            - raw: '0101'
              address: '0000'
              parseTypeId: 1
              description: INTEGER
              parsed: 257
              _id: 66db3f143ab7f9d566d14cc0
            - raw: '01020304050607080910'
              address: '0002'
              parseTypeId: 2
              description: U16 ARRAY CHART
              parsed:
                - label: Label 1
                  value: 258
                  displayOrder: 0
                - label: Label 2
                  value: 772
                  displayOrder: 1
                - label: Label 3
                  value: 1286
                  displayOrder: 2
                - label: Label 4
                  value: 1800
                  displayOrder: 3
                - label: Label 5
                  value: 2320
                  displayOrder: 4
              _id: 66db3f143ab7f9d566d14cc1
            - raw: 0064B1BABF
              address: 000C
              parseTypeId: 4
              description: TIMESTAMP
              parsed: '2023-07-14T21:14:39.000Z'
              _id: 66db3f143ab7f9d566d14cc2
          tagErrors: []
          parseErrors: []
          version: 1
          schemaVersion: 1
          platformId: 2
          updates:
            - device:
                name: postman
                version: '0.1'
              user: dataplatform@milwaukeetool.com
              timestamp: '2024-07-29T20:49:52.720Z'
              isMostRecent: true
            - device:
                name: postman
                version: '0.1'
              user: dataplatform@milwaukeetool.com
              timestamp: '2024-07-27T20:49:52.720Z'
          tags:
            EXTERNALID: SV2025
            PROJECTNUMBER: '123456'
            ENVIRONMENT: TEST
            PLATFORM: M18
            LOCATION: Greenwood_IN_46143
            CUSTOMER:
              NAME: dataplatform@milwaukeetool.com
              CRMNUMBER: ''
            SOURCE: quicklink-web
            QUICKLINKUSERMODE: Engineer
          createdAt: '2024-09-06T17:42:37.537Z'
          updatedAt: '2024-09-06T17:42:44.505Z'
    ToolReadResponseNoDataExample:
      description: Example response for tool read data.
      value:
        data:
          - _id: 66c606315f2dd4941f0ae931
            memoryMapVersion: 51
            mpbid: FFFE000000
            productId: '0xFFFE'
            batteryPackPcbaId: '56'
            serialNumber: '1234567890'
            parseStatus: PARSED
            sourceId: 3
            tagErrors: []
            parseErrors: []
            version: 1
            schemaVersion: 1
            platformId: 2
            updates:
              - device:
                  name: postman
                  version: '0.1'
                user: dataplatform@milwaukeetool.com
                timestamp: '2024-07-29T20:49:52.720Z'
                isMostRecent: true
              - device:
                  name: postman
                  version: '0.1'
                user: dataplatform@milwaukeetool.com
                timestamp: '2024-07-27T20:49:52.720Z'
            tags:
              EXTERNALID: SV2025
              PROJECTNUMBER: '123456'
              ENVIRONMENT: TEST
              PLATFORM: M18
              LOCATION: Greenwood_IN_46143
              CUSTOMER:
                NAME: dataplatform@milwaukeetool.com
                CRMNUMBER: ''
              SOURCE: quicklink-web
              QUICKLINKUSERMODE: Engineer
            createdAt: '2024-09-06T17:42:37.537Z'
            updatedAt: '2024-09-06T17:42:44.505Z'
        totalCount: 1
    ToolReadReparseManyResponseExample:
      description: Example response for reparsing multiple tool reads.
      value:
        reprocessingToolReadsTotalCount: 42
    ToolReadReparseRequestIdsExample:
      description: Example request for reparsing tool read data.
      value:
        ids:
          - 66c606315f2dd4941f0ae931
          - 66c606315f2dd4941f0ae932
          - 66c606315f2dd4941f0ae933
    ToolReadReparseRequestIdsAndMMVersionExample:
      description: Example request for reparsing tool read data.
      value:
        ids:
          - 66c606315f2dd4941f0ae931
          - 66c606315f2dd4941f0ae932
          - 66c606315f2dd4941f0ae933
        memoryMapVersion: 51
    ToolReadReparseRequestMpbidsExample:
      description: Example request for reparsing tool read data.
      value:
        mpbids:
          - FFFE000000
          - 010C003701
          - 010C0036FC
    ToolReadReparseRequestProductIdsExample:
      description: Example request for reparsing tool read data.
      value:
        productIds:
          - '0xFFFE'
          - '0xFFFD'
          - '0xFFFC'
    ToolReadReparseRequestSerialNumbersExample:
      description: Example request for reparsing tool read data.
      value:
        serialNumbers:
          - '1234567890'
          - '1234567891'
          - '1234567892'
    ToolReadReparseRequestParseStatusExample:
      description: Example request for reparsing tool read data.
      value:
        parseStatus: ERROR
    ToolReadReparseRequestParseErrorsExample:
      description: Example request for reparsing tool read data.
      value:
        parseErrors:
          code: ERR0001
    ToolReadReparseRequestTagsExample:
      description: Example request for reparsing tool read data.
      value:
        tags:
          EXTERNALID: SV2025
          PROJECTNUMBER: '123456'
          LOCATION: Greenwood_IN_46143
    ToolReadReparseRequestDateRangeExample:
      description: Example request for reparsing tool read data.
      value:
        dateRange:
          startDate: '2024-09-06T17:42:37.537Z'
          endDate: '2024-09-06T17:42:44.505Z'
    ToolReadReparseRequestCombinationExample:
      description: Example request for reparsing tool read data.
      value:
        mpbids:
          - FFFE000000
          - 010C003701
          - 010C0036FC
        parseStatus: ERROR
        parseErrors:
          code: ERR0001
        tags:
          EXTERNALID: SV2025
          PROJECTNUMBER: '123456'
          LOCATION: Greenwood_IN_46143
        dateRange:
          startDate: '2024-09-06T17:42:37.537Z'
          endDate: '2024-09-06T17:42:44.505Z'
    ToolReadReparseRequestReparseAllExample:
      description: Example request to reparse all ToolRead documents.
      value:
        reparseAll: true
    ToolReadReparseRequestReparseAllWithLimitExample:
      description: Example request to reparse a limited batch of all ToolRead documents.
      value:
        reparseAll: true
        limit: 100
        sort: _id
    ToolReadParseRequestExample:
      description: Example request for parsing tool read data.
      value:
        persist: true
        mpbid: FFFE000000
        timestamp: 1616425200000
        batteryPackPcbaId: '56'
        serialNumber: '1234567890'
        sourceId: 3
        memoryMapVersion: 51
        clientInfo:
          ipAddress: 111.111.111.111
          version: 1.0.0
          userName: dataplatform@milwaukeetool.com
          hostName: Quicklink
          userLocality: Greenwood_IN_46143
        tags:
          EXTERNALID: SV2025
          PROJECTNUMBER: '123456'
        data:
          - raw: '0101'
            address: '0000'
          - raw: '01020304050607080910'
            address: '0002'
          - raw: 0064B1BABF
            address: 000C
    ToolReadParseRequestNoPersistExample:
      description: Example request for parsing tool read data.
      value:
        mpbid: FFFE000000
        timestamp: 1616425200000
        batteryPackPcbaId: '56'
        serialNumber: '1234567890'
        sourceId: 3
        memoryMapVersion: 51
        clientInfo:
          ipAddress: 123.123.123.123
          version: 1.0.0
          userName: dataplatform@milwaukeetool.com
          hostName: Quicklink
          userLocality: Greenwood_IN_46143
        tags:
          EXTERNALID: SV2025
          PROJECTNUMBER: '123456'
        data:
          - raw: '0101'
            address: '0000'
          - raw: '01020304050607080910'
            address: '0002'
          - raw: 0064B1BABF
            address: 000C
    ToolReadParseResponseExample:
      description: Example response for the parse tool read data endpoint.
      value:
        - parseStatus: PARSED
          data:
            - raw: '0101'
              address: '0000'
              parseTypeId: 1
              description: INTEGER
              parsed: 257
            - raw: '01020304050607080910'
              address: '0002'
              parseTypeId: 2
              description: U16 ARRAY CHART
              parsed:
                - label: Label 1
                  value: 258
                  displayOrder: 0
                - label: Label 2
                  value: 772
                  displayOrder: 1
                - label: Label 3
                  value: 1286
                  displayOrder: 2
                - label: Label 4
                  value: 1800
                  displayOrder: 3
                - label: Label 5
                  value: 2320
                  displayOrder: 4
            - raw: 0064B1BABF
              address: 000C
              parseTypeId: 4
              description: TIMESTAMP
              parsed: '2023-07-14T21:14:39.000Z'
          parseErrors: []
    ToolReadParseBadDataResponseExample:
      description: Example response for the parse tool read data endpoint with bad data.
      value:
        - parseStatus: ERROR
          data:
            - raw: '0101'
              address: '0000'
              parseTypeId: 1
              description: INTEGER
              parsed: 257
            - raw: 0064B1BABF
              address: 000C
              parseTypeId: 4
              description: TIMESTAMP
              parsed: '2023-07-14T21:14:39.000Z'
          parseErrors:
            - code: ERR0001
              message: Failed to parse field
              context:
                customErrorMessage: >-
                  The memoryMap's labels (local_histogram_data_labels) is empty.
                  Unable to map the labels to the element's parsed values, for
                  element
                element:
                  raw: F30F0041
                  address: '0244'
                  description: U8 ARRAY CHART
                  parseTypeId: 2
                  parsed:
                    - '243'
                    - '15'
                    - '0'
                    - '65'
    ToolReadParseWithPersistResponseExample:
      description: Example response for tool read data.
      value:
        - _id: 66c606315f2dd4941f0ae931
          memoryMapVersion: 51
          mpbid: FFFE000000
          productId: '0xFFFE'
          parseStatus: PARSED
          data:
            - raw: '0101'
              address: '0000'
              parseTypeId: 1
              description: INTEGER
              parsed: 257
              _id: 66db3f143ab7f9d566d14cc0
            - raw: '01020304050607080910'
              address: '0002'
              parseTypeId: 2
              description: U16 ARRAY CHART
              parsed:
                - label: Label 1
                  value: 258
                  displayOrder: 0
                - label: Label 2
                  value: 772
                  displayOrder: 1
                - label: Label 3
                  value: 1286
                  displayOrder: 2
                - label: Label 4
                  value: 1800
                  displayOrder: 3
                - label: Label 5
                  value: 2320
                  displayOrder: 4
              _id: 66db3f143ab7f9d566d14cc1
            - raw: 0064B1BABF
              address: 000C
              parseTypeId: 4
              description: TIMESTAMP
              parsed: '2023-07-14T21:14:39.000Z'
              _id: 66db3f143ab7f9d566d14cc2
          parseErrors: []
          version: 1
          schemaVersion: 1
          updates:
            - device:
                name: postman
                version: '0.1'
              user: dataplatform@milwaukeetool.com
              timestamp: '2024-07-29T20:49:52.720Z'
              isMostRecent: true
          createdAt: '2024-09-06T17:42:37.537Z'
          updatedAt: '2024-09-06T17:42:44.505Z'
    ToolReadV1RequestExample:
      description: Example request for uploading tool read data.
      value:
        mpbid: FFFE000000
        timestamp: 1616425200000
        memoryMapVersion: 51
        sourceId: 3
        svCode: SV2025
        serialNumber: '1234567890'
        clientInfo:
          ipAddress: 111.111.111.111
          version: 1.0.0
          userName: dataplatform@milwaukeetool.com
          hostName: Quicklink
          userLocality: Greenwood_IN_46143
        data:
          - valueHex: '0101'
            addressHex: '0000'
          - valueHex: '01020304050607080910'
            addressHex: '0002'
          - valueHex: 0064B1BABF
            addressHex: 000C
    ToolReadV1RequestExampleWithTags:
      description: Example request for uploading tool read data.
      value:
        mpbid: FFFE000000
        timestamp: 1616425200000
        memoryMapVersion: 51
        sourceId: 3
        svCode: SV2025
        serialNumber: '1234567890'
        clientInfo:
          ipAddress: 111.111.111.111
          version: 1.0.0
          userName: dataplatform@milwaukeetool.com
          hostName: Quicklink
          userLocality: Greenwood_IN_46143
        tags:
          EXTERNALID: SV2025
          PROJECTNUMBER: '123456'
        data:
          - valueHex: '0101'
            addressHex: '0000'
          - valueHex: '01020304050607080910'
            addressHex: '0002'
          - valueHex: 0064B1BABF
            addressHex: 000C
x-amazon-apigateway-cors:
  allowMethods:
    - '*'
  allowHeaders:
    - authorization
    - content-type
    - x-amz-date
    - x-amz-security-token
    - x-api-key
  maxAge: 0
  allowCredentials: false
  allowOrigins:
    - '*'
x-amazon-apigateway-importexport-version: '1.0'
