{
  "swagger": "2.0",
  "info": {
    "title": "Media Source",
    "version": "2019-02-15",
    "license": {
      "name": "OCF Data Model License",
      "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md",
      "x-copyright": "copyright 2016-2017, 2019 Open Connectivity Foundation, Inc. All rights reserved."
    },
    "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md"
  },
  "schemes": [
    "http"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/mediaSourceResURI": {
      "get": {
        "description": "This Resource defines a single media source that exists on a device.\nThe source can be an input source or output source, this resource is agnostic of that.\nThe Property \"sourceName\" specifies a pre-defined media input or output (e.g.\"HDMI\", \"DVI\").\nThe Property \"sourceNumber\" is a label to specify the instance (e.g. \"PC\", \"1\").\nThe Property \"sourceType\" is an enumeration defining whether the source is audio, video or both.\nThe Property \"status\" is a boolean that determines if the specific source instance is selected or not.\n A status of true means that the source instance is selected.\n A status of false means that the source instance is not selected.",
        "parameters": [
          {
            "$ref": "#/parameters/interface"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "x-example": {
              "rt": [
                "oic.r.mediasource"
              ],
              "if": [
                "oic.if.a",
                "oic.if.baseline"
              ],
              "sourceName": "HDMI-CEC",
              "sourceNumber": "1",
              "sourceType": "audioPlusVideo",
              "status": true
            },
            "schema": {
              "$ref": "#/definitions/mediaSource"
            }
          }
        }
      },
      "post": {
        "description": "Changes the status of the source.\nAllows changes of the \"sourceName\" and the \"status\".",
        "parameters": [
          {
            "$ref": "#/parameters/interface"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/mediaSource"
            },
            "x-example": {
              "sourceName": "my new name",
              "status": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "x-example": {
              "sourceName": "my new name",
              "sourceNumber": "1",
              "sourceType": "audioPlusVideo",
              "status": true
            },
            "schema": {
              "$ref": "#/definitions/mediaSource"
            }
          }
        }
      }
    }
  },
  "parameters": {
    "interface": {
      "in": "query",
      "name": "if",
      "type": "string",
      "enum": [
        "oic.if.a",
        "oic.if.baseline"
      ]
    }
  },
  "definitions": {
    "mediaSource": {
      "properties": {
        "rt": {
          "description": "The Resource Type.",
          "items": {
            "enum": [
              "oic.r.mediasource"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "minItems": 1,
          "uniqueItems": true,
          "readOnly": true,
          "type": "array"
        },
        "status": {
          "description": "Specifies if the specific source instance is selected or not.",
          "type": "boolean"
        },
        "sourceType": {
          "description": "Specifies the type of the source.",
          "enum": [
            "audioOnly",
            "videoOnly",
            "audioPlusVideo"
          ],
          "readOnly": true,
          "type": "string"
        },
        "sourceName": {
          "description": "Specifies a pre-defined media input or output.",
          "type": "string"
        },
        "sourceNumber": {
          "description": "Label to specify the instance.",
          "type": "string"
        },
        "n": {
          "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n"
        },
        "id": {
          "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id"
        },
        "if": {
          "description": "The OCF Interface set supported by this Resource.",
          "items": {
            "enum": [
              "oic.if.a",
              "oic.if.baseline"
            ],
            "type": "string"
          },
          "minItems": 2,
          "uniqueItems": true,
          "readOnly": true,
          "type": "array"
        }
      },
      "type": "object",
      "required": [
        "sourceName",
        "status"
      ]
    }
  }
}