diff --git a/VendorListResURI.swagger.json b/VendorListResURI.swagger.json new file mode 100644 index 0000000..e603b79 --- /dev/null +++ b/VendorListResURI.swagger.json @@ -0,0 +1,154 @@ +{ + "swagger": "2.0", + "info": { + "title": "Vendor List", + "version": "2021-03-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": { + "/VendorListResURI": { + "get": { + "description": "This Resource describes the current vendor and supported vendors in an Air Conditioner Assistant.\nThe current vendor can be read or set, setting indicates a desired vendor.\nA device may reject an attempt to set a vendor that is not found in supported vendors.\nThe Property \"supportedVendors\" is an array of the possible vendor names.\nThe value of \"supportedVendors\" is vendor specific.\nThe Property \"currentVendor\" is one vendor selected from \"supportedVendors\".\nThe Property \"status\" is current operation status related to the \"currentVendor\" or set operation,\n matching : the matching is being processed by attempting to generate and issue Infrared Signals to the Legacy AC ,\n stopped : the matching is stopped", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "RETRIEVES the state of vendorList Resource.", + "x-example": { + "rt": ["oic.r.vendorlist"], + "if": ["oic.if.rw", "oic.if.baseline"], + "supportedVendors": ["none","haier", "gree", "tcl", "lg"], + "currentVendor": "lg", + "status": "matching" + }, + "schema": { "$ref": "#/definitions/VendorList" } + } + } + }, + "post": { + "description": "launch and stop Matching the legacy AC to the desired vendor.", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/VendorListUpdate" }, + "x-example": { + "currentVendor": "lg", + "status": "matching" + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "currentVendor": "lg", + "status":"matching" + }, + "schema": { "$ref": "#/definitions/VendorListUpdate" } + }, + "403": { + "description" : "This response is generated by the OCF Server when the client sends:\n An UPDATE with an value for \"currentVendor\" that is not found in\"supportedvendors\" .\n An UPDATW with an invalid value for \"status\" property.\n The server may respond with the current resource representation.", + "x-example": { + "supportedVendors": ["haier", "gree", "tcl", "lg"], + "currentVendor": "lg", + "status":"matching" + }, + "schema": { "$ref": "#/definitions/VendorListUpdate" } + } + } + } + } + }, + "parameters": { + "interface": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.rw", "oic.if.baseline"] + } + }, + "definitions": { + "VendorList" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.vendorlist"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "currentVendor": { + "description": "The current Vendor selected from \"supportedVendors\".", + "type": "string" + }, + "supportedVendors": { + "description": "The array of the possible vendors.", + "items": { + "type": "string" + }, + "readOnly": true, + "type": "array" + }, + "status": { + "description": "Current operation status based on the selected current Vendor.\n matching : the Device is generating and issuing Matching Infrared Signals based on current vendor's Infrared solution ,\n stopped : the Matching is stopped.", + "enum": ["matching","stopped"], + "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.rw", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["currentVendor","supportedVendors","status"] + }, + "VendorListUpdate" : { + "properties": { + "currentVendor": { + "description": "The current vendor selected from \"supportedVendors\".", + "type": "string" + }, + "status": { + "description": "Current operation status", + "enum": ["matching","stopped"], + "type": "string" + } + }, + "type": "object", + "required": ["currentVendor","status"] + } + } +}