{
  "openapi": "3.0.4",
  "info": {
    "title": "Shared Server",
    "description": "API REST for the GFAL Shared Services Server, made by Blai",
    "version": "v1.0"
  },
  "paths": {
    "/api/callback": {
      "get": {
        "tags": [
          "Callback"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/callback/proof-of-luxe": {
      "post": {
        "tags": [
          "callback",
          "proof-of-luxe"
        ],
        "summary": "Send email for proof of luxe callback",
        "description": "Send email for proof of luxe callback",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The callback has been handled successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request was malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "401": {
            "description": "The server is not authenticated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/callback/default-game": {
      "post": {
        "tags": [
          "callback",
          "default-game"
        ],
        "summary": "Send email for default game callback",
        "description": "Send email for default game callback",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The callback has been handled successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request was malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "401": {
            "description": "The server is not authenticated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/emails": {
      "post": {
        "tags": [
          "Email"
        ],
        "summary": "Send email",
        "description": "Send email",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The email was sent successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request was malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "401": {
            "description": "The server is not authenticated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/images/{id}": {
      "get": {
        "tags": [
          "Image"
        ],
        "summary": "Get image with supported format.",
        "description": "Get image with supported format.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "webp"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The image was returned successfully.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request was malformed.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "401": {
            "description": "The server is not authenticated.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/mailinglist/add/email": {
      "post": {
        "tags": [
          "Mailing List"
        ],
        "summary": "Add email to mailing list",
        "description": "Add email to mailing list",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailingListRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The email was added to the mailing list successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request was malformed or the email already exists in the specified list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "401": {
            "description": "The request was unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/profanity": {
      "post": {
        "tags": [
          "Profanity"
        ],
        "summary": "Get profanity score",
        "description": "Get profanity score",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfanityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The profanity scored was returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request was malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "401": {
            "description": "The server is not authenticated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/recaptcha": {
      "post": {
        "tags": [
          "ReCAPTCHA"
        ],
        "summary": "Validate ReCAPTCHA Attempt",
        "description": "Validate ReCAPTCHA Attempt",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReCAPTCHARequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The attempt was validated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReCAPTCHAResponseGFALResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request was malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "401": {
            "description": "The server is not authenticated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/translations": {
      "get": {
        "tags": [
          "Translation"
        ],
        "summary": "Get translations",
        "description": "Get translations",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The translations were retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/translations/{path}": {
      "get": {
        "tags": [
          "Translation"
        ],
        "summary": "Get translation",
        "description": "Get translation",
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The translation was retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "401": {
            "description": "The server is not authenticated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "404": {
            "description": "The translation was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/translations/locales": {
      "get": {
        "tags": [
          "Translation"
        ],
        "summary": "Get supported locales",
        "description": "Get supported locales",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authorization",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The supported locales were retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GFALResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EmailRequest": {
        "required": [
          "subject",
          "template",
          "to"
        ],
        "type": "object",
        "properties": {
          "fromAddress": {
            "type": "string",
            "format": "email",
            "nullable": true
          },
          "fromName": {
            "type": "string",
            "nullable": true
          },
          "to": {
            "minLength": 1,
            "type": "string"
          },
          "subject": {
            "minLength": 1,
            "type": "string"
          },
          "template": {
            "minLength": 1,
            "type": "string"
          },
          "tag": {
            "type": "string",
            "nullable": true
          },
          "params": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GFALResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "strStatusCode": {
            "type": "string",
            "nullable": true
          },
          "payload": {
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MailingListRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "mailinglist": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "NotificationRequest": {
        "type": "object",
        "properties": {
          "gfalId": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "time": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ProfanityRequest": {
        "required": [
          "needle"
        ],
        "type": "object",
        "properties": {
          "needle": {
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ReCAPTCHARequest": {
        "required": [
          "action",
          "id",
          "token"
        ],
        "type": "object",
        "properties": {
          "id": {
            "minLength": 1,
            "type": "string"
          },
          "token": {
            "minLength": 1,
            "type": "string"
          },
          "action": {
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ReCAPTCHAResponse": {
        "type": "object",
        "properties": {
          "result": {
            "type": "string",
            "nullable": true
          },
          "score": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "ReCAPTCHAResponseGFALResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "strStatusCode": {
            "type": "string",
            "nullable": true
          },
          "payload": {
            "$ref": "#/components/schemas/ReCAPTCHAResponse"
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}