/// <summary>Snippet for CreateWebhookAsync</summary> public async Task CreateWebhookAsync() { // Snippet: CreateWebhookAsync(string, Webhook, CallSettings) // Additional: CreateWebhookAsync(string, Webhook, CancellationToken) // Create client WebhooksClient webhooksClient = await WebhooksClient.CreateAsync(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]"; Webhook webhook = new Webhook(); // Make the request Webhook response = await webhooksClient.CreateWebhookAsync(parent, webhook); // End snippet }
/// <summary>Snippet for CreateWebhookAsync</summary> public async Task CreateWebhookResourceNamesAsync() { // Snippet: CreateWebhookAsync(AgentName, Webhook, CallSettings) // Additional: CreateWebhookAsync(AgentName, Webhook, CancellationToken) // Create client WebhooksClient webhooksClient = await WebhooksClient.CreateAsync(); // Initialize request argument(s) AgentName parent = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"); Webhook webhook = new Webhook(); // Make the request Webhook response = await webhooksClient.CreateWebhookAsync(parent, webhook); // End snippet }
/// <summary>Snippet for CreateWebhookAsync</summary> public async Task CreateWebhookRequestObjectAsync() { // Snippet: CreateWebhookAsync(CreateWebhookRequest, CallSettings) // Additional: CreateWebhookAsync(CreateWebhookRequest, CancellationToken) // Create client WebhooksClient webhooksClient = await WebhooksClient.CreateAsync(); // Initialize request argument(s) CreateWebhookRequest request = new CreateWebhookRequest { ParentAsAgentName = AgentName.FromProjectLocationAgent("[PROJECT]", "[LOCATION]", "[AGENT]"), Webhook = new Webhook(), }; // Make the request Webhook response = await webhooksClient.CreateWebhookAsync(request); // End snippet }