Class: Google::Cloud::Vision::V1::ImageAnnotator::Client::Configuration

Inherits:
Object
  • Object
show all
Extended by:
Gapic::Config
Defined in:
lib/google/cloud/vision/v1/image_annotator/client.rb

Overview

Configuration class for the ImageAnnotator API.

This class represents the configuration for ImageAnnotator, providing control over timeouts, retry behavior, logging, transport parameters, and other low-level controls. Certain parameters can also be applied individually to specific RPCs. See Rpcs for a list of RPCs that can be configured independently.

Configuration can be applied globally to all clients, or to a single client on construction.

Examples

To modify the global config, setting the timeout for batch_annotate_images to 20 seconds, and all remaining timeouts to 10 seconds:

::Google::Cloud::Vision::V1::ImageAnnotator::Client.configure do |config|
  config.timeout = 10.0
  config.rpcs.batch_annotate_images.timeout = 20.0
end

To apply the above configuration only to a new client:

client = ::Google::Cloud::Vision::V1::ImageAnnotator::Client.new do |config|
  config.timeout = 10.0
  config.rpcs.batch_annotate_images.timeout = 20.0
end

Defined Under Namespace

Classes: Rpcs

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#channel_args::Hash

Extra parameters passed to the gRPC channel. Note: this is ignored if a GRPC::Core::Channel object is provided as the credential.

Returns:

  • (::Hash)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#credentials::Object

Credentials to send with calls. You may provide any of the following types:

  • (String) The path to a service account key file in JSON format
  • (Hash) A service account key as a Hash
  • (Google::Auth::Credentials) A googleauth credentials object (see the googleauth docs)
  • (Signet::OAuth2::Client) A signet oauth2 client object (see the signet docs)
  • (GRPC::Core::Channel) a gRPC channel with included credentials
  • (GRPC::Core::ChannelCredentials) a gRPC credentails object
  • (nil) indicating no credentials

Returns:

  • (::Object)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#endpoint::String

The hostname or hostname:port of the service endpoint. Defaults to "vision.googleapis.com".

Returns:

  • (::String)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#interceptors::Array<::GRPC::ClientInterceptor>

An array of interceptors that are run before calls are executed.

Returns:

  • (::Array<::GRPC::ClientInterceptor>)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#lib_name::String

The library name as recorded in instrumentation and logging

Returns:

  • (::String)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#lib_version::String

The library version as recorded in instrumentation and logging

Returns:

  • (::String)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#metadata::Hash{::Symbol=>::String}

Additional gRPC headers to be sent with the call.

Returns:

  • (::Hash{::Symbol=>::String})


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#quota_project::String

A separate project against which to charge quota.

Returns:

  • (::String)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#retry_policy::Hash

The retry policy. The value is a hash with the following keys:

  • :initial_delay (type: Numeric) - The initial delay in seconds.
  • :max_delay (type: Numeric) - The max delay in seconds.
  • :multiplier (type: Numeric) - The incremental backoff multiplier.
  • :retry_codes (type: Array<String>) - The error codes that should trigger a retry.

Returns:

  • (::Hash)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#scope::Array<::String>

The OAuth scopes

Returns:

  • (::Array<::String>)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

#timeout::Numeric

The call timeout in seconds.

Returns:

  • (::Numeric)


583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 583

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "vision.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String, nil
  config_attr :lib_version,   nil, ::String, nil
  config_attr(:channel_args,  { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
  config_attr :interceptors,  nil, ::Array, nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :metadata,      nil, ::Hash, nil
  config_attr :retry_policy,  nil, ::Hash, ::Proc, nil
  config_attr :quota_project, nil, ::String, nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end

  ##
  # Configurations for individual RPCs
  # @return [Rpcs]
  #
  def rpcs
    @rpcs ||= begin
      parent_rpcs = nil
      parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
      Rpcs.new parent_rpcs
    end
  end

  ##
  # Configuration RPC class for the ImageAnnotator API.
  #
  # Includes fields providing the configuration for each RPC in this service.
  # Each configuration object is of type `Gapic::Config::Method` and includes
  # the following configuration fields:
  #
  #  *  `timeout` (*type:* `Numeric`) - The call timeout in seconds
  #  *  `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
  #  *  `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
  #     include the following keys:
  #      *  `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
  #      *  `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
  #      *  `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
  #      *  `:retry_codes` (*type:* `Array<String>`) - The error codes that should
  #         trigger a retry.
  #
  class Rpcs
    ##
    # RPC-specific configuration for `batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_images
    ##
    # RPC-specific configuration for `batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :batch_annotate_files
    ##
    # RPC-specific configuration for `async_batch_annotate_images`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_images
    ##
    # RPC-specific configuration for `async_batch_annotate_files`
    # @return [::Gapic::Config::Method]
    #
    attr_reader :async_batch_annotate_files

    # @private
    def initialize parent_rpcs = nil
      batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images
      @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config
      batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files
      @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config
      async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images
      @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config
      async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files
      @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config

      yield self if block_given?
    end
  end
end

Instance Method Details

#rpcsRpcs

Configurations for individual RPCs

Returns:



613
614
615
616
617
618
619
# File 'lib/google/cloud/vision/v1/image_annotator/client.rb', line 613

def rpcs
  @rpcs ||= begin
    parent_rpcs = nil
    parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
    Rpcs.new parent_rpcs
  end
end