{
  "swagger": "2.0",
  "info": {
    "title": "AvoinData pesticide models",
    "version": "v1"
  },
  "paths": {
    "/api/Pesticide": {
      "get": {
        "tags": [
          "Pesticide"
        ],
        "produces": [
          "text/plain",
          "application/json",
          "text/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Pesticide"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Classification": {
      "type": "object",
      "properties": {
        "hazardCategoryClass": {
          "description": "Hazard's class\r\nCodeScheme codeValue: 045",
          "type": "string"
        },
        "hazardStatement": {
          "description": "Hazard's statement code ie. EUH201A.\r\nCodeScheme codeValue: 041",
          "type": "string"
        }
      }
    },
    "DocumentInfo": {
      "type": "object",
      "properties": {
        "kemiDigiURL": {
          "type": "string"
        },
        "fileName": {
          "type": "string"
        }
      }
    },
    "GAP": {
      "type": "object",
      "properties": {
        "plants": {
          "description": "Plant code\r\nCodeScheme codeValue: 112",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "usePlaces": {
          "description": "Use place code\r\nCodeScheme codeValue: 114",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "destroyers": {
          "description": "Destroyer code\r\nCodeScheme codeValue: 113",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "GAPRow": {
      "type": "object",
      "properties": {
        "useNumber": {
          "format": "int32",
          "type": "integer"
        },
        "gaps": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GAP"
          }
        }
      }
    },
    "LocalizedText": {
      "type": "object",
      "properties": {
        "fi": {
          "description": "Localized text fi-FI",
          "type": "string"
        },
        "sv": {
          "description": "Localized text sv-SE",
          "type": "string"
        },
        "en": {
          "description": "Localized text en-US",
          "type": "string"
        }
      }
    },
    "Permit": {
      "type": "object",
      "properties": {
        "type": {
          "description": "Type of permit. Main, Minor Use or Exceptional.\r\nCodeScheme codeValue: 125",
          "type": "string"
        },
        "validTo": {
          "format": "date-time",
          "type": "string"
        },
        "salesAllowedTo": {
          "format": "date-time",
          "type": "string"
        },
        "useAllowedTo": {
          "format": "date-time",
          "type": "string"
        },
        "holderCompany": {
          "type": "string"
        },
        "useDescription": {
          "type": "string"
        },
        "clearancePeriod": {
          "type": "string"
        },
        "frequentUseLimitation": {
          "type": "string"
        },
        "pollinatorUseLimitation": {
          "type": "string"
        },
        "groundWaterUseLimitation": {
          "type": "string"
        },
        "watersUseLimitation": {
          "type": "string"
        },
        "otherUseLimitation": {
          "type": "string"
        },
        "organismWarning": {
          "type": "string"
        },
        "resistenceControl": {
          "type": "string"
        },
        "storagingAndLastingness": {
          "type": "string"
        },
        "packageAndProductDisposing": {
          "type": "string"
        },
        "otherRecommendationAndInstruction": {
          "type": "string"
        },
        "protectionInstruction": {
          "type": "string"
        },
        "workHygienicClearancePeriod": {
          "type": "string"
        },
        "otherVegetationProtectionRecommendation": {
          "type": "string"
        },
        "gapInstruction": {
          "type": "string"
        },
        "sprayingProtectionDistances": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProtectionDistance"
          }
        },
        "nozzleSprayingProtections": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProtectionDistance"
          }
        },
        "gapRows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GAPRow"
          }
        },
        "documents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentInfo"
          }
        }
      }
    },
    "Pesticide": {
      "type": "object",
      "properties": {
        "kemiDigiURL": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "registerNumber": {
          "format": "int32",
          "type": "integer"
        },
        "productCode": {
          "type": "string"
        },
        "substances": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Substance"
          }
        },
        "professional": {
          "type": "boolean"
        },
        "consumer": {
          "type": "boolean"
        },
        "productType": {
          "description": "Product type. ie. AE ->\tAerosoli\r\nCodeScheme codeValue: 105",
          "type": "string"
        },
        "productGroups": {
          "description": "Product group. ie. KS -> Kasvunsääde\r\nCodeScheme codeValue: 104",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "permits": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Permit"
          }
        },
        "classifications": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Classification"
          }
        },
        "hazardPictograms": {
          "description": "List of pesticide hazard pictogram GHS codes.\r\nCodeScheme codeValue: 042",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "hazardStatements": {
          "description": "List of pesticide H-Codes.\r\nCodeScheme codeValue: 041",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "hazardStatementValues": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/StatementValue"
          }
        },
        "precautionaryStatements": {
          "description": " List of pesticide P-Codes based on GHS.\r\nCodeScheme codeValue: 044",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "precautionaryStatementValues": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/StatementValue"
          }
        },
        "modified": {
          "format": "date-time",
          "type": "string"
        }
      }
    },
    "ProtectionDistance": {
      "type": "object",
      "properties": {
        "usage": {
          "type": "string"
        },
        "fanNozzle": {
          "format": "int32",
          "type": "integer"
        },
        "windReductionNozzle50": {
          "format": "int32",
          "type": "integer"
        },
        "windReductionNozzle75": {
          "format": "int32",
          "type": "integer"
        },
        "windReductionNozzle90": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "StatementValue": {
      "type": "object",
      "properties": {
        "statementCodeValue": {
          "type": "string"
        },
        "index": {
          "format": "int32",
          "type": "integer"
        },
        "indexValue": {
          "$ref": "#/definitions/LocalizedText"
        }
      }
    },
    "Substance": {
      "type": "object",
      "properties": {
        "name": {
          "description": "Chosen substance name",
          "type": "string"
        },
        "cas": {
          "description": "CAS number of substance",
          "type": "string"
        },
        "substanceContents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubstanceContent"
          }
        },
        "effectiveWay": {
          "type": "string"
        },
        "kemiDigiURL": {
          "description": "Url to KemiDigi substance infocard.",
          "type": "string"
        }
      }
    },
    "SubstanceContent": {
      "type": "object",
      "properties": {
        "concentrationMin": {
          "format": "double",
          "description": "Minimum value in composition",
          "type": "number"
        },
        "concentrationMax": {
          "format": "double",
          "description": "Maximum value in composition",
          "type": "number"
        },
        "concentration": {
          "format": "double",
          "description": "Exact value in composition",
          "type": "number"
        },
        "concentrationUnit": {
          "description": "Concentration unit\r\nCodeScheme codeValue: 111",
          "type": "string"
        }
      }
    }
  }
}