Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.
REST client for the SipTrunks service.
Service for managing SipTrunks.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the SipTrunks Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all SipTrunks clients ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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::SipTrunkCreates a SipTrunk for a specified location.
def create_sip_trunk(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunkcreate_sip_trunk via a request object, either of type
CreateSipTrunkRequest or an equivalent Hash.
- 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::SipTrunkcreate_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).
-
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.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::V2::SipTrunk)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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::EmptyDeletes a specified SipTrunk.
def delete_sip_trunk(request, options = nil) -> ::Google::Protobuf::Emptydelete_sip_trunk via a request object, either of type
DeleteSipTrunkRequest or an equivalent Hash.
- 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::Emptydelete_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).
-
name (::String) — Required. The name of the SIP trunk to delete.
Format:
projects/<Project ID>/locations/<Location ID>/sipTrunks/<SipTrunk ID>.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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::SipTrunkRetrieves the specified SipTrunk.
def get_sip_trunk(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunkget_sip_trunk via a request object, either of type
GetSipTrunkRequest or an equivalent Hash.
- 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::SipTrunkget_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).
-
name (::String) — Required. The name of the SIP trunk to delete.
Format:
projects/<Project ID>/locations/<Location ID>/sipTrunks/<SipTrunk ID>.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::V2::SipTrunk)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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| ... } -> ClientCreate a new SipTrunks REST client object.
- (config) — Configure the SipTrunks client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| config.timeout = 10.0 end
#list_sip_trunks
def list_sip_trunks(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>
def list_sip_trunks(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>Returns a list of SipTrunks in the specified location.
def list_sip_trunks(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>list_sip_trunks via a request object, either of type
ListSipTrunksRequest or an equivalent Hash.
- 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::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>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).
-
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.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (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::SipTrunkUpdates the specified SipTrunk.
def update_sip_trunk(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::SipTrunkupdate_sip_trunk via a request object, either of type
UpdateSipTrunkRequest or an equivalent Hash.
- 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::SipTrunkupdate_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).
- sip_trunk (::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash) — Required. The SipTrunk to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. The mask to control which fields get updated. If the mask is not present, all fields will be updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Dialogflow::V2::SipTrunk)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
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::Rest::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