{
	"swagger": "2.0",
	"info": {
		"description": "Event API",
		"version": "0.1",
		"title": "Event API",
		"termsOfService": "http://web.scalepoint.com",
		"contact": {
			"name": "Scalepoint Technologies Ltd.",
			"url": "http://web.scalepoint.com",
			"email": "info@scalepoint.com"
		}
	},
	"host": "www.scalepoint.com",
	"basePath": "/api/events",
	"tags": [
		{
			"name": "External",
			"description": "Event API for external partners"
		}
	],
	"schemes": [
		"https"
	],
	"paths": {
		"/v1/{country}/external/{tenant}/receive": {
			"get": {
				"tags": [
					"External"
				],
				"summary": "Get a batch of events",
				"description": "Will block to wait for new events if there are none available",
				"operationId": "receiveUsingGET",
				"consumes": [
					"application/json"
				],
				"produces": [
					"application/json"
				],
				"parameters": [
					{
						"name": "country",
						"in": "path",
						"description": "country",
						"required": true,
						"type": "string"
					},
					{
						"name": "tenant",
						"in": "path",
						"description": "tenant",
						"required": true,
						"type": "string"
					},
					{
						"name": "eventTypes",
						"in": "query",
						"description": "eventTypes",
						"required": false,
						"type": "array",
						"items": {
							"type": "string"
						},
						"collectionFormat": "multi"
					},
					{
						"name": "lastEventId",
						"in": "query",
						"description": "lastEventId",
						"required": false,
						"type": "string"
					}
				],
				"responses": {
					"200": {
						"description": "OK",
						"schema": {
							"$ref": "#/definitions/JsonApiResponse"
						}
					},
					"401": {
						"description": "Unauthorized"
					},
					"403": {
						"description": "Forbidden"
					},
					"404": {
						"description": "Not Found"
					}
				}
			}
		},
		"/v1/{country}/external/{tenant}/send": {
			"post": {
				"tags": [
					"External"
				],
				"summary": "External - publish events to Scalepoint Platform",
				"description": "External - Publish events to Scalepoint Platform - Customers could be IC's or Service Providers",
				"operationId": "sendUsingPOST",
				"consumes": [
					"application/json"
				],
				"produces": [
					"application/json"
				],
				"parameters": [
					{
						"name": "country",
						"in": "path",
						"description": "country",
						"required": true,
						"type": "string"
					},
					{
						"name": "tenant",
						"in": "path",
						"description": "tenant",
						"required": true,
						"type": "string"
					},
					{
						"name": "Event-Type",
						"in": "header",
						"description": "Event-Type",
						"required": true,
						"type": "string"
					},
					{
						"in": "body",
						"name": "payload",
						"description": "payload",
						"required": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"201": {
						"description": "Created",
						"schema": {
							"$ref": "#/definitions/EventCreated"
						}
					},
					"401": {
						"description": "Unauthorized"
					},
					"403": {
						"description": "Forbidden"
					},
					"404": {
						"description": "Not Found"
					}
				}
			}
		},
		"/v1/{country}/external/{tenant}/send/self": {
			"post": {
				"tags": [
					"External"
				],
				"summary": "DEBUG ONLY: Publish event to self as if it was coming from Scalepoint Platform",
				"description": "Message should be POST'ed as application/json encoded content with Event-Type and other metadata specified in HTTP headers",
				"operationId": "sendSelfUsingPOST",
				"consumes": [
					"application/json"
				],
				"produces": [
					"application/json"
				],
				"parameters": [
					{
						"name": "country",
						"in": "path",
						"description": "country",
						"required": true,
						"type": "string"
					},
					{
						"name": "tenant",
						"in": "path",
						"description": "tenant",
						"required": true,
						"type": "string"
					},
					{
						"name": "Event-Type",
						"in": "header",
						"description": "Event-Type",
						"required": true,
						"type": "string"
					},
					{
						"in": "body",
						"name": "payload",
						"description": "payload",
						"required": true,
						"schema": {
							"type": "string"
						}
					}
				],
				"responses": {
					"201": {
						"description": "Created",
						"schema": {
							"$ref": "#/definitions/EventCreated"
						}
					},
					"401": {
						"description": "Unauthorized"
					},
					"403": {
						"description": "Forbidden"
					},
					"404": {
						"description": "Not Found"
					}
				}
			}
		}
	},
	"definitions": {
		"EventCreated": {
			"type": "object",
			"properties": {
				"id": {
					"type": "string"
				}
			}
		},
		"JsonApiResponse": {
			"type": "object",
			"properties": {
				"data": {
					"type": "object"
				},
				"links": {
					"type": "object",
					"additionalProperties": {
						"type": "string"
					}
				},
				"meta": {
					"type": "object",
					"additionalProperties": {
						"type": "string"
					}
				}
			}
		},
		"CompletableFuture«ResponseEntity«JsonApiResponse»»": {
			"type": "object",
			"properties": {
				"cancelled": {
					"type": "boolean"
				},
				"completedExceptionally": {
					"type": "boolean"
				},
				"done": {
					"type": "boolean"
				},
				"numberOfDependents": {
					"type": "integer",
					"format": "int32"
				}
			}
		}
	}
}