// Code generated by swaggo/swag. DO NOT EDIT.

package docs

import "github.com/swaggo/swag"

const docTemplate = `{
    "schemes": {{ marshal .Schemes }},
    "swagger": "2.0",
    "info": {
        "description": "{{escape .Description}}",
        "title": "{{.Title}}",
        "contact": {},
        "version": "{{.Version}}"
    },
    "host": "{{.Host}}",
    "basePath": "{{.BasePath}}",
    "paths": {
        "/api/healthcheck": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Get server status",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Health"
                ],
                "summary": "Show server status",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/schemas.HealthCheckResponse"
                        }
                    },
                    "401": {
                        "description": "Error returned when the provided auth data is invalid",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Error returned when auth data was not provided",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/login": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Authenticates a user using email and password, and generates a new JWT. Also sets refresh token in cookies.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Logs in a user",
                "parameters": [
                    {
                        "description": "The email and password of the user",
                        "name": "InputBody",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/schemas.LoginInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Returns a struct with the JWT and its expiration timestamp",
                        "schema": {
                            "$ref": "#/definitions/schemas.TokenResponse"
                        }
                    },
                    "400": {
                        "description": "Returns an error message if the request body cannot be parsed",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Error returned when the provided auth data is invalid",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Error returned when auth data was not provided",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Returns an error message if there is a server-side issue",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/logout": {
            "post": {
                "security": [
                    {
                        "JWTAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Restricts access to services for the active client until a new login occurs.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Logs out a user",
                "responses": {
                    "200": {
                        "description": "Successfully logged out user with ID #id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "401": {
                        "description": "Error returned when the provided auth data is invalid",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Error returned when auth data was not provided",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Returns an error message if there is a server-side issue",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/refresh": {
            "post": {
                "security": [
                    {
                        "JWTAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Use the refresh token to get a new access token and to set new refresh token in cookies.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Refresh tokens",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/schemas.TokenResponse"
                        }
                    },
                    "401": {
                        "description": "Error returned when the provided auth data is invalid",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Error returned when auth data was not provided",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/users": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "get many users based on pagination and sorting parameters",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Users"
                ],
                "summary": "Get list of users",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Sorting (format: field[direction])",
                        "name": "sort",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.User"
                            }
                        }
                    },
                    "401": {
                        "description": "Error returned when the provided auth data is invalid",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Error returned when auth data was not provided",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Unprocessable entity",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Register a new user with email, screen_name, and password",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Users"
                ],
                "summary": "Register new user",
                "parameters": [
                    {
                        "description": "Create user",
                        "name": "user",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/schemas.CreateUserRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "User registered successfully",
                        "schema": {
                            "$ref": "#/definitions/models.User"
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Error returned when the provided auth data is invalid",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Error returned when auth data was not provided",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/users/{id}": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Retrieve a user from the database by ID",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Users"
                ],
                "summary": "Get user by ID",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "User ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.User"
                        }
                    },
                    "401": {
                        "description": "Error returned when the provided auth data is invalid",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Error returned when auth data was not provided",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "User not found",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "406": {
                        "description": "Multiple records found (internal error)",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Unprocessable entity",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/validate": {
            "post": {
                "security": [
                    {
                        "JWTAuth": []
                    },
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Checks if provided authorization data is valid.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Auth"
                ],
                "summary": "Checks access for secure endpoints.",
                "responses": {
                    "200": {
                        "description": "Authorization data is valid for user with ID #id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "401": {
                        "description": "Error returned when the provided auth data is invalid",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Error returned when auth data was not provided",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "schema": {
                            "$ref": "#/definitions/schemas.ErrorResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "models.User": {
            "type": "object",
            "properties": {
                "company_id": {
                    "description": "A link to the user's company ID, nullable.\n@Example 1",
                    "type": "integer"
                },
                "created_at": {
                    "description": "When record was created.\n@Format format(date-time)\n@Example 2023-05-18T18:57:39Z",
                    "type": "string"
                },
                "deleted_at": {
                    "description": "When record was attempted to delete, nullable.\n@Format format(date-time)\n@Example 2023-05-18T18:57:39Z",
                    "type": "string"
                },
                "email": {
                    "description": "The email address of a user.\nThis field is unique and not-null.\n@Format email\n@Example john@example.com",
                    "type": "string"
                },
                "id": {
                    "description": "The auto-created unique identifier for the user.\n@Example 123",
                    "type": "integer"
                },
                "password": {
                    "description": "A secret that only the creator of the record knows\n@Example 1234567",
                    "type": "string"
                },
                "rank": {
                    "description": "Status of a user, nullable.\n@Example 1",
                    "type": "integer"
                },
                "screen_name": {
                    "description": "The desired screenname for the user.\nThis field is required and must contain at least 4 characters.\n@Example jonhDoe123",
                    "type": "string"
                },
                "updated_at": {
                    "description": "When record was updated last time.\n@Format format(date-time)\n@Example 2023-05-18T18:57:39Z",
                    "type": "string"
                }
            }
        },
        "schemas.CreateUserRequest": {
            "description": "This request includes the necessary details to create a new user.",
            "type": "object",
            "required": [
                "email",
                "password",
                "screen_name"
            ],
            "properties": {
                "company_id": {
                    "description": "The ID of the company to associate with the new user. This field is optional and must be greater than 0 if provided.\n@Min 0\n@Example 1",
                    "type": "integer"
                },
                "email": {
                    "description": "The email address of the new user. This field is required and must be a valid email address.\n@Format email\n@Example john@example.com",
                    "type": "string"
                },
                "password": {
                    "description": "The password for the new user. This field is required and must contain at least 7 characters.\n@MinLength 7\n@Example 1234567",
                    "type": "string",
                    "minLength": 7
                },
                "rank": {
                    "description": "The rank of the new user. This field is optional and must be greater than 0 if provided.\n@Min 0\n@Example 1",
                    "type": "integer"
                },
                "screen_name": {
                    "description": "The desired username for the new user. This field is required and must contain at least 4 characters.\n@MinLength 4\n@Example jonhDoe123",
                    "type": "string",
                    "minLength": 4
                }
            }
        },
        "schemas.ErrorResponse": {
            "type": "object",
            "properties": {
                "error": {
                    "type": "string"
                }
            }
        },
        "schemas.HealthCheckResponse": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "string"
                }
            }
        },
        "schemas.LoginInput": {
            "type": "object",
            "required": [
                "email",
                "password"
            ],
            "properties": {
                "email": {
                    "type": "string"
                },
                "password": {
                    "type": "string",
                    "minLength": 7
                }
            }
        },
        "schemas.TokenResponse": {
            "type": "object",
            "properties": {
                "access_expires": {
                    "type": "integer"
                },
                "access_token": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "ApiKeyAuth": {
            "type": "apiKey",
            "name": "X-Api-Key",
            "in": "header"
        },
        "JWTAuth": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    }
}`

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
	Version:          "v1.0.0",
	Host:             "localhost:8080",
	BasePath:         "/",
	Schemes:          []string{"https"},
	Title:            "Auth Service API",
	Description:      "API server for auth stuff",
	InfoInstanceName: "swagger",
	SwaggerTemplate:  docTemplate,
	LeftDelim:        "{{",
	RightDelim:       "}}",
}

func init() {
	swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
