{
  "openapi": "3.0.4",
  "info": {
    "title": "ArgonFetch.API",
    "version": "1.0"
  },
  "paths": {
    "/api/App": {
      "get": {
        "tags": [
          "App"
        ],
        "operationId": "GetAppInfo",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AppInfoDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppInfoDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppInfoDto"
                }
              }
            }
          }
        }
      }
    },
    "/api/App/requests": {
      "get": {
        "tags": [
          "App"
        ],
        "operationId": "GetRequestCount",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/Fetch/GetResource": {
      "get": {
        "tags": [
          "Fetch"
        ],
        "operationId": "GetResource",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceInformationDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceInformationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceInformationDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Stream/Combined/{key}": {
      "get": {
        "tags": [
          "Stream"
        ],
        "operationId": "Combined",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/Stream/Media/{key}": {
      "get": {
        "tags": [
          "Stream"
        ],
        "operationId": "Media",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "206": {
            "description": "Partial Content"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "416": {
            "description": "Range Not Satisfiable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AppInfoDto": {
        "required": [
          "environment",
          "isHealthy",
          "version"
        ],
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "nullable": true
          },
          "isHealthy": {
            "type": "boolean"
          },
          "environment": {
            "type": "string",
            "nullable": true
          },
          "maintenance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MediaInformationDto": {
        "required": [
          "author",
          "coverUrl",
          "requestedUrl",
          "title"
        ],
        "type": "object",
        "properties": {
          "requestedUrl": {
            "type": "string",
            "nullable": true
          },
          "video": {
            "$ref": "#/components/schemas/StreamReferenceDto"
          },
          "audio": {
            "$ref": "#/components/schemas/StreamReferenceDto"
          },
          "coverUrl": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "author": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MediaRenditionDto": {
        "required": [
          "fileExtension",
          "key",
          "label",
          "mimeType"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "nullable": true
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "fileExtension": {
            "type": "string",
            "nullable": true
          },
          "mimeType": {
            "type": "string",
            "nullable": true
          },
          "urlType": {
            "$ref": "#/components/schemas/UrlType"
          },
          "fileSizeBytes": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "bitrate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "convertTo": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MediaType": {
        "enum": [
          "Media",
          "PlayList",
          "Unknown"
        ],
        "type": "string"
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "ResourceInformationDto": {
        "required": [
          "mediaItems",
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/MediaType"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "author": {
            "type": "string",
            "nullable": true
          },
          "coverUrl": {
            "type": "string",
            "nullable": true
          },
          "mediaItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaInformationDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "StreamReferenceDto": {
        "type": "object",
        "properties": {
          "bestQualityDescription": {
            "type": "string",
            "nullable": true
          },
          "bestQualityKey": {
            "type": "string",
            "nullable": true
          },
          "bestQualityFileExtension": {
            "type": "string",
            "nullable": true
          },
          "bestQualityMimeType": {
            "type": "string",
            "nullable": true
          },
          "mediumQualityDescription": {
            "type": "string",
            "nullable": true
          },
          "mediumQualityKey": {
            "type": "string",
            "nullable": true
          },
          "mediumQualityFileExtension": {
            "type": "string",
            "nullable": true
          },
          "mediumQualityMimeType": {
            "type": "string",
            "nullable": true
          },
          "worstQualityDescription": {
            "type": "string",
            "nullable": true
          },
          "worstQualityKey": {
            "type": "string",
            "nullable": true
          },
          "worstQualityFileExtension": {
            "type": "string",
            "nullable": true
          },
          "worstQualityMimeType": {
            "type": "string",
            "nullable": true
          },
          "urlType": {
            "$ref": "#/components/schemas/UrlType"
          },
          "renditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaRenditionDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UrlType": {
        "enum": [
          "Combined",
          "Media"
        ],
        "type": "string"
      }
    }
  }
}
