1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-06 23:46:29 +02:00

2211 lines
74 KiB
Go
Raw Normal View History

// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
2019-07-07 12:52:55 -08:00
// 2019-06-27 04:56:45.692511 -0800 AKDT m=+325.727343639
package docs
import (
"bytes"
"github.com/alecthomas/template"
"github.com/swaggo/swag"
)
var doc = `{
"swagger": "2.0",
"info": {
"description": "This is a sample server celler server.",
"title": "SaaS Example API",
"termsOfService": "http://example.com/terms",
"contact": {
"name": "API Support",
"url": "http://example.com/support",
"email": "support@geeksinthewoods.com"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
2019-06-24 22:41:21 -08:00
"paths": {
"/accounts": {
"patch": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Update updates the specified account in the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"account"
],
"summary": "Update account by ID",
"parameters": [
{
"description": "Update fields",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/account.AccountUpdateRequest"
}
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
2019-06-24 22:41:21 -08:00
"/accounts/{id}": {
"get": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Read returns the specified account from the system.",
2019-06-24 22:41:21 -08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"account"
],
"summary": "Get account by ID",
2019-06-24 22:41:21 -08:00
"parameters": [
{
"type": "string",
2019-06-24 22:41:21 -08:00
"description": "Account ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/account.AccountResponse"
2019-06-24 22:41:21 -08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
2019-06-24 22:41:21 -08:00
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
2019-06-24 22:41:21 -08:00
}
}
}
}
},
"/oauth/token": {
"post": {
"security": [
{
"BasicAuth": []
}
],
"description": "Token generates an oauth2 accessToken using Basic Auth with a user's email and password.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Token handles a request to authenticate a user.",
"parameters": [
{
"enum": [
"user",
"admin"
],
"type": "string",
"description": "Scope",
"name": "scope",
"in": "query"
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"200": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/web.ErrorResponse"
}
},
2019-07-07 12:52:55 -08:00
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/web.ErrorResponse"
}
},
2019-07-07 12:52:55 -08:00
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
"/project": {
"get": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Find returns the existing projects in the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"project"
],
"summary": "List projects",
"parameters": [
{
"type": "string",
"description": "Filter string, example: name = 'Moon Launch'",
"name": "where",
"in": "query"
},
{
"type": "string",
"description": "Order columns separated by comma, example: created_at desc",
"name": "order",
"in": "query"
},
{
"type": "integer",
"description": "Limit, example: 10",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Offset, example: 20",
"name": "offset",
"in": "query"
},
{
"type": "boolean",
"description": "Included Archived, example: false",
"name": "included-archived",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/project.ProjectResponse"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
"/projects": {
"post": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Create inserts a new project into the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"project"
],
"summary": "Create new project.",
"parameters": [
{
"description": "Project details",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/project.ProjectCreateRequest"
}
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"201": {
"description": "Created",
"schema": {
"type": "object",
"$ref": "#/definitions/project.ProjectResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
},
"patch": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Update updates the specified project in the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"project"
],
"summary": "Update project by ID",
"parameters": [
{
"description": "Update fields",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/project.ProjectUpdateRequest"
}
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
"/projects/archive": {
"patch": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Archive soft-deletes the specified project from the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"project"
],
"summary": "Archive project by ID",
"parameters": [
{
"description": "Update fields",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/project.ProjectArchiveRequest"
}
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
"/projects/{id}": {
"get": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Read returns the specified project from the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"project"
],
"summary": "Get project by ID.",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/project.ProjectResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
},
"delete": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Delete removes the specified project from the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"project"
],
"summary": "Delete project by ID",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
"/signup": {
"post": {
"description": "Signup creates a new account and user in the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"signup"
],
"summary": "Signup handles new account creation.",
"parameters": [
{
"description": "Signup details",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/signup.SignupRequest"
}
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"201": {
"description": "Created",
"schema": {
"type": "object",
"$ref": "#/definitions/signup.SignupResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
2019-07-07 12:52:55 -08:00
"/user_accounts": {
"get": {
"security": [
{
"OAuth2Password": []
}
],
2019-07-07 12:52:55 -08:00
"description": "Find returns the existing user accounts in the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2019-07-07 12:52:55 -08:00
"user_account"
],
2019-07-07 12:52:55 -08:00
"summary": "List user accounts",
"parameters": [
{
"type": "string",
2019-07-07 12:52:55 -08:00
"description": "Filter string, example: account_id = 'c4653bf9-5978-48b7-89c5-95704aebb7e2'",
"name": "where",
"in": "query"
},
{
"type": "string",
"description": "Order columns separated by comma, example: created_at desc",
"name": "order",
"in": "query"
},
{
"type": "integer",
"description": "Limit, example: 10",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Offset, example: 20",
"name": "offset",
"in": "query"
},
{
"type": "boolean",
"description": "Included Archived, example: false",
"name": "included-archived",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/user_account.UserAccountResponse"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
},
"post": {
"security": [
{
"OAuth2Password": []
}
],
2019-07-07 12:52:55 -08:00
"description": "Create inserts a new user account into the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2019-07-07 12:52:55 -08:00
"user_account"
],
2019-07-07 12:52:55 -08:00
"summary": "Create new user account.",
"parameters": [
{
2019-07-07 12:52:55 -08:00
"description": "User Account details",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/user_account.UserAccountCreateRequest"
}
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"201": {
"description": "Created",
"schema": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/user_account.UserAccountResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
},
2019-07-07 12:52:55 -08:00
"delete": {
"security": [
{
"OAuth2Password": []
}
],
2019-07-07 12:52:55 -08:00
"description": "Delete removes the specified user account from the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
2019-07-07 12:52:55 -08:00
"summary": "Delete user account by user ID and account ID",
"parameters": [
{
2019-07-07 12:52:55 -08:00
"type": "string",
"description": "UserAccount ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
2019-07-07 12:52:55 -08:00
},
"patch": {
"security": [
{
"OAuth2Password": []
}
],
2019-07-07 12:52:55 -08:00
"description": "Update updates the specified user account in the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
2019-07-07 12:52:55 -08:00
"summary": "Update user account by user ID and account ID",
"parameters": [
{
"description": "Update fields",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/user_account.UserAccountUpdateRequest"
}
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
2019-07-07 12:52:55 -08:00
"/user_accounts/archive": {
"patch": {
"security": [
{
"OAuth2Password": []
}
],
2019-07-07 12:52:55 -08:00
"description": "Archive soft-deletes the specified user account from the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
2019-07-07 12:52:55 -08:00
"summary": "Archive user account by user ID and account ID",
"parameters": [
{
"description": "Update fields",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/user_account.UserAccountArchiveRequest"
}
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
2019-07-07 12:52:55 -08:00
"/user_accounts/{id}": {
"get": {
"security": [
{
"OAuth2Password": []
}
],
2019-07-07 12:52:55 -08:00
"description": "Read returns the specified user account from the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2019-07-07 12:52:55 -08:00
"user_account"
],
2019-07-07 12:52:55 -08:00
"summary": "Get user account by ID",
"parameters": [
{
2019-07-07 12:52:55 -08:00
"type": "string",
"description": "UserAccount ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"200": {
"description": "OK",
"schema": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/user_account.UserAccountResponse"
}
},
2019-07-07 12:52:55 -08:00
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
2019-07-07 12:52:55 -08:00
"/users": {
"get": {
"security": [
{
"OAuth2Password": []
}
],
2019-07-07 12:52:55 -08:00
"description": "Find returns the existing users in the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
2019-07-07 12:52:55 -08:00
"summary": "List users",
"parameters": [
{
"type": "string",
2019-07-07 12:52:55 -08:00
"description": "Filter string, example: name = 'Company Name' and email = 'gabi.may@geeksinthewoods.com'",
"name": "where",
"in": "query"
},
{
"type": "string",
"description": "Order columns separated by comma, example: created_at desc",
"name": "order",
"in": "query"
},
{
"type": "integer",
"description": "Limit, example: 10",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Offset, example: 20",
"name": "offset",
"in": "query"
},
{
"type": "boolean",
"description": "Included Archived, example: false",
"name": "included-archived",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
2019-07-07 12:52:55 -08:00
"type": "array",
"items": {
"$ref": "#/definitions/user.UserResponse"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
},
2019-07-07 12:52:55 -08:00
"post": {
"security": [
{
"OAuth2Password": []
}
],
2019-07-07 12:52:55 -08:00
"description": "Create inserts a new user into the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
2019-07-07 12:52:55 -08:00
"summary": "Create new user.",
"parameters": [
{
2019-07-07 12:52:55 -08:00
"description": "User details",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/user.UserCreateRequest"
}
}
],
"responses": {
2019-07-07 12:52:55 -08:00
"201": {
"description": "Created",
"schema": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/user.UserResponse"
}
},
2019-07-07 12:52:55 -08:00
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
2019-07-07 12:52:55 -08:00
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
2019-07-07 12:52:55 -08:00
},
"patch": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Update updates the specified user in the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Update user by ID",
"parameters": [
{
"description": "Update fields",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/user.UserUpdateRequest"
}
}
],
"responses": {
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
"/users/archive": {
"patch": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Archive soft-deletes the specified user from the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Archive user by ID",
"parameters": [
{
"description": "Update fields",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/user.UserArchiveRequest"
}
}
],
"responses": {
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
"/users/password": {
"patch": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Update updates the password for a specified user in the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Update user password by ID",
"parameters": [
{
"description": "Update fields",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/user.UserUpdatePasswordRequest"
}
}
],
"responses": {
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
"/users/switch-account/{account_id}": {
"patch": {
"security": [
{
"OAuth2Password": []
}
],
"description": "SwitchAccount updates the auth claims to a new account.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Switch account.",
"parameters": [
{
"type": "integer",
"description": "Account ID",
"name": "account_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
},
"/users/{id}": {
"get": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Read returns the specified user from the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Get user by ID",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/user.UserResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
},
"delete": {
"security": [
{
"OAuth2Password": []
}
],
"description": "Delete removes the specified user from the system.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Delete user by ID",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"$ref": "#/definitions/web.ErrorResponse"
}
}
}
}
}
},
"definitions": {
"account.AccountResponse": {
"type": "object",
"properties": {
"address1": {
"type": "string",
"example": "221 Tatitlek Ave"
},
"address2": {
"type": "string",
"example": "Box #1832"
},
"archived_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"billing_user_id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
},
"city": {
"type": "string",
"example": "Valdez"
},
"country": {
"type": "string",
"example": "USA"
},
"created_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"id": {
"type": "string",
"example": "c4653bf9-5978-48b7-89c5-95704aebb7e2"
},
"name": {
"type": "string",
"example": "Company Name"
},
"region": {
"type": "string",
"example": "AK"
},
"signup_user_id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
},
"status": {
"type": "object",
"$ref": "#/definitions/web.EnumResponse"
},
"timezone": {
"type": "string",
"example": "America/Anchorage"
},
"updated_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"zipcode": {
"type": "string",
"example": "99686"
}
}
},
"account.AccountUpdateRequest": {
"type": "object",
"required": [
"id"
],
"properties": {
"address1": {
"type": "string",
"example": "221 Tatitlek Ave"
2019-06-24 22:41:21 -08:00
},
"address2": {
"type": "string",
"example": "Box #1832"
},
"billing_user_id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
},
"city": {
"type": "string",
"example": "Valdez"
},
"country": {
"type": "string",
"example": "USA"
2019-06-24 22:41:21 -08:00
},
"id": {
"type": "string",
"example": "c4653bf9-5978-48b7-89c5-95704aebb7e2"
2019-06-24 22:41:21 -08:00
},
"name": {
"type": "string",
"example": "Company Name"
2019-06-24 22:41:21 -08:00
},
"region": {
"type": "string",
"example": "AK"
2019-06-24 22:41:21 -08:00
},
"signup_user_id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
2019-06-24 22:41:21 -08:00
},
"status": {
"type": "string",
"enum": [
"active",
"pending",
"disabled"
],
"example": "disabled"
2019-06-24 22:41:21 -08:00
},
"timezone": {
"type": "string",
"example": "America/Anchorage"
2019-06-24 22:41:21 -08:00
},
"zipcode": {
"type": "string",
"example": "99686"
}
}
},
"project.ProjectArchiveRequest": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"example": "985f1746-1d9f-459f-a2d9-fc53ece5ae86"
}
}
},
"project.ProjectCreateRequest": {
"type": "object",
"required": [
"account_id",
"name"
],
"properties": {
"account_id": {
"type": "string",
"example": "c4653bf9-5978-48b7-89c5-95704aebb7e2"
},
"name": {
"type": "string",
"example": "Rocket Launch"
},
"status": {
"type": "string",
"enum": [
"active",
"disabled"
],
"example": "active"
}
}
},
"project.ProjectResponse": {
"type": "object",
"required": [
"account_id",
"id",
"name"
],
"properties": {
"account_id": {
"type": "string",
"example": "c4653bf9-5978-48b7-89c5-95704aebb7e2"
},
"archived_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"created_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"id": {
"type": "string",
"example": "985f1746-1d9f-459f-a2d9-fc53ece5ae86"
},
"name": {
"type": "string",
"example": "Rocket Launch"
},
"status": {
"type": "object",
"$ref": "#/definitions/web.EnumResponse"
},
"updated_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
}
}
},
"project.ProjectUpdateRequest": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"example": "985f1746-1d9f-459f-a2d9-fc53ece5ae86"
},
"name": {
"type": "string",
"example": "Rocket Launch to Moon"
},
"status": {
"type": "string",
"enum": [
"active",
"disabled"
],
"example": "disabled"
}
}
},
2019-07-07 12:52:55 -08:00
"signup.SignupAccount": {
"type": "object",
"required": [
"address1",
"city",
"country",
"name",
"region",
"zipcode"
],
"properties": {
"address1": {
"type": "string",
"example": "221 Tatitlek Ave"
},
"address2": {
"type": "string",
"example": "Box #1832"
},
"city": {
"type": "string",
"example": "Valdez"
},
"country": {
"type": "string",
"example": "USA"
},
"name": {
"type": "string",
"example": "Company {RANDOM_UUID}"
},
"region": {
"type": "string",
"example": "AK"
},
"timezone": {
"type": "string",
"example": "America/Anchorage"
},
"zipcode": {
"type": "string",
"example": "99686"
}
}
},
"signup.SignupRequest": {
"type": "object",
"properties": {
"account": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/signup.SignupAccount"
},
"user": {
"type": "object",
2019-07-07 12:52:55 -08:00
"$ref": "#/definitions/signup.SignupUser"
}
}
},
"signup.SignupResponse": {
"type": "object",
"properties": {
"account": {
2019-07-07 12:52:55 -08:00
"type": "object",
"$ref": "#/definitions/account.AccountResponse"
},
"user": {
2019-07-07 12:52:55 -08:00
"type": "object",
"$ref": "#/definitions/user.UserResponse"
}
}
},
2019-07-07 12:52:55 -08:00
"signup.SignupUser": {
"type": "object",
2019-07-07 12:52:55 -08:00
"required": [
"email",
"name",
"password"
],
"properties": {
2019-07-07 12:52:55 -08:00
"email": {
"type": "string",
"example": "{RANDOM_EMAIL}"
},
2019-07-07 12:52:55 -08:00
"name": {
"type": "string",
"example": "Gabi May"
},
2019-07-07 12:52:55 -08:00
"password": {
"type": "string",
"example": "SecretString"
},
"password_confirm": {
"type": "string",
"example": "SecretString"
}
}
},
"user.UserArchiveRequest": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
}
}
},
"user.UserCreateRequest": {
"type": "object",
"required": [
"email",
"name",
"password"
],
"properties": {
"email": {
"type": "string",
"example": "gabi@geeksinthewoods.com"
},
"name": {
"type": "string",
"example": "Gabi May"
},
"password": {
"type": "string",
"example": "SecretString"
},
"password_confirm": {
"type": "string",
"example": "SecretString"
},
"timezone": {
"type": "string",
"example": "America/Anchorage"
}
}
},
"user.UserResponse": {
"type": "object",
"properties": {
"archived_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"created_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"email": {
"type": "string",
"example": "gabi@geeksinthewoods.com"
},
"id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
},
"name": {
"type": "string",
"example": "Gabi May"
},
"timezone": {
"type": "string",
"example": "America/Anchorage"
},
"updated_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
}
}
},
"user.UserUpdatePasswordRequest": {
"type": "object",
"required": [
"id",
"password"
],
"properties": {
"id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
},
"password": {
"type": "string",
"example": "NeverTellSecret"
},
"password_confirm": {
"type": "string",
"example": "NeverTellSecret"
}
}
},
"user.UserUpdateRequest": {
"type": "object",
"required": [
"id"
],
"properties": {
"email": {
"type": "string",
"example": "gabi.may@geeksinthewoods.com"
},
"id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
},
"name": {
"type": "string",
"example": "Gabi May Not"
},
"timezone": {
"type": "string",
"example": "America/Anchorage"
}
}
},
2019-07-07 12:52:55 -08:00
"user_account.UserAccountArchiveRequest": {
"type": "object",
"required": [
"account_id",
"user_id"
],
"properties": {
"account_id": {
"type": "string",
"example": "c4653bf9-5978-48b7-89c5-95704aebb7e2"
},
"user_id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
}
}
},
"user_account.UserAccountCreateRequest": {
"type": "object",
"required": [
"account_id",
"roles",
"user_id"
],
"properties": {
"account_id": {
"type": "string",
"example": "c4653bf9-5978-48b7-89c5-95704aebb7e2"
},
"roles": {
"type": "array",
"items": {
"type": "string",
"enum": [
"admin",
"user"
]
},
"example": [
"admin"
]
},
"status": {
"type": "string",
"enum": [
"active",
"invited",
"disabled"
],
"example": "active"
},
"user_id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
}
}
},
"user_account.UserAccountResponse": {
"type": "object",
"required": [
"roles"
],
"properties": {
"account_id": {
"type": "string",
"example": "c4653bf9-5978-48b7-89c5-95704aebb7e2"
},
"archived_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"created_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
},
"roles": {
"type": "array",
"items": {
"type": "string",
"enum": [
"admin",
"user"
]
},
"example": [
"admin"
]
},
"status": {
"type": "object",
"$ref": "#/definitions/web.EnumResponse"
},
"updated_at": {
"type": "object",
"$ref": "#/definitions/web.TimeResponse"
},
"user_id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
}
}
},
"user_account.UserAccountUpdateRequest": {
"type": "object",
"required": [
"account_id",
"user_id"
],
"properties": {
"account_id": {
"type": "string",
"example": "c4653bf9-5978-48b7-89c5-95704aebb7e2"
},
"roles": {
"type": "array",
"items": {
"type": "string",
"enum": [
"admin",
"user"
]
},
"example": [
"user"
]
},
"status": {
"type": "string",
"enum": [
"active",
"invited",
"disabled"
],
"example": "disabled"
},
"user_id": {
"type": "string",
"example": "d69bdef7-173f-4d29-b52c-3edc60baf6a2"
}
}
},
"web.EnumOption": {
"type": "object",
"properties": {
"selected": {
"type": "boolean",
"example": true
},
"title": {
"type": "string",
"example": "Active Etc"
},
"value": {
"type": "string",
"example": "active_etc"
}
}
},
"web.EnumResponse": {
"type": "object",
"properties": {
"options": {
"type": "array",
"items": {
"$ref": "#/definitions/web.EnumOption"
}
},
"title": {
"type": "string",
"example": "Active Etc"
},
"value": {
"type": "string",
"example": "active_etc"
2019-06-24 22:41:21 -08:00
}
}
},
"web.ErrorResponse": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/definitions/web.FieldError"
}
}
}
},
"web.FieldError": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"field": {
"type": "string"
}
}
},
"web.TimeResponse": {
"type": "object",
"properties": {
"date": {
"type": "string",
"example": "2019-06-25"
},
"kitchen": {
"type": "string",
"example": "3:00AM"
},
"local": {
"type": "string",
"example": "Tue Jun 25 3:00AM"
},
"local_date": {
"type": "string",
"example": "Tue Jun 25"
},
"now_rel_time": {
"type": "string",
"example": "15 hours from now"
},
"now_time": {
"type": "string",
"example": "5 hours ago"
},
"rfc1123": {
"type": "string",
"example": "Tue, 25 Jun 2019 03:00:53 AKDT"
},
"time": {
"type": "string",
"example": "03:00:53"
},
"timezone": {
"type": "string",
"example": "America/Anchorage"
},
"value": {
"type": "string",
"example": "2019-06-25T03:00:53.284-08:00"
},
"value_utc": {
"type": "string",
"example": "2019-06-25T11:00:53.284Z"
}
}
2019-06-24 22:41:21 -08:00
}
},
"securityDefinitions": {
"BasicAuth": {
"type": "basic"
},
"OAuth2Password": {
"type": "oauth2",
"flow": "password",
"tokenUrl": "/v1/oauth/token",
"scopes": {
"admin": " Grants administrative privileges with role of admin.",
"user": " Grants basic privileges with role of user."
}
}
}
}`
type swaggerInfo struct {
Version string
Host string
BasePath string
Title string
Description string
}
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo swaggerInfo
type s struct{}
func (s *s) ReadDoc() string {
t, err := template.New("swagger_info").Parse(doc)
if err != nil {
return doc
}
var tpl bytes.Buffer
if err := t.Execute(&tpl, SwaggerInfo); err != nil {
return doc
}
return tpl.String()
}
func init() {
swag.Register(swag.Name, &s{})
}