Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::Webhooks::Client (v0.10.1)

Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.

Client for the Webhooks service.

Service for managing Webhooks.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the Webhooks Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all Webhooks clients
::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the Webhooks Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_webhook

def create_webhook(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook
def create_webhook(parent: nil, webhook: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook

Creates a webhook in the specified agent.

Overloads
def create_webhook(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook
Pass arguments to create_webhook via a request object, either of type CreateWebhookRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_webhook(parent: nil, webhook: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook
Pass arguments to create_webhook via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The agent to create a webhook for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
  • webhook (::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash) — Required. The webhook to create.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new

# Call the create_webhook method.
result = client.create_webhook request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook.
p result

#delete_webhook

def delete_webhook(request, options = nil) -> ::Google::Protobuf::Empty
def delete_webhook(name: nil, force: nil) -> ::Google::Protobuf::Empty

Deletes the specified webhook.

Overloads
def delete_webhook(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_webhook via a request object, either of type DeleteWebhookRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_webhook(name: nil, force: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_webhook via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The name of the webhook to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>.
  • force (::Boolean) —

    This field has no effect for webhook not being used. For webhooks that are used by pages/flows/transition route groups:

    • If force is set to false, an error will be returned with message indicating the referenced resources.
    • If force is set to true, Dialogflow will remove the webhook, as well as any references to the webhook (i.e. Webhook and tagin fulfillments that point to this webhook will be removed).
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new

# Call the delete_webhook method.
result = client.delete_webhook request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_webhook

def get_webhook(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook
def get_webhook(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook

Retrieves the specified webhook.

Overloads
def get_webhook(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook
Pass arguments to get_webhook via a request object, either of type GetWebhookRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_webhook(name: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook
Pass arguments to get_webhook via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the webhook. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new

# Call the get_webhook method.
result = client.get_webhook request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new Webhooks client object.

Yields
  • (config) — Configure the Webhooks client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config|
  config.timeout = 10.0
end

#list_webhooks

def list_webhooks(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>
def list_webhooks(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>

Returns the list of all webhooks in the specified agent.

Overloads
def list_webhooks(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>
Pass arguments to list_webhooks via a request object, either of type ListWebhooksRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_webhooks(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>
Pass arguments to list_webhooks via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The agent to list all webhooks for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
  • page_size (::Integer) — The maximum number of items to return in a single page. By default 100 and at most 1000.
  • page_token (::String) — The next_page_token value returned from a previous list request.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new

# Call the list_webhooks method.
result = client.list_webhooks request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Webhook.
  p response
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#update_webhook

def update_webhook(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook
def update_webhook(webhook: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook

Updates the specified webhook.

Overloads
def update_webhook(request, options = nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook
Pass arguments to update_webhook via a request object, either of type UpdateWebhookRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_webhook(webhook: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::CX::V3::Webhook
Pass arguments to update_webhook via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dialogflow/cx/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new

# Call the update_webhook method.
result = client.update_webhook request

# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook.
p result