---
swagger: "2.0"
info:
  version: "1.0.0"
  title: "Azure IOT End-to-End Test Wrapper Rest Api"
tags:
- name: "control"
  description: "Control APIs that aren't tied to any specific SDK"
- name: "device"
  description: "DeviceClient APIs"
- name: "module"
  description: "ModuleClient APIs"
schemes:
- "https"
produces:
- "application/json"
paths:
  /control/capabilities:
    get:
      tags:
      - "control"
      summary: "Get capabilities for the objects in this server"
      operationId: "control_get_capabilities"
      produces:
      - "application/json"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "object"
      x-swagger-router-controller: "swagger_server.controllers.control_controller"
  /control/cleanup:
    put:
      tags:
      - "control"
      summary: "verify that the clients have cleaned themselves up completely"
      operationId: "control_cleanup"
      parameters: []
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.control_controller"
  /control/message:
    put:
      tags:
      - "control"
      summary: "log a message to output"
      operationId: "control_log_message"
      consumes:
      - "application/json"
      parameters:
      - in: "body"
        name: "logMessage"
        required: true
        schema:
          $ref: "#/definitions/logMessage"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.control_controller"
  /control/flags:
    put:
      tags:
      - "control"
      summary: "set flags for the objects in this server to use"
      operationId: "control_set_flags"
      consumes:
      - "application/json"
      parameters:
      - in: "body"
        name: "flags"
        required: true
        schema:
          type: "object"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.control_controller"
  /control/command:
    put:
      tags:
      - "control"
      summary: "send an arbitrary command"
      operationId: "control_send_command"
      parameters:
      - name: "cmd"
        in: "query"
        description: "command string"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.control_controller"
  /control/wrapperStats:
    get:
      tags:
      - "control"
      summary: "Get statistics about the operation of the test wrapper"
      operationId: "control_get_wrapper_stats"
      produces:
      - "application/json"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "object"
      x-swagger-router-controller: "swagger_server.controllers.control_controller"
  /device/connect/{transportType}:
    put:
      tags:
      - "device"
      summary: "Connect to the azure IoT Hub as a device"
      operationId: "device_connect"
      consumes:
      - "application/json"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      - name: "connectionString"
        in: "query"
        description: "connection string"
        required: true
        type: "string"
      - in: "body"
        name: "caCertificate"
        required: false
        schema:
          $ref: "#/definitions/certificate"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/disconnect:
    put:
      tags:
      - "device"
      summary: "Disconnect the device"
      operationId: "device_disconnect"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/createFromConnectionString/{transportType}:
    put:
      tags:
      - "device"
      summary: "Create a device client from a connection string"
      operationId: "device_create_from_connection_string"
      consumes:
      - "application/json"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      - name: "connectionString"
        in: "query"
        description: "connection string"
        required: true
        type: "string"
      - in: "body"
        name: "caCertificate"
        required: false
        schema:
          $ref: "#/definitions/certificate"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/createFromX509/{transportType}:
    put:
      tags:
      - "device"
      summary: "Create a device client from X509 credentials"
      operationId: "device_create_from_x509"
      consumes:
      - "application/json"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      - in: "body"
        name: "X509"
        required: true
        schema:
          type: "object"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/createFromSymmetricKey/{deviceId}/{transportType}:
    put:
      tags:
      - "device"
      summary: "Create a device client from a symmetric key"
      operationId: "device_create_from_symmetric_key"
      consumes:
      - "application/json"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      - name: "deviceId"
        in: "path"
        required: true
        type: "string"
      - name: "hostname"
        in: "query"
        description: "name of the host to connect to"
        required: true
        type: "string"
      - name: "symmetricKey"
        in: "query"
        description: "key to use for connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/connect2:
    put:
      tags:
      - "device"
      summary: "Connect the device"
      operationId: "device_connect2"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/reconnect:
    put:
      tags:
      - "device"
      summary: "Reconnect the device"
      operationId: "device_reconnect"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "forceRenewPassword"
        in: "query"
        description: "True to force SAS renewal"
        required: false
        type: "boolean"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/disconnect2:
    put:
      tags:
      - "device"
      summary: "Disconnect the device"
      operationId: "device_disconnect2"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/destroy:
    put:
      tags:
      - "device"
      summary: "Disconnect and destroy the device client"
      operationId: "device_destroy"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/enableMethods:
    put:
      tags:
      - "device"
      summary: "Enable methods"
      operationId: "device_enable_methods"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/waitForMethodAndReturnResponse/{methodName}:
    put:
      tags:
      - "device"
      summary: "Wait for a method call, verify the request, and return the response."
      description: "This is a workaround to deal with SDKs that only have method call\
        \ operations that are sync.  This function responds to the method with the\
        \ payload of this function, and then returns the method parameters.  Real-world\
        \ implemenatations would never do this, but this is the only same way to write\
        \ our test code right now (because the method handlers for C, Java, and probably\
        \ Python all return the method response instead of supporting an async method\
        \ call)"
      operationId: "device_wait_for_method_and_return_response"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "methodName"
        in: "path"
        description: "name of the method to handle"
        required: true
        type: "string"
      - in: "body"
        name: "requestAndResponse"
        required: true
        schema:
          $ref: "#/definitions/methodRequestAndResponse"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/enableC2dMessages:
    put:
      tags:
      - "device"
      summary: "Enable c2d messages"
      operationId: "device_enable_c2d_messages"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/event:
    put:
      tags:
      - "device"
      summary: "Send an event"
      operationId: "device_send_event"
      consumes:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - in: "body"
        name: "eventBody"
        required: true
        schema:
          $ref: "#/definitions/eventBody"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/c2dMessage:
    get:
      tags:
      - "device"
      summary: "Wait for a c2d message"
      operationId: "device_wait_for_c2d_message"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/eventBody"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/enableTwin:
    put:
      tags:
      - "device"
      summary: "Enable device twins"
      operationId: "device_enable_twin"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/twin:
    get:
      tags:
      - "device"
      summary: "Get the device twin"
      operationId: "device_get_twin"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/twin"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
    patch:
      tags:
      - "device"
      summary: "Updates the device twin"
      operationId: "device_patch_twin"
      consumes:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - in: "body"
        name: "twin"
        required: true
        schema:
          $ref: "#/definitions/twin"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/twinDesiredPropPatch:
    get:
      tags:
      - "device"
      summary: "Wait for the next desired property patch"
      operationId: "device_wait_for_desired_properties_patch"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/twin"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/connectionStatus:
    get:
      tags:
      - "device"
      summary: "get the current connection status"
      operationId: "device_get_connection_status"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            type: "string"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/connectionStatusChange:
    get:
      tags:
      - "device"
      summary: "wait for the current connection status to change and return the changed\
        \ status"
      operationId: "device_wait_for_connection_status_change"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "connectionStatus"
        in: "query"
        description: "Desired connection status"
        required: true
        type: "string"
        enum:
        - "connected"
        - "disconnected"
      responses:
        200:
          description: "OK"
          schema:
            type: "string"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/storageInfoForBlob:
    get:
      tags:
      - "device"
      summary: "Get storage info for uploading into blob storage"
      operationId: "device_get_storage_info_for_blob"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "blobName"
        in: "query"
        description: "name of blob for blob upload"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/blobStorageInfo"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /device/{connectionId}/blobUploadStatus:
    put:
      tags:
      - "device"
      summary: "notify iothub about blob upload status"
      operationId: "device_notify_blob_upload_status"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "correlationId"
        in: "query"
        description: "correlation id for blob upload"
        required: true
        type: "string"
      - name: "isSuccess"
        in: "query"
        description: "True if blob upload was successful"
        required: true
        type: "boolean"
      - name: "statusCode"
        in: "query"
        description: "status code for blob upload"
        required: true
        type: "string"
      - name: "statusDescription"
        in: "query"
        description: "human readable descripton of the status for blob upload"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.device_controller"
  /module/connect/{transportType}:
    put:
      tags:
      - "module"
      summary: "Connect to the azure IoT Hub as a module"
      operationId: "module_connect"
      consumes:
      - "application/json"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      - name: "connectionString"
        in: "query"
        description: "connection string"
        required: true
        type: "string"
      - in: "body"
        name: "caCertificate"
        required: false
        schema:
          $ref: "#/definitions/certificate"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/disconnect:
    put:
      tags:
      - "module"
      summary: "Disconnect the module"
      operationId: "module_disconnect"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/connectFromEnvironment/{transportType}:
    put:
      tags:
      - "module"
      summary: "Connect to the azure IoT Hub as a module using the environment variables"
      operationId: "module_connect_from_environment"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/createFromConnectionstring/{transportType}:
    put:
      tags:
      - "module"
      summary: "Create a module client from a connection string"
      operationId: "module_create_from_connection_string"
      consumes:
      - "application/json"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      - name: "connectionString"
        in: "query"
        description: "connection string"
        required: true
        type: "string"
      - in: "body"
        name: "caCertificate"
        required: false
        schema:
          $ref: "#/definitions/certificate"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/createFromEnvironment/{transportType}:
    put:
      tags:
      - "module"
      summary: "Create a module client using the EdgeHub environment"
      operationId: "module_create_from_environment"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/createFromX509/{transportType}:
    put:
      tags:
      - "module"
      summary: "Create a module client from X509 credentials"
      operationId: "module_create_from_x509"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      - in: "body"
        name: "X509"
        required: true
        schema:
          type: "object"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/createFromSymmetricKey/{deviceId}/{moduleId}/{transportType}:
    put:
      tags:
      - "module"
      summary: "Create a module client from a symmetric key"
      operationId: "module_create_from_symmetric_key"
      consumes:
      - "application/json"
      parameters:
      - name: "transportType"
        in: "path"
        description: "Transport to use"
        required: true
        type: "string"
        enum:
        - "amqp"
        - "amqpws"
        - "mqtt"
        - "mqttws"
        - "http"
      - name: "deviceId"
        in: "path"
        required: true
        type: "string"
      - name: "moduleId"
        in: "path"
        required: true
        type: "string"
      - name: "hostname"
        in: "query"
        description: "name of the host to connect to"
        required: true
        type: "string"
      - name: "symmetricKey"
        in: "query"
        description: "key to use for connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/connectResponse"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/connect2:
    put:
      tags:
      - "module"
      summary: "Connect the module"
      operationId: "module_connect2"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/reconnect:
    put:
      tags:
      - "module"
      summary: "Reconnect the module"
      operationId: "module_reconnect"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "forceRenewPassword"
        in: "query"
        description: "True to force SAS renewal"
        required: false
        type: "boolean"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/disconnect2:
    put:
      tags:
      - "module"
      summary: "Disonnect the module"
      operationId: "module_disconnect2"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/destroy:
    put:
      tags:
      - "module"
      summary: "Disonnect and destroy the module client"
      operationId: "module_destroy"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/enableTwin:
    put:
      tags:
      - "module"
      summary: "Enable module twins"
      operationId: "module_enable_twin"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/enableMethods:
    put:
      tags:
      - "module"
      summary: "Enable methods"
      operationId: "module_enable_methods"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/enableInputMessages:
    put:
      tags:
      - "module"
      summary: "Enable input messages"
      operationId: "module_enable_input_messages"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/twin:
    get:
      tags:
      - "module"
      summary: "Get the device twin"
      operationId: "module_get_twin"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/twin"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
    patch:
      tags:
      - "module"
      summary: "Updates the device twin"
      operationId: "module_patch_twin"
      consumes:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - in: "body"
        name: "twin"
        required: true
        schema:
          $ref: "#/definitions/twin"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/twinDesiredPropPatch:
    get:
      tags:
      - "module"
      summary: "Wait for the next desired property patch"
      operationId: "module_wait_for_desired_properties_patch"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/twin"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/event:
    put:
      tags:
      - "module"
      summary: "Send an event"
      operationId: "module_send_event"
      consumes:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - in: "body"
        name: "eventBody"
        required: true
        schema:
          $ref: "#/definitions/eventBody"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/outputEvent/{outputName}:
    put:
      tags:
      - "module"
      summary: "Send an event to a module output"
      operationId: "module_send_output_event"
      consumes:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "outputName"
        in: "path"
        required: true
        type: "string"
      - in: "body"
        name: "eventBody"
        required: true
        schema:
          $ref: "#/definitions/eventBody"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/inputMessage/{inputName}:
    get:
      tags:
      - "module"
      summary: "Wait for a message on a module input"
      operationId: "module_wait_for_input_message"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "inputName"
        in: "path"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/eventBody"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/waitForMethodAndReturnResponse/{methodName}:
    put:
      tags:
      - "module"
      summary: "Wait for a method call, verify the request, and return the response."
      description: "This is a workaround to deal with SDKs that only have method call\
        \ operations that are sync.  This function responds to the method with the\
        \ payload of this function, and then returns the method parameters.  Real-world\
        \ implemenatations would never do this, but this is the only same way to write\
        \ our test code right now (because the method handlers for C, Java, and probably\
        \ Python all return the method response instead of supporting an async method\
        \ call)"
      operationId: "module_wait_for_method_and_return_response"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "methodName"
        in: "path"
        description: "name of the method to handle"
        required: true
        type: "string"
      - in: "body"
        name: "requestAndResponse"
        required: true
        schema:
          $ref: "#/definitions/methodRequestAndResponse"
      responses:
        200:
          description: "OK"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/moduleMethod/{deviceId}/{moduleId}:
    put:
      tags:
      - "module"
      summary: "call the given method on the given module"
      operationId: "module_invoke_module_method"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "deviceId"
        in: "path"
        required: true
        type: "string"
      - name: "moduleId"
        in: "path"
        required: true
        type: "string"
      - in: "body"
        name: "methodInvokeParameters"
        required: true
        schema:
          $ref: "#/definitions/methodInvoke"
      responses:
        200:
          description: "OK"
          schema:
            type: "object"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/deviceMethod/{deviceId}:
    put:
      tags:
      - "module"
      summary: "call the given method on the given device"
      operationId: "module_invoke_device_method"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "deviceId"
        in: "path"
        required: true
        type: "string"
      - in: "body"
        name: "methodInvokeParameters"
        required: true
        schema:
          $ref: "#/definitions/methodInvoke"
      responses:
        200:
          description: "OK"
          schema:
            type: "object"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/connectionStatus:
    get:
      tags:
      - "module"
      summary: "get the current connection status"
      operationId: "module_get_connection_status"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            type: "string"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
  /module/{connectionId}/connectionStatusChange:
    get:
      tags:
      - "module"
      summary: "wait for the current connection status to change and return the changed\
        \ status"
      operationId: "module_wait_for_connection_status_change"
      produces:
      - "application/json"
      parameters:
      - name: "connectionId"
        in: "path"
        description: "Id for the connection"
        required: true
        type: "string"
      - name: "connectionStatus"
        in: "query"
        description: "Desired connection status"
        required: true
        type: "string"
        enum:
        - "connected"
        - "disconnected"
      responses:
        200:
          description: "OK"
          schema:
            type: "string"
      x-swagger-router-controller: "swagger_server.controllers.module_controller"
definitions:
  logMessage:
    type: "object"
    properties:
      message:
        type: "string"
        description: "text of message"
    description: "message from the test script to output to the log"
  certificate:
    type: "object"
    properties:
      cert:
        type: "string"
        description: "unique identifier for this connection"
    description: "certificate in the body of a message"
  connectResponse:
    type: "object"
    properties:
      connectionId:
        type: "string"
        description: "unique identifier for this connection"
    description: "result of a connection to a service, device, or module client"
    example:
      connectionId: "connectionId"
  methodRequestAndResponse:
    type: "object"
    properties:
      requestPayload:
        type: "object"
        description: "payload for the request that arrived from the service.  Used\
          \ to verify that the correct request arrived."
        properties: {}
      responsePayload:
        type: "object"
        description: "payload for the response to return to the service.  Used to\
          \ verify that the correct request arrived."
        properties: {}
      statusCode:
        type: "integer"
        description: "status code to return to the service"
    description: "parameters and response for a sync method call"
  eventBody:
    type: "object"
    properties:
      body:
        type: "object"
        description: "payload to send to the method"
        properties: {}
      horton_flags:
        type: "object"
        description: "flags used by horton"
        properties: {}
      attributes:
        type: "object"
        description: "Message attributes"
        properties: {}
    description: "body for an invoming or outgoing event or message"
    example:
      horton_flags: "{}"
      attributes: "{}"
      body: "{}"
  twin:
    type: "object"
    properties:
      desired:
        type: "object"
        description: "desired properties"
        properties: {}
      reported:
        type: "object"
        description: "reported properties"
        properties: {}
    description: "device twin or module twin"
    example:
      desired: "{}"
      reported: "{}"
  blobStorageInfo:
    type: "object"
    properties:
      blobName:
        type: "string"
        description: "name of blob to upload"
      containerName:
        type: "string"
        description: "name of container in the azure storage host to upload into"
      correlationId:
        type: "string"
        description: "correlation id to use for upload"
      hostName:
        type: "string"
        description: "name of azure storage host"
      sasToken:
        type: "string"
        description: "sas token to use to authenticate with azure storage host"
    description: "storage info for blob upload"
    example:
      blobName: "blobName"
      sasToken: "sasToken"
      hostName: "hostName"
      containerName: "containerName"
      correlationId: "correlationId"
  methodInvoke:
    type: "object"
    properties:
      methodName:
        type: "string"
        description: "name of method to invoke"
      payload:
        type: "object"
        description: "payload to send to the method"
        properties: {}
      responseTimeoutInSeconds:
        type: "integer"
        description: "number of seconds to wait for a response"
      connectTimeoutInSeconds:
        type: "integer"
        description: "number of seconds to wait for the module to connect"
    description: "parameters used to invoke a method"
