lib/google/cloud/dialogflow/v2/contexts_client.rb in google-cloud-dialogflow-0.4.0 vs lib/google/cloud/dialogflow/v2/contexts_client.rb in google-cloud-dialogflow-0.5.0

- old
+ new

@@ -48,11 +48,11 @@ # requests specified by the `lifespan_count` parameter, or after 20 minutes # if no intents are matched for a `DetectIntent` request. # # For more information about contexts, see the # [Dialogflow - # documentation](https://cloud.google.com/dialogflow-enterprise/docs/contexts-overview). + # documentation](https://cloud.google.com/dialogflow/docs/contexts-overview). # # @!attribute [r] contexts_stub # @return [Google::Cloud::Dialogflow::V2::Contexts::Stub] class ContextsClient # @private @@ -146,19 +146,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. @@ -209,11 +215,11 @@ 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 @contexts_stub = Google::Gax::Grpc.create_stub( service_path, port, chan_creds: chan_creds,