lib/google/cloud/pubsub/v1/subscriber_client.rb in google-cloud-pubsub-0.37.0 vs lib/google/cloud/pubsub/v1/subscriber_client.rb in google-cloud-pubsub-0.37.1

- old
+ new

@@ -168,19 +168,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. @@ -232,12 +238,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 @iam_policy_stub = Google::Gax::Grpc.create_stub( service_path, port, chan_creds: chan_creds, @@ -1272,10 +1278,15 @@ # set. # # @param resource [String] # REQUIRED: The resource for which the policy is being requested. # See the operation documentation for the appropriate value for this field. + # @param options_ [Google::Iam::V1::GetPolicyOptions | Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. This field is only used by Cloud IAM. + # A hash of the same form as `Google::Iam::V1::GetPolicyOptions` + # can also be provided. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. # @yield [result, operation] Access the result along with the RPC operation # @yieldparam result [Google::Iam::V1::Policy] @@ -1289,13 +1300,15 @@ # formatted_resource = Google::Cloud::PubSub::V1::SubscriberClient.subscription_path("[PROJECT]", "[SUBSCRIPTION]") # response = subscriber_client.get_iam_policy(formatted_resource) def get_iam_policy \ resource, + options_: nil, options: nil, &block req = { - resource: resource + resource: resource, + options: options_ }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Iam::V1::GetIamPolicyRequest) @get_iam_policy.call(req, options, &block) end