{ "swagger": "2.0", "info": { "title": "github.com/hhhapz/codequest/api/v1/all.proto", "version": "version not set" }, "tags": [ { "name": "AuthService" }, { "name": "UserService" } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/v1/admin/users": { "get": { "operationId": "UserService_AllUsers", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1AllUsersResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "tags": [ "UserService" ] } }, "/v1/admin/users/{email}": { "get": { "operationId": "UserService_UserByEmail", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1User" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "email", "in": "path", "required": true, "type": "string" } ], "tags": [ "UserService" ] }, "delete": { "operationId": "UserService_DeleteUser", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1User" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "email", "in": "path", "required": true, "type": "string" } ], "tags": [ "UserService" ] }, "put": { "operationId": "UserService_AdminUpdateUser", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1User" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "email", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1UpdateFields" } } ], "tags": [ "UserService" ] } }, "/v1/auth/code": { "get": { "operationId": "AuthService_OAuthCode", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1OAuthCodeResponse" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "tags": [ "AuthService" ] } }, "/v1/auth/token": { "get": { "operationId": "AuthService_Token", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1Token" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "code", "in": "query", "required": false, "type": "string" }, { "name": "state", "in": "query", "required": false, "type": "string" } ], "tags": [ "AuthService" ] }, "delete": { "operationId": "AuthService_DeleteToken", "responses": { "200": { "description": "A successful response.", "schema": { "properties": {} } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "all", "in": "query", "required": false, "type": "boolean" }, { "name": "token.token", "in": "query", "required": false, "type": "string" }, { "name": "token.expires", "in": "query", "required": false, "type": "string", "format": "date-time" } ], "tags": [ "AuthService" ] } }, "/v1/users/me": { "get": { "operationId": "UserService_User", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1User" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "tags": [ "UserService" ] }, "put": { "operationId": "UserService_UpdateUser", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1User" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/rpcStatus" } } }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1UpdateFields" } }, { "name": "email", "in": "query", "required": false, "type": "string" } ], "tags": [ "UserService" ] } } }, "definitions": { "protobufAny": { "type": "object", "properties": { "@type": { "type": "string" } }, "additionalProperties": {} }, "rpcStatus": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" }, "details": { "type": "array", "items": { "$ref": "#/definitions/protobufAny" } } } }, "v1AllUsersResponse": { "type": "object", "properties": { "users": { "type": "array", "items": { "$ref": "#/definitions/v1User" } } } }, "v1OAuthCodeResponse": { "type": "object", "properties": { "redirect_uri": { "type": "string" } } }, "v1Token": { "type": "object", "properties": { "token": { "type": "string" }, "expires": { "type": "string", "format": "date-time" } } }, "v1UpdateFields": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" }, "grade_level": { "type": "integer", "format": "int32" }, "admin": { "type": "boolean" } } }, "v1User": { "type": "object", "properties": { "id": { "type": "string", "description": "ID of the user. Received via Google's OAuth2 API." }, "name": { "type": "string", "description": "Name of the user." }, "email": { "type": "string", "description": "Email of the user." }, "picture": { "type": "string", "description": "Picture is the URL of the user's profile picture." }, "grade_level": { "type": "integer", "format": "int32", "description": "GradeLevel of the user." }, "admin": { "type": "boolean", "description": "Admin is true if the user is an administrator." }, "created_at": { "type": "string", "format": "date-time", "description": "CreatedAt is the time the user was created." } }, "description": "User is a contestant in the competition." } } }