{
  "openapi": "3.0.0",
  "info": {
    "title": "li'l Judd - OpenAPI 3.0",
    "description": "None yet",
    "termsOfService": "https://liljudd.ink/terms-of-service/",
    "contact": {
      "url": "https://liljudd.ink/contact/"
    },
    "version": "0.0.0"
  },
  "paths": {
    "/api/config/{guildId}": {
      "get": {
        "tags": [
          "Guild configs"
        ],
        "summary": "Find guild config by ID",
        "description": "Returns a single guild config",
        "operationId": "getGuildById",
        "parameters": [
          {
            "name": "guildId",
            "in": "path",
            "description": "ID of guild config to return",
            "required": true,
            "schema": {
              "type": "string",
              "format": "varchar(19)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/guildConfig"
                }
              }
            }
          },
          "400": {
            "description": "Invalid ID supplied"
          },
          "404": {
            "description": "Guild not found"
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Guild configs"
        ],
        "summary": "Deletes a guild config by ID",
        "description": "Delete a guild's config",
        "operationId": "deleteGuildById",
        "parameters": [
          {
            "name": "guildId",
            "in": "path",
            "description": "ID of guild config to delete",
            "required": true,
            "schema": {
              "type": "string",
              "format": "varchar(19)"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "successful operation"
          },
          "400": {
            "description": "Invalid ID supplied"
          },
          "404": {
            "description": "Guild not found"
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/api/tp_messages/{guildId}": {
      "get": {
        "tags": [
          "Time planning messages"
        ],
        "summary": "Find guild by ID for it's tp_messages",
        "description": "Returns tp_messages for a guild",
        "operationId": "getTp_messagesOfGuildById",
        "parameters": [
          {
            "name": "guildId",
            "in": "path",
            "description": "ID of guild's tp_messages to return",
            "required": true,
            "schema": {
              "type": "string",
              "format": "varchar(19)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/guildConfig"
                }
              }
            }
          },
          "204": {
            "description": "Time planning not enabled for this guild"
          },
          "400": {
            "description": "Invalid ID supplied"
          },
          "404": {
            "description": "Guild not found"
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "guildConfig": {
        "type": "object",
        "properties": {
          "guildID": {
            "type": "string",
            "format": "varchar(19)",
            "example": "1234567890123456789"
          },
          "features": {
            "type": "object",
            "properties": {
              "time_planning": {
                "type": "object",
                "properties": {
                  "channelID": {
                    "type": "string",
                    "format": "varchar(19)",
                    "example": "1234567890123456789"
                  },
                  "cron": {
                    "type": "string",
                    "example": "0 0 1 * * * 60o 1w"
                  },
                  "isAvailableRoleId": {
                    "type": "string",
                    "format": "varchar(19)",
                    "example": "1234567890123456789"
                  },
                  "wantsToBeNotifieRoledId": {
                    "type": "string",
                    "format": "varchar(19)",
                    "example": "1234567890123456789"
                  }
                }
              }
            }
          },
          "matches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/match"
            }
          }
        }
      },
      "match": {
        "type": "object",
        "properties": {
          "channelID": {
            "type": "string",
            "format": "varchar(19)",
            "example": "1234567890123456789"
          },
          "matchType": {
            "type": "string",
            "format": "varchar(50)",
            "example": "Scrim"
          },
          "createrId": {
            "type": "string",
            "format": "varchar(19)",
            "example": "1234567890123456789"
          },
          "roleId": {
            "type": "string",
            "format": "varchar(19)",
            "example": "1234567890123456789"
          },
          "opponentName": {
            "type": "string",
            "format": "varchar(100)",
            "example": "?"
          },
          "messsageId": {
            "type": "string",
            "format": "varchar(19)",
            "example": "1234567890123456789"
          },
          "cron": {
            "type": "string",
            "example": "0 0 1 5 2 2023 60o"
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "api_key",
        "in": "header"
      }
    }
  }
}