Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::SipTrunks::Client (v1.13.0)

Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::SipTrunks::Client.

Client for the SipTrunks service.

Service for managing SipTrunks.

Inherits

  • Object

Methods

.configure

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

Configure the SipTrunks 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 SipTrunks clients
::Google::Cloud::Dialogflow::V2::SipTrunks::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the SipTrunks 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_sip_trunk

def create_sip_trunk(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk
def create_sip_trunk(parent: nil, sip_trunk: nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk

Creates a SipTrunk for a specified location.

Overloads
def create_sip_trunk(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk
Pass arguments to create_sip_trunk via a request object, either of type CreateSipTrunkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest, ::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_sip_trunk(parent: nil, sip_trunk: nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk
Pass arguments to create_sip_trunk 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 location to create a SIP trunk for. Format: projects/<Project ID>/locations/<Location ID>.
  • sip_trunk (::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash) — Required. The SIP trunk 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/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk.
p result

#delete_sip_trunk

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

Deletes a specified SipTrunk.

Overloads
def delete_sip_trunk(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_sip_trunk via a request object, either of type DeleteSipTrunkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest, ::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_sip_trunk(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_sip_trunk 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 SIP trunk to delete. Format: projects/<Project ID>/locations/<Location ID>/sipTrunks/<SipTrunk 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/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new

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

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

#get_sip_trunk

def get_sip_trunk(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk
def get_sip_trunk(name: nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk

Retrieves the specified SipTrunk.

Overloads
def get_sip_trunk(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk
Pass arguments to get_sip_trunk via a request object, either of type GetSipTrunkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest, ::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_sip_trunk(name: nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk
Pass arguments to get_sip_trunk 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 SIP trunk to delete. Format: projects/<Project ID>/locations/<Location ID>/sipTrunks/<SipTrunk 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/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk.
p result

#initialize

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

Create a new SipTrunks client object.

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

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

#list_sip_trunks

def list_sip_trunks(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>
def list_sip_trunks(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>

Returns a list of SipTrunks in the specified location.

Overloads
def list_sip_trunks(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>
Pass arguments to list_sip_trunks via a request object, either of type ListSipTrunksRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest, ::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_sip_trunks(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>
Pass arguments to list_sip_trunks 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 location to list SIP trunks from. Format: projects/<Project ID>/locations/<Location ID>.
  • page_size (::Integer) — Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
  • page_token (::String) — Optional. 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/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Dialogflow::V2::SipTrunk.
  p item
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)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_sip_trunk

def update_sip_trunk(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk
def update_sip_trunk(sip_trunk: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk

Updates the specified SipTrunk.

Overloads
def update_sip_trunk(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk
Pass arguments to update_sip_trunk via a request object, either of type UpdateSipTrunkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest, ::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_sip_trunk(sip_trunk: nil, update_mask: nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunk
Pass arguments to update_sip_trunk 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/v2"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk.
p result