lib/google/cloud/dialogflow/v2/intents_client.rb in google-cloud-dialogflow-0.4.0 vs lib/google/cloud/dialogflow/v2/intents_client.rb in google-cloud-dialogflow-0.5.0
- old
+ new
@@ -64,11 +64,11 @@
# * **Training phrases** - provide examples of user input to train the
# Dialogflow API agent to better match intents.
#
# For more information about intents, see the
# [Dialogflow
- # documentation](https://cloud.google.com/dialogflow-enterprise/docs/intents-overview).
+ # documentation](https://cloud.google.com/dialogflow/docs/intents-overview).
#
# @!attribute [r] intents_stub
# @return [Google::Cloud::Dialogflow::V2::Intents::Stub]
class IntentsClient
# @private
@@ -180,19 +180,25 @@
# or the specified config is missing data points.
# @param timeout [Numeric]
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
+ # @param service_address [String]
+ # Override for the service hostname, or `nil` to leave as the default.
+ # @param service_port [Integer]
+ # Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
def initialize \
credentials: nil,
scopes: ALL_SCOPES,
client_config: {},
timeout: DEFAULT_TIMEOUT,
metadata: nil,
+ service_address: nil,
+ service_port: nil,
exception_transformer: nil,
lib_name: nil,
lib_version: ""
# These require statements are intentionally placed here to initialize
# the gRPC module only when it's required.
@@ -206,11 +212,14 @@
credentials: credentials,
scopes: scopes,
client_config: client_config,
timeout: timeout,
lib_name: lib_name,
+ service_address: service_address,
+ service_port: service_port,
lib_version: lib_version,
+ metadata: metadata,
)
if credentials.is_a?(String) || credentials.is_a?(Hash)
updater_proc = Google::Cloud::Dialogflow::V2::Credentials.new(credentials).updater_proc
end
@@ -252,12 +261,12 @@
metadata: headers
)
end
# Allow overriding the service path/port in subclasses.
- service_path = self.class::SERVICE_ADDRESS
- port = self.class::DEFAULT_SERVICE_PORT
+ service_path = service_address || self.class::SERVICE_ADDRESS
+ port = service_port || self.class::DEFAULT_SERVICE_PORT
interceptors = self.class::GRPC_INTERCEPTORS
@intents_stub = Google::Gax::Grpc.create_stub(
service_path,
port,
chan_creds: chan_creds,
@@ -335,11 +344,11 @@
# Format: `projects/<Project ID>/agent`.
# @param language_code [String]
# Optional. The language to list training phrases, parameters and rich
# messages for. If not specified, the agent's default language is used.
# [Many
- # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
+ # languages](https://cloud.google.com/dialogflow/docs/reference/language)
# are supported. Note: languages must be enabled in the agent before they can
# be used.
# @param intent_view [Google::Cloud::Dialogflow::V2::IntentView]
# Optional. The resource view to apply to the returned intent.
# @param page_size [Integer]
@@ -403,11 +412,11 @@
# Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
# @param language_code [String]
# Optional. The language to retrieve training phrases, parameters and rich
# messages for. If not specified, the agent's default language is used.
# [Many
- # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
+ # languages](https://cloud.google.com/dialogflow/docs/reference/language)
# are supported. Note: languages must be enabled in the agent before they can
# be used.
# @param intent_view [Google::Cloud::Dialogflow::V2::IntentView]
# Optional. The resource view to apply to the returned intent.
# @param options [Google::Gax::CallOptions]
@@ -451,11 +460,11 @@
# can also be provided.
# @param language_code [String]
# Optional. The language of training phrases, parameters and rich messages
# defined in `intent`. If not specified, the agent's default language is
# used. [Many
- # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
+ # languages](https://cloud.google.com/dialogflow/docs/reference/language)
# are supported. Note: languages must be enabled in the agent before they can
# be used.
# @param intent_view [Google::Cloud::Dialogflow::V2::IntentView]
# Optional. The resource view to apply to the returned intent.
# @param options [Google::Gax::CallOptions]
@@ -501,11 +510,11 @@
# can also be provided.
# @param language_code [String]
# Optional. The language of training phrases, parameters and rich messages
# defined in `intent`. If not specified, the agent's default language is
# used. [Many
- # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
+ # languages](https://cloud.google.com/dialogflow/docs/reference/language)
# are supported. Note: languages must be enabled in the agent before they can
# be used.
# @param update_mask [Google::Protobuf::FieldMask | Hash]
# Optional. The mask to control which fields get updated.
# A hash of the same form as `Google::Protobuf::FieldMask`
@@ -590,10 +599,10 @@
# Format: `projects/<Project ID>/agent`.
# @param language_code [String]
# Optional. The language of training phrases, parameters and rich messages
# defined in `intents`. If not specified, the agent's default language is
# used. [Many
- # languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
+ # languages](https://cloud.google.com/dialogflow/docs/reference/language)
# are supported. Note: languages must be enabled in the agent before they can
# be used.
# @param intent_batch_uri [String]
# The URI to a Google Cloud Storage file containing intents to update or
# create. The file format can either be a serialized proto (of IntentBatch