{
  "$ref": "#/definitions/ocpi.2_2_1.tariffs",
  "definitions": {
    "ocpi.2_2_1.tariffs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 36
          },
          "country_code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "party_id": {
            "type": "string",
            "maxLength": 3
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "AD_HOC_PAYMENT",
                  "PROFILE_CHEAP",
                  "PROFILE_FAST",
                  "PROFILE_GREEN",
                  "REGULAR"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "tariff_alt_text": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "language": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 2
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 512
                    }
                  },
                  "required": [
                    "language",
                    "text"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "tariff_alt_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "min_price": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "excl_vat": {
                    "type": "number",
                    "minimum": 0
                  },
                  "incl_vat": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "excl_vat"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "max_price": {
            "anyOf": [
              {
                "$ref": "#/definitions/ocpi.2_2_1.tariffs/items/properties/min_price/anyOf/0"
              },
              {
                "type": "null"
              }
            ]
          },
          "elements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "price_components": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "ENERGY",
                          "FLAT",
                          "PARKING_TIME",
                          "TIME"
                        ]
                      },
                      "price": {
                        "type": "number",
                        "minimum": 0
                      },
                      "vat": {
                        "anyOf": [
                          {
                            "type": "number",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "step_size": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "type",
                      "price",
                      "step_size"
                    ],
                    "additionalProperties": false
                  },
                  "minItems": 1
                },
                "restrictions": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "start_time": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 5,
                              "maxLength": 5,
                              "pattern": "([0-1][0-9]|2[0-3]):[0-5][0-9]"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "end_time": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 5,
                              "maxLength": 5,
                              "pattern": "([0-1][0-9]|2[0-3]):[0-5][0-9]"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "start_date": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 10,
                              "maxLength": 10,
                              "pattern": "([12][0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "end_date": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 10,
                              "maxLength": 10,
                              "pattern": "([12][0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "min_kwh": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "max_kwh": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "min_current": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "max_current": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "min_power": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "max_power": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "min_duration": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "max_duration": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "day_of_week": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "MONDAY",
                                  "TUESDAY",
                                  "WEDNESDAY",
                                  "THURSDAY",
                                  "FRIDAY",
                                  "SATURDAY",
                                  "SUNDAY"
                                ]
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "reservation": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "RESERVATION",
                                "RESERVATION_EXPIRES"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "price_components"
              ],
              "additionalProperties": false
            },
            "minItems": 1
          },
          "energy_mix": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "is_green_energy": {
                    "type": "boolean"
                  },
                  "energy_sources": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string",
                              "enum": [
                                "NUCLEAR",
                                "GENERAL_FOSSIL",
                                "COAL",
                                "GAS",
                                "GENERAL_GREEN",
                                "SOLAR",
                                "WIND",
                                "WATER"
                              ]
                            },
                            "percentage": {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            }
                          },
                          "required": [
                            "source",
                            "percentage"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "environ_impact": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string",
                              "enum": [
                                "NUCLEAR_WASTE",
                                "CARBON_DIOXIDE"
                              ]
                            },
                            "amount": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "source",
                            "amount"
                          ],
                          "additionalProperties": false
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "supplier_name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "energy_product_name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "is_green_energy"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "start_date_time": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "end_date_time": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_updated": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "country_code",
          "party_id",
          "currency",
          "elements",
          "last_updated"
        ],
        "additionalProperties": false
      }
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}