// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
package docs

import (
	"bytes"
	"encoding/json"
	"strings"
	"text/template"

	"github.com/swaggo/swag"
)

var doc = `{
    "schemes": {{ marshal .Schemes }},
    "swagger": "2.0",
    "info": {
        "description": "{{escape .Description}}",
        "title": "{{.Title}}",
        "contact": {},
        "version": "{{.Version}}"
    },
    "host": "{{.Host}}",
    "basePath": "{{.BasePath}}",
    "paths": {
        "/api/v1/admin/profile/query": {
            "post": {
                "description": "CalcNodeProfiles",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Profile"
                ],
                "summary": "CalcNodeProfiles",
                "parameters": [
                    {
                        "type": "boolean",
                        "name": "is_dev_tier",
                        "in": "formData"
                    },
                    {
                        "type": "string",
                        "example": "0",
                        "name": "org_id",
                        "in": "formData"
                    },
                    {
                        "type": "string",
                        "example": "0",
                        "name": "project_id",
                        "in": "formData"
                    },
                    {
                        "type": "string",
                        "name": "provider",
                        "in": "formData"
                    },
                    {
                        "type": "string",
                        "name": "region",
                        "in": "formData"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.CalcNodeProfileResp"
                        }
                    }
                }
            }
        },
        "/external-api/v1/orgs/profile/replace_node_and_sku": {
            "post": {
                "description": "ReplaceNodeAndSKUByYaml",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Profile"
                ],
                "summary": "ReplaceNodeAndSKUByYaml",
                "parameters": [
                    {
                        "type": "string",
                        "name": "dryrun",
                        "in": "formData"
                    },
                    {
                        "type": "string",
                        "example": "the file of node, named by nodes.yaml",
                        "name": "node",
                        "in": "formData"
                    },
                    {
                        "type": "string",
                        "example": "the file of sku, named by skus.yaml",
                        "name": "sku",
                        "in": "formData"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.ReplaceProfileResponse"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/cluster-lifecycles": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Tenant"
                ],
                "summary": "ListTenantClusterLifeCycle",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org_id",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "name": "end",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "name": "start",
                        "in": "query",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.ListTenantClusterLifeCycleResp"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/clusters": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "TenantCuster"
                ],
                "summary": "List Tenant Cluster",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org_id",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "name": "per_page",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.ListTenantClustersResp"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/clusters/{cluster_id}": {
            "delete": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "TenantCuster"
                ],
                "summary": "Delete Tenant Cluster",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org_id",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster_id",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.EmptyResponse"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/clusters/{cluster_id}/components": {
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "TenantCuster"
                ],
                "summary": "Scale Tenant Cluster",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org_id",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster_id",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "scale cluster component",
                        "name": "scale",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.ScaleComponentReq"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.EmptyResponse"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/clusters/{cluster_id}/dashboard_links": {
            "get": {
                "description": "GetDashboardLinks",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "TenantCuster"
                ],
                "summary": "GetDashboardLinks",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org_id",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster_id",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.GetDashboardLinksResp"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/clusters/{cluster_id}/pause": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "TenantCuster"
                ],
                "summary": "Pause Tenant Cluster",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org_id",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster_id",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.CodeMsgResponse"
                        }
                    }
                }
            }
        },
        "/orgs/{org_id}/clusters/{cluster_id}/resume": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "TenantCuster"
                ],
                "summary": "Resume Tenant Cluster",
                "parameters": [
                    {
                        "type": "string",
                        "description": "org_id",
                        "name": "org_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "cluster_id",
                        "name": "cluster_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.CodeMsgResponse"
                        }
                    }
                }
            }
        },
        "/providers": {
            "get": {
                "description": "ListProviders",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Provider"
                ],
                "summary": "ListProviders",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.ListProvidersResp"
                        }
                    }
                }
            },
            "post": {
                "description": "AddProvider",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Provider"
                ],
                "summary": "AddProvider",
                "parameters": [
                    {
                        "description": "provider",
                        "name": "provider",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.Provider"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.EmptyResponse"
                        }
                    }
                }
            }
        },
        "/providers/{provider}/regions": {
            "get": {
                "description": "ListRegions",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Provider"
                ],
                "summary": "ListRegions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "provider",
                        "name": "provider",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.ListRegionResp"
                        }
                    }
                }
            },
            "post": {
                "description": "AddRegion",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Provider"
                ],
                "summary": "AddRegion",
                "parameters": [
                    {
                        "type": "string",
                        "description": "provider",
                        "name": "provider",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "region",
                        "name": "region",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.ProviderRegion"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.ProviderRegion"
                        }
                    }
                }
            }
        },
        "/providers/{provider}/regions/{region_id}": {
            "get": {
                "description": "GetRegionByID",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Provider"
                ],
                "summary": "GetRegionByID",
                "parameters": [
                    {
                        "type": "string",
                        "description": "provider",
                        "name": "provider",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "region_id",
                        "name": "region_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.ProviderRegion"
                        }
                    }
                }
            },
            "put": {
                "description": "UpdateRegion",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Provider"
                ],
                "summary": "UpdateRegion",
                "parameters": [
                    {
                        "type": "string",
                        "description": "provider",
                        "name": "provider",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "region_id",
                        "name": "region_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "region",
                        "name": "region",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.ProviderRegion"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.ProviderRegion"
                        }
                    }
                }
            },
            "delete": {
                "description": "DeleteRegion",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Provider"
                ],
                "summary": "DeleteRegion",
                "parameters": [
                    {
                        "type": "string",
                        "description": "provider",
                        "name": "provider",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "region_id",
                        "name": "region_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.EmptyResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "forms.CalcNodeProfileResp": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "component_node_profiles": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.NodeProfilesWithComponentType"
                    }
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "forms.CodeMsgResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "forms.ComponentScale": {
            "type": "object",
            "required": [
                "component_type",
                "node_profile_id",
                "replicas"
            ],
            "properties": {
                "component_type": {
                    "type": "string"
                },
                "node_profile_id": {
                    "type": "string",
                    "example": "0"
                },
                "replicas": {
                    "type": "integer"
                },
                "storage_size_gi": {
                    "type": "integer"
                }
            }
        },
        "forms.DashboardLink": {
            "type": "object",
            "properties": {
                "link": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "forms.EmptyResponse": {
            "type": "object"
        },
        "forms.GetDashboardLinksResp": {
            "type": "object",
            "properties": {
                "dashboards": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.DashboardLink"
                    }
                }
            }
        },
        "forms.ListProvidersResp": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.Provider"
                    }
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "forms.ListRegionResp": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.ProviderRegion"
                    }
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "forms.ListTenantClusterLifeCycleResp": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.TenantClusterLifecycle"
                    }
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "forms.ListTenantClustersResp": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.TenantCluster"
                    }
                },
                "message": {
                    "type": "string"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "forms.NodeProfile": {
            "type": "object",
            "properties": {
                "default_node_num": {
                    "type": "integer"
                },
                "id": {
                    "type": "string",
                    "example": "0"
                },
                "max_storage_size_gi": {
                    "type": "integer"
                },
                "min_storage_size_gi": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "forms.NodeProfileCompute": {
            "type": "object",
            "properties": {
                "cpu": {
                    "type": "integer"
                },
                "memory_mi": {
                    "type": "integer"
                }
            }
        },
        "forms.NodeProfileOfComponent": {
            "type": "object",
            "properties": {
                "compute": {
                    "$ref": "#/definitions/forms.NodeProfileCompute"
                },
                "name": {
                    "type": "string"
                },
                "node_profile_id": {
                    "type": "string",
                    "example": "0"
                },
                "storage_gi": {
                    "type": "integer"
                }
            }
        },
        "forms.NodeProfilesWithComponentType": {
            "type": "object",
            "properties": {
                "component_type": {
                    "description": "core.proto:ComponentType.string()",
                    "type": "string"
                },
                "profiles": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.NodeProfile"
                    }
                }
            }
        },
        "forms.Provider": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "forms.ProviderRegion": {
            "type": "object",
            "properties": {
                "area": {
                    "type": "string"
                },
                "country_code": {
                    "type": "string"
                },
                "default_backup_time": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "id": {
                    "type": "string",
                    "example": "0"
                },
                "is_public": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                },
                "opened_org_ids": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "priority": {
                    "type": "integer"
                },
                "provider": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "zones": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "forms.ReplaceProfileResponse": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "message": {
                    "type": "string"
                },
                "version_id": {
                    "type": "integer"
                }
            }
        },
        "forms.ScaleComponentReq": {
            "type": "object",
            "required": [
                "components"
            ],
            "properties": {
                "components": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.ComponentScale"
                    }
                }
            }
        },
        "forms.TenantCluster": {
            "type": "object",
            "properties": {
                "create_time": {
                    "type": "integer"
                },
                "cross_account_deployment_id": {
                    "type": "string",
                    "example": "0"
                },
                "id": {
                    "type": "string",
                    "example": "0"
                },
                "is_dev_tier": {
                    "type": "boolean"
                },
                "name": {
                    "type": "string"
                },
                "profile": {
                    "type": "string"
                },
                "project_id": {
                    "type": "string",
                    "example": "0"
                },
                "project_name": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "region": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_components": {
                    "$ref": "#/definitions/forms.TenantComponents"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "forms.TenantClusterLifecycle": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "integer"
                },
                "deleted_at": {
                    "type": "integer"
                },
                "id": {
                    "type": "string",
                    "example": "0"
                },
                "project_id": {
                    "type": "string",
                    "example": "0"
                }
            }
        },
        "forms.TenantComponent": {
            "type": "object",
            "properties": {
                "machineType": {
                    "description": "TODO(chenfei): remove. used by gitops to overlay configuration for component for now",
                    "type": "string"
                },
                "node_profile": {
                    "$ref": "#/definitions/forms.NodeProfileOfComponent"
                },
                "replicas": {
                    "type": "integer"
                }
            }
        },
        "forms.TenantComponents": {
            "type": "object",
            "properties": {
                "pd": {
                    "$ref": "#/definitions/forms.TenantComponent"
                },
                "tidb": {
                    "$ref": "#/definitions/forms.TenantComponent"
                },
                "tiflash": {
                    "$ref": "#/definitions/forms.TenantComponent"
                },
                "tikv": {
                    "$ref": "#/definitions/forms.TenantComponent"
                }
            }
        }
    }
}`

type swaggerInfo struct {
	Version     string
	Host        string
	BasePath    string
	Schemes     []string
	Title       string
	Description string
}

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
	Version:     "1.0",
	Host:        "127.0.0.1:8080",
	BasePath:    "/api/v1/admin",
	Schemes:     []string{},
	Title:       "Management Portal API",
	Description: "This is a management portal server",
}

type s struct{}

func (s *s) ReadDoc() string {
	sInfo := SwaggerInfo
	sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)

	t, err := template.New("swagger_info").Funcs(template.FuncMap{
		"marshal": func(v interface{}) string {
			a, _ := json.Marshal(v)
			return string(a)
		},
		"escape": func(v interface{}) string {
			// escape tabs
			str := strings.Replace(v.(string), "\t", "\\t", -1)
			// replace " with \", and if that results in \\", replace that with \\\"
			str = strings.Replace(str, "\"", "\\\"", -1)
			return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
		},
	}).Parse(doc)
	if err != nil {
		return doc
	}

	var tpl bytes.Buffer
	if err := t.Execute(&tpl, sInfo); err != nil {
		return doc
	}

	return tpl.String()
}

func init() {
	swag.Register(swag.Name, &s{})
}
