{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ibm-api-connect/json-schema/ibm-api-connect-quota-schema.json",
  "title": "Quota",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ibm-api-connect-plans-and-quotas-api-openapi.yml#/components/schemas/Quota",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "type": {
      "type": "string",
      "readOnly": true,
      "enum": [
        "quota"
      ]
    },
    "api_version": {
      "type": "string",
      "readOnly": true,
      "enum": [
        "2.0.0"
      ]
    },
    "id": {
      "type": "string",
      "readOnly": true
    },
    "name": {
      "type": "string",
      "maxLength": 255
    },
    "version": {
      "type": "string",
      "maxLength": 255
    },
    "title": {
      "type": "string",
      "maxLength": 1023
    },
    "summary": {
      "type": "string",
      "maxLength": 65535
    },
    "scope": {
      "type": "string"
    },
    "quota_kind": {
      "$ref": "#/$defs/ProjectQuota"
    },
    "org_url": {
      "type": "string",
      "format": "uri"
    },
    "catalog_url": {
      "type": "string",
      "format": "uri"
    },
    "space_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "plan_urls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "url": {
      "type": "string",
      "readOnly": true,
      "format": "uri"
    }
  },
  "$defs": {
    "ProjectMetadata": {
      "description": "Defines a message named Metadata",
      "type": "object",
      "required": [
        "name",
        "version"
      ],
      "additionalProperties": false,
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "namespace": {
          "type": "string"
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "type": {
          "enum": [
            "REST",
            "SWAGGER",
            "SOAP",
            "GRAPHQL",
            "ODATA"
          ],
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "domain": {
          "enum": [
            "api",
            "ai-platform",
            "mcp"
          ],
          "type": "string"
        },
        "labels": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "gatewayTypes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "ProjectQuota": {
      "type": "object",
      "required": [
        "kind",
        "apiVersion",
        "metadata",
        "spec"
      ],
      "properties": {
        "apiVersion": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "Quota"
          ],
          "type": "string"
        },
        "metadata": {
          "$ref": "#/$defs/ProjectMetadata"
        },
        "spec": {
          "type": "object",
          "properties": {
            "maxRequest": {
              "type": "integer",
              "description": "Size of the rate limit bucket"
            },
            "interval": {
              "type": "string",
              "description": "Time interval for the rate limit (e.g., 1s, 1m, 1h)"
            },
            "extensions": {
              "type": "object",
              "properties": {
                "dp-gateway": {
                  "type": "object",
                  "properties": {
                    "apiVersion": {
                      "type": "string"
                    },
                    "spec": {
                      "type": "object",
                      "properties": {
                        "onLimitReach": {
                          "type": "string",
                          "enum": [
                            "block",
                            "allow"
                          ]
                        }
                      }
                    }
                  }
                },
                "dp-nano-gateway": {
                  "type": "object",
                  "properties": {
                    "apiVersion": {
                      "type": "string"
                    },
                    "spec": {
                      "type": "object",
                      "properties": {
                        "weightExpr": {
                          "type": "string",
                          "description": "Optional dynamic string expression"
                        },
                        "exceedAction": {
                          "type": "string",
                          "enum": [
                            "continue",
                            "return429",
                            "return500"
                          ]
                        },
                        "intervalOffset": {
                          "type": "integer"
                        },
                        "dynamicValue": {
                          "type": "string",
                          "description": "Optional dynamic key expression"
                        }
                      }
                    }
                  }
                },
                "webm-gateway": {
                  "type": "object",
                  "properties": {
                    "apiVersion": {
                      "type": "string"
                    },
                    "spec": {
                      "type": "object",
                      "properties": {
                        "alertMessage": {
                          "type": "string"
                        },
                        "alertFrequency": {
                          "type": "string",
                          "enum": [
                            "always",
                            "once"
                          ]
                        },
                        "onLimitReach": {
                          "type": "string",
                          "enum": [
                            "block",
                            "allow"
                          ]
                        },
                        "notification": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean"
                            },
                            "notifyAfter": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            },
                            "email": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "customDestination": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}