{ "swagger": "2.0", "info": { "title": "Azure.Messaging.EventGridClient", "version": "2023-11-01", "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", "description": "The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net", "required": true, "type": "string", "format": "uri", "x-ms-skip-url-encoding": true } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "OAuth2Auth": [ "https://eventgrid.azure.net/.default" ] } ], "securityDefinitions": { "OAuth2Auth": { "type": "oauth2", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "https://eventgrid.azure.net/.default": "" } } }, "tags": [], "paths": { "/topics/{topicName}:publish": { "post": { "operationId": "PublishCloudEvent", "description": "Publish a single Cloud Event to a namespace topic.", "consumes": [ "application/cloudevents+json; charset=utf-8" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "description": "Topic Name.", "required": true, "type": "string" }, { "name": "event", "in": "body", "description": "Single Cloud Event being published.", "required": true, "schema": { "$ref": "#/definitions/CloudEvent" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/PublishResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } } } }, "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive": { "post": { "operationId": "ReceiveCloudEvents", "description": "Receive a batch of Cloud Events from a subscription.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "description": "Topic Name.", "required": true, "type": "string" }, { "name": "eventSubscriptionName", "in": "path", "description": "Event Subscription Name.", "required": true, "type": "string" }, { "name": "maxEvents", "in": "query", "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.", "required": false, "type": "integer", "format": "int32", "default": 1, "minimum": 1, "maximum": 100 }, { "name": "maxWaitTime", "in": "query", "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.", "required": false, "type": "integer", "format": "int32" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ReceiveResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Receive Cloud Event": { "$ref": "./examples/receive.json" } } } }, "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge": { "post": { "operationId": "AcknowledgeCloudEvents", "description": "Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "description": "Topic Name.", "required": true, "type": "string" }, { "name": "eventSubscriptionName", "in": "path", "description": "Event Subscription Name.", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "lockTokens": { "type": "array", "description": "Array of lock tokens.", "items": { "type": "string" } } }, "required": [ "lockTokens" ] } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AcknowledgeResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Acknowledge Cloud Event": { "$ref": "./examples/ack.json" } } } }, "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release": { "post": { "operationId": "ReleaseCloudEvents", "description": "Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "description": "Topic Name.", "required": true, "type": "string" }, { "name": "eventSubscriptionName", "in": "path", "description": "Event Subscription Name.", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "lockTokens": { "type": "array", "description": "Array of lock tokens.", "items": { "type": "string" } } }, "required": [ "lockTokens" ] } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ReleaseResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Release Cloud Event": { "$ref": "./examples/release.json" } } } }, "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject": { "post": { "operationId": "RejectCloudEvents", "description": "Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "description": "Topic Name.", "required": true, "type": "string" }, { "name": "eventSubscriptionName", "in": "path", "description": "Event Subscription Name.", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "lockTokens": { "type": "array", "description": "Array of lock tokens.", "items": { "type": "string" } } }, "required": [ "lockTokens" ] } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/RejectResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Reject Cloud Event": { "$ref": "./examples/reject.json" } } } } }, "x-ms-paths": { "/topics/{topicName}:publish?_overload=publishCloudEvents": { "post": { "operationId": "PublishCloudEvents", "description": "Publish a batch of Cloud Events to a namespace topic.", "consumes": [ "application/cloudevents-batch+json; charset=utf-8" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "topicName", "in": "path", "description": "Topic Name.", "required": true, "type": "string" }, { "name": "events", "in": "body", "description": "Array of Cloud Events being published.", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/CloudEvent" } } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/PublishResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Publish Cloud Event": { "$ref": "./examples/publish.json" } } } } }, "definitions": { "AcknowledgeResult": { "type": "object", "description": "The result of the Acknowledge operation.", "properties": { "failedLockTokens": { "type": "array", "description": "Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description).", "items": { "$ref": "#/definitions/FailedLockToken" }, "readOnly": true }, "succeededLockTokens": { "type": "array", "description": "Array of lock tokens for the successfully acknowledged cloud events.", "items": { "type": "string" }, "readOnly": true } }, "required": [ "failedLockTokens", "succeededLockTokens" ] }, "Azure.Core.Foundations.Error": { "type": "object", "description": "The error 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", "description": "An array of details about specific errors that led to this reported error.", "items": { "$ref": "#/definitions/Azure.Core.Foundations.Error" } }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "An object containing more specific information than the current object about the error." } }, "required": [ "code", "message" ] }, "Azure.Core.Foundations.ErrorResponse": { "type": "object", "description": "A response containing error details.", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "The error object." } }, "required": [ "error" ] }, "Azure.Core.Foundations.InnerError": { "type": "object", "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "Inner error." } } }, "BrokerProperties": { "type": "object", "description": "Properties of the Event Broker operation.", "properties": { "lockToken": { "type": "string", "description": "The token of the lock on the event." }, "deliveryCount": { "type": "integer", "format": "int32", "description": "The attempt count for delivering the event." } }, "required": [ "lockToken", "deliveryCount" ] }, "CloudEvent": { "type": "object", "description": "Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema.", "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)." } }, "required": [ "id", "source", "type", "specversion" ] }, "FailedLockToken": { "type": "object", "description": "Failed LockToken information.", "properties": { "lockToken": { "type": "string", "description": "The lock token of an entry in the request." }, "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "Error information of the failed operation result for the lock token in the request." } }, "required": [ "lockToken", "error" ] }, "PublishResult": { "type": "object", "description": "The result of the Publish operation." }, "ReceiveDetails": { "type": "object", "description": "Receive operation details per Cloud Event.", "properties": { "brokerProperties": { "$ref": "#/definitions/BrokerProperties", "description": "The Event Broker details." }, "event": { "$ref": "#/definitions/CloudEvent", "description": "Cloud Event details." } }, "required": [ "brokerProperties", "event" ] }, "ReceiveResult": { "type": "object", "description": "Details of the Receive operation response.", "properties": { "value": { "type": "array", "description": "Array of receive responses, one per cloud event.", "items": { "$ref": "#/definitions/ReceiveDetails" }, "readOnly": true } }, "required": [ "value" ] }, "RejectResult": { "type": "object", "description": "The result of the Reject operation.", "properties": { "failedLockTokens": { "type": "array", "description": "Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description).", "items": { "$ref": "#/definitions/FailedLockToken" }, "readOnly": true }, "succeededLockTokens": { "type": "array", "description": "Array of lock tokens for the successfully rejected cloud events.", "items": { "type": "string" }, "readOnly": true } }, "required": [ "failedLockTokens", "succeededLockTokens" ] }, "ReleaseResult": { "type": "object", "description": "The result of the Release operation.", "properties": { "failedLockTokens": { "type": "array", "description": "Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description).", "items": { "$ref": "#/definitions/FailedLockToken" }, "readOnly": true }, "succeededLockTokens": { "type": "array", "description": "Array of lock tokens for the successfully released cloud events.", "items": { "type": "string" }, "readOnly": true } }, "required": [ "failedLockTokens", "succeededLockTokens" ] } }, "parameters": { "Azure.Core.Foundations.ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for this operation.", "required": true, "type": "string", "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" } } }