次の方法で共有


EventGridPublisherClient class

Event Grid サービスにイベントを発行するためのクライアント クラス。

コンストラクター

EventGridPublisherClient<T>(string, T, KeyCredential | SASCredential | TokenCredential, CommonClientOptions)

Event Grid スキーマを使用してイベントを送信する EventGridPublisherClient のインスタンスを作成します。

使用例:

import { EventGridPublisherClient, AzureKeyCredential } from "@azure/eventgrid";

const client = new EventGridPublisherClient(
   "<service endpoint>",
   "EventGrid",
   new AzureKeyCredential("<api key>")
);

プロパティ

apiVersion

Even Grid サービスのバージョン。

endpointUrl

Event Grid エンドポイントの URL。

メソッド

send(InputSchemaToInputTypeMap[T][], InputSchemaToOptionsTypeMap[T])

トピックにイベントを送信します。

コンストラクターの詳細

EventGridPublisherClient<T>(string, T, KeyCredential | SASCredential | TokenCredential, CommonClientOptions)

Event Grid スキーマを使用してイベントを送信する EventGridPublisherClient のインスタンスを作成します。

使用例:

import { EventGridPublisherClient, AzureKeyCredential } from "@azure/eventgrid";

const client = new EventGridPublisherClient(
   "<service endpoint>",
   "EventGrid",
   new AzureKeyCredential("<api key>")
);
new EventGridPublisherClient(endpointUrl: string, inputSchema: T, credential: KeyCredential | SASCredential | TokenCredential, options?: CommonClientOptions)

パラメーター

endpointUrl

string

Event Grid エンドポイントの URL (例: https://eg-topic.westus2-1.eventgrid.azure.net/api/events)。

inputSchema

T

Event Grid エンドポイントが受け入れるように構成されているスキーマ。 "EventGrid"、"CloudEvent"、または "Custom" のいずれか。

credential

KeyCredential | SASCredential | TokenCredential

サービスへの要求を認証するために使用されます。

options
CommonClientOptions

Event Grid クライアントを構成するために使用します。

プロパティの詳細

apiVersion

Even Grid サービスのバージョン。

apiVersion: string

プロパティ値

string

endpointUrl

Event Grid エンドポイントの URL。

endpointUrl: string

プロパティ値

string

メソッドの詳細

send(InputSchemaToInputTypeMap[T][], InputSchemaToOptionsTypeMap[T])

トピックにイベントを送信します。

function send(events: InputSchemaToInputTypeMap[T][], options?: InputSchemaToOptionsTypeMap[T]): Promise<void>

パラメーター

events

InputSchemaToInputTypeMap[T][]

送信するイベント。 イベントは、クライアントの構築時に使用されるスキーマ内に存在する必要があります。

options

InputSchemaToOptionsTypeMap[T]

基になる操作を制御するためのオプション。

戻り値

Promise<void>