{ "swagger": "2.0", "info": { "title": "Azure.Messaging.EventGridClient", "version": "2023-06-01-preview", "description": "Azure Messaging EventGrid Client", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "x-ms-parameterized-host": { "hostTemplate": "{endpoint}", "useSchemePrefix": false, "parameters": [ { "name": "endpoint", "in": "path", "required": true, "description": "The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net", "type": "string", "format": "uri", "x-ms-skip-url-encoding": true } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "ApiKeyAuth": [] } ], "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "SharedAccessKey" } }, "tags": [], "paths": { "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive": { "post": { "operationId": "ReceiveCloudEvents", "description": "Receive Batch of Cloud Events from the Event Subscription.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "required": true, "description": "Topic Name.", "type": "string" }, { "name": "eventSubscriptionName", "in": "path", "required": true, "description": "Event Subscription Name.", "type": "string" }, { "name": "maxEvents", "in": "query", "required": false, "description": "Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1.", "default": 1, "type": "integer", "format": "int32" }, { "name": "maxWaitTime", "in": "query", "required": false, "description": "Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.", "type": "integer", "format": "int32" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ReceiveResult" } }, "default": { "description": "An unexpected error response.", "headers": { "x-ms-error-code": { "description": "String error code indicating what went wrong.", "type": "string" } }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } } } } }, "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge": { "post": { "operationId": "AcknowledgeCloudEvents", "description": "Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully acknowledged. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "required": true, "description": "Topic Name.", "type": "string" }, { "name": "eventSubscriptionName", "in": "path", "required": true, "description": "Event Subscription Name.", "type": "string" }, { "name": "lockTokens", "in": "body", "required": true, "description": "AcknowledgeOptions.", "schema": { "$ref": "#/definitions/AcknowledgeOptions" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AcknowledgeResult" } }, "default": { "description": "An unexpected error response.", "headers": { "x-ms-error-code": { "description": "String error code indicating what went wrong.", "type": "string" } }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } } }, "consumes": [ "application/json; charset=utf-8" ] } }, "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release": { "post": { "operationId": "ReleaseCloudEvents", "description": "Release batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully released. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "required": true, "description": "Topic Name.", "type": "string" }, { "name": "eventSubscriptionName", "in": "path", "required": true, "description": "Event Subscription Name.", "type": "string" }, { "name": "lockTokens", "in": "body", "required": true, "description": "ReleaseOptions", "schema": { "$ref": "#/definitions/ReleaseOptions" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ReleaseResult" } }, "default": { "description": "An unexpected error response.", "headers": { "x-ms-error-code": { "description": "String error code indicating what went wrong.", "type": "string" } }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } } }, "consumes": [ "application/json; charset=utf-8" ] } }, "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject": { "post": { "operationId": "RejectCloudEvents", "description": "Reject batch of Cloud Events.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "required": true, "description": "Topic Name.", "type": "string" }, { "name": "eventSubscriptionName", "in": "path", "required": true, "description": "Event Subscription Name.", "type": "string" }, { "name": "lockTokens", "in": "body", "required": true, "description": "RejectOptions", "schema": { "$ref": "#/definitions/RejectOptions" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/RejectResult" } }, "default": { "description": "An unexpected error response.", "headers": { "x-ms-error-code": { "description": "String error code indicating what went wrong.", "type": "string" } }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } } }, "consumes": [ "application/json; charset=utf-8" ] } } }, "x-ms-paths": { "/topics/{topicName}:publish?api-version={apiVersion}": { "post": { "operationId": "PublishCloudEvents", "description": "Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. ", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "required": true, "description": "Topic Name.", "type": "string" }, { "name": "events", "in": "body", "required": true, "description": "Array of Cloud Events being published.", "schema": { "type": "array", "items": { "$ref": "#/definitions/CloudEvent" }, "x-typespec-name": "CloudEvent[]" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/PublishResult" } }, "default": { "description": "An unexpected error response.", "headers": { "x-ms-error-code": { "description": "String error code indicating what went wrong.", "type": "string" } }, "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } } }, "consumes": [ "application/cloudevents-batch+json; charset=utf-8" ] } } }, "definitions": { "AcknowledgeOptions": { "type": "object", "properties": { "lockTokens": { "type": "array", "items": { "type": "string" }, "x-typespec-name": "string[]", "description": "String array of lock tokens." } }, "description": "Array of lock token strings for the corresponding received Cloud Events to be acknowledged.", "required": [ "lockTokens" ] }, "AcknowledgeResult": { "type": "object", "properties": { "failedLockTokens": { "type": "array", "items": { "$ref": "#/definitions/FailedLockToken" }, "x-ms-identifiers": [], "x-typespec-name": "FailedLockToken[]", "description": "Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description)." }, "succeededLockTokens": { "type": "array", "items": { "type": "string" }, "x-typespec-name": "string[]", "description": "Array of lock tokens values for the successfully acknowledged cloud events." } }, "description": "The result of the Acknowledge operation.", "required": [ "failedLockTokens", "succeededLockTokens" ] }, "Azure.Core.Foundations.Error": { "type": "object", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error." }, "details": { "type": "array", "items": { "$ref": "#/definitions/Azure.Core.Foundations.Error" }, "x-ms-identifiers": [], "x-typespec-name": "Azure.Core.Foundations.Error[]", "description": "An array of details about specific errors that led to this reported error." }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "An object containing more specific information than the current object about the error." } }, "description": "The error object.", "required": [ "code", "message", "details" ] }, "Azure.Core.Foundations.ErrorResponse": { "type": "object", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "The error object." } }, "description": "A response containing error details.", "required": [ "error" ] }, "Azure.Core.Foundations.InnerError": { "type": "object", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "Inner error." } }, "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", "required": [ "code" ] }, "BrokerProperties": { "type": "object", "properties": { "lockToken": { "type": "string", "description": "The token used to lock the event." }, "deliveryCount": { "type": "integer", "format": "int32", "description": "The attempt count for delivering the event." } }, "description": "Properties of the Event Broker operation.", "required": [ "lockToken", "deliveryCount" ] }, "CloudEvent": { "type": "object", "properties": { "id": { "type": "string", "description": "An identifier for the event. The combination of id and source must be unique for each distinct event." }, "source": { "type": "string", "description": "Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event." }, "data": { "description": "Event data specific to the event type." }, "data_base64": { "type": "string", "format": "byte", "description": "Event data specific to the event type, encoded as a base64 string." }, "type": { "type": "string", "description": "Type of event related to the originating occurrence." }, "time": { "type": "string", "format": "date-time", "description": "The time (in UTC) the event was generated, in RFC3339 format." }, "specversion": { "type": "string", "description": "The version of the CloudEvents specification which the event uses." }, "dataschema": { "type": "string", "description": "Identifies the schema that data adheres to." }, "datacontenttype": { "type": "string", "description": "Content type of data value." }, "subject": { "type": "string", "description": "This describes the subject of the event in the context of the event producer (identified by source)." } }, "description": "Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema.", "required": [ "id", "source", "type", "specversion" ] }, "FailedLockToken": { "type": "object", "properties": { "lockToken": { "type": "string", "description": "LockToken value" }, "errorCode": { "type": "string", "description": "Error code related to the token. Example of such error codes are BadToken: which indicates the Token is not formatted correctly, TokenLost: which indicates that token is not found, and InternalServerError: For any internal server errors." }, "errorDescription": { "type": "string", "description": "Description of the token error." } }, "description": "Failed LockToken information.", "required": [ "lockToken", "errorCode", "errorDescription" ] }, "PublishResult": { "type": "object", "properties": {}, "description": "The result of the Publish operation." }, "ReceiveDetails": { "type": "object", "properties": { "brokerProperties": { "$ref": "#/definitions/BrokerProperties", "description": "The Event Broker details." }, "event": { "$ref": "#/definitions/CloudEvent", "description": "Cloud Event details." } }, "description": "Receive operation details per Cloud Event.", "required": [ "brokerProperties", "event" ] }, "ReceiveResult": { "type": "object", "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ReceiveDetails" }, "x-ms-identifiers": [], "x-typespec-name": "ReceiveDetails[]", "description": "Array of receive responses, one per cloud event." } }, "description": "Details of the Receive operation response.", "required": [ "value" ] }, "RejectOptions": { "type": "object", "properties": { "lockTokens": { "type": "array", "items": { "type": "string" }, "x-typespec-name": "string[]", "description": "String array of lock tokens." } }, "description": "Array of lock token strings for the corresponding received Cloud Events to be rejected.", "required": [ "lockTokens" ] }, "RejectResult": { "type": "object", "properties": { "failedLockTokens": { "type": "array", "items": { "$ref": "#/definitions/FailedLockToken" }, "x-ms-identifiers": [], "x-typespec-name": "FailedLockToken[]", "description": "Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description)." }, "succeededLockTokens": { "type": "array", "items": { "type": "string" }, "x-typespec-name": "string[]", "description": "Array of lock tokens values for the successfully rejected cloud events." } }, "description": "The result of the Reject operation.", "required": [ "failedLockTokens", "succeededLockTokens" ] }, "ReleaseOptions": { "type": "object", "properties": { "lockTokens": { "type": "array", "items": { "type": "string" }, "x-typespec-name": "string[]", "description": "String array of lock tokens." } }, "description": "Array of lock token strings for the corresponding received Cloud Events to be released.", "required": [ "lockTokens" ] }, "ReleaseResult": { "type": "object", "properties": { "failedLockTokens": { "type": "array", "items": { "$ref": "#/definitions/FailedLockToken" }, "x-ms-identifiers": [], "x-typespec-name": "FailedLockToken[]", "description": "Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description)." }, "succeededLockTokens": { "type": "array", "items": { "type": "string" }, "x-typespec-name": "string[]", "description": "Array of lock tokens values for the successfully released cloud events." } }, "description": "The result of the Release operation.", "required": [ "failedLockTokens", "succeededLockTokens" ] } }, "parameters": { "Azure.Core.Foundations.ApiVersionParameter": { "name": "api-version", "in": "query", "required": true, "description": "The API version to use for this operation.", "x-ms-client-name": "apiVersion", "minLength": 1, "type": "string", "x-ms-parameter-location": "method" } } }