class Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client

Client for the DataLabelingService service.

Service for the AI Platform Data Labeling API.

Attributes

data_labeling_service_stub[R]

@private

operations_client[R]

Get the associated client for long-running operations.

@return [::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Operations]

Public Class Methods

configure() { |configure| ... } click to toggle source

Configure the DataLabelingService Client class.

See {::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client::Configuration} for a description of the configuration fields.

@example

# Modify the configuration for all DataLabelingService clients
::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.configure do |config|
  config.timeout = 10.0
end

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 56
def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "DataLabeling", "V1beta1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.create_dataset.timeout = 30.0

    default_config.rpcs.get_dataset.timeout = 30.0
    default_config.rpcs.get_dataset.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_datasets.timeout = 30.0
    default_config.rpcs.list_datasets.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.delete_dataset.timeout = 30.0
    default_config.rpcs.delete_dataset.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.import_data.timeout = 30.0

    default_config.rpcs.export_data.timeout = 30.0
    default_config.rpcs.export_data.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.get_data_item.timeout = 30.0
    default_config.rpcs.get_data_item.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_data_items.timeout = 30.0
    default_config.rpcs.list_data_items.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.get_annotated_dataset.timeout = 30.0
    default_config.rpcs.get_annotated_dataset.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_annotated_datasets.timeout = 30.0
    default_config.rpcs.list_annotated_datasets.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.label_image.timeout = 30.0

    default_config.rpcs.label_video.timeout = 30.0

    default_config.rpcs.label_text.timeout = 30.0

    default_config.rpcs.get_example.timeout = 30.0
    default_config.rpcs.get_example.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_examples.timeout = 30.0
    default_config.rpcs.list_examples.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.create_annotation_spec_set.timeout = 30.0

    default_config.rpcs.get_annotation_spec_set.timeout = 30.0
    default_config.rpcs.get_annotation_spec_set.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_annotation_spec_sets.timeout = 30.0
    default_config.rpcs.list_annotation_spec_sets.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.delete_annotation_spec_set.timeout = 30.0
    default_config.rpcs.delete_annotation_spec_set.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.create_instruction.timeout = 30.0

    default_config.rpcs.get_instruction.timeout = 30.0
    default_config.rpcs.get_instruction.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_instructions.timeout = 30.0
    default_config.rpcs.list_instructions.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.delete_instruction.timeout = 30.0
    default_config.rpcs.delete_instruction.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.get_evaluation.timeout = 30.0
    default_config.rpcs.get_evaluation.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.search_evaluations.timeout = 30.0
    default_config.rpcs.search_evaluations.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.search_example_comparisons.timeout = 30.0

    default_config.rpcs.create_evaluation_job.timeout = 30.0

    default_config.rpcs.update_evaluation_job.timeout = 30.0

    default_config.rpcs.get_evaluation_job.timeout = 30.0
    default_config.rpcs.get_evaluation_job.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.pause_evaluation_job.timeout = 30.0

    default_config.rpcs.resume_evaluation_job.timeout = 30.0

    default_config.rpcs.delete_evaluation_job.timeout = 30.0
    default_config.rpcs.delete_evaluation_job.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_evaluation_jobs.timeout = 30.0
    default_config.rpcs.list_evaluation_jobs.retry_policy = {
      initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end
new() { |config| ... } click to toggle source

Create a new DataLabelingService client object.

@example

# Create a client using the default configuration
client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config|
  config.timeout = 10.0
end

@yield [config] Configure the DataLabelingService client. @yieldparam config [Client::Configuration]

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 238
def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/datalabeling/v1beta1/data_labeling_service_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.endpoint = @config.endpoint
  end

  @data_labeling_service_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors
  )
end

Public Instance Methods

configure() { |config| ... } click to toggle source

Configure the DataLabelingService 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 {::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client::Configuration} for a description of the configuration fields.

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 217
def configure
  yield @config if block_given?
  @config
end
create_annotation_spec_set(request, options = nil) { |response, operation| ... } click to toggle source

Creates an annotation spec set by providing a set of labels.

@overload create_annotation_spec_set(request, options = nil)

Pass arguments to `create_annotation_spec_set` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::CreateAnnotationSpecSetRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::CreateAnnotationSpecSetRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_annotation_spec_set(parent: nil, annotation_spec_set: nil)

Pass arguments to `create_annotation_spec_set` 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).

@param parent [::String]
  Required. AnnotationSpecSet resource parent, format:
  projects/\\{project_id}
@param annotation_spec_set [::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet, ::Hash]
  Required. Annotation spec set to create. Annotation specs must be included.
  Only one annotation spec will be accepted for annotation specs with same
  display_name.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1569
def create_annotation_spec_set request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::CreateAnnotationSpecSetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.create_annotation_spec_set.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_annotation_spec_set.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_annotation_spec_set.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :create_annotation_spec_set, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_dataset(request, options = nil) { |response, operation| ... } click to toggle source

Creates dataset. If success return a Dataset resource.

@overload create_dataset(request, options = nil)

Pass arguments to `create_dataset` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::CreateDatasetRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::CreateDatasetRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_dataset(parent: nil, dataset: nil)

Pass arguments to `create_dataset` 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).

@param parent [::String]
  Required. Dataset resource parent, format:
  projects/\\{project_id}
@param dataset [::Google::Cloud::DataLabeling::V1beta1::Dataset, ::Hash]
  Required. The dataset to be created.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::Dataset] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::Dataset]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 320
def create_dataset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::CreateDatasetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.create_dataset.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_dataset.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_dataset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :create_dataset, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_evaluation_job(request, options = nil) { |response, operation| ... } click to toggle source

Creates an evaluation job.

@overload create_evaluation_job(request, options = nil)

Pass arguments to `create_evaluation_job` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::CreateEvaluationJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::CreateEvaluationJobRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_evaluation_job(parent: nil, job: nil)

Pass arguments to `create_evaluation_job` 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).

@param parent [::String]
  Required. Evaluation job resource parent. Format:
  "projects/<var>\\{project_id}</var>"
@param job [::Google::Cloud::DataLabeling::V1beta1::EvaluationJob, ::Hash]
  Required. The evaluation job to create.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::EvaluationJob] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::EvaluationJob]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2419
def create_evaluation_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::CreateEvaluationJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.create_evaluation_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_evaluation_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_evaluation_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :create_evaluation_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_instruction(request, options = nil) { |response, operation| ... } click to toggle source

Creates an instruction for how data should be labeled.

@overload create_instruction(request, options = nil)

Pass arguments to `create_instruction` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::CreateInstructionRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::CreateInstructionRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_instruction(parent: nil, instruction: nil)

Pass arguments to `create_instruction` 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).

@param parent [::String]
  Required. Instruction resource parent, format:
  projects/\\{project_id}
@param instruction [::Google::Cloud::DataLabeling::V1beta1::Instruction, ::Hash]
  Required. Instruction of how to perform the labeling task.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1859
def create_instruction request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::CreateInstructionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.create_instruction.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_instruction.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_instruction.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :create_instruction, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_annotated_dataset(request, options = nil) { |response, operation| ... } click to toggle source

Deletes an annotated dataset by resource name.

@overload delete_annotated_dataset(request, options = nil)

Pass arguments to `delete_annotated_dataset` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::DeleteAnnotatedDatasetRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::DeleteAnnotatedDatasetRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_annotated_dataset(name: nil)

Pass arguments to `delete_annotated_dataset` 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).

@param name [::String]
  Required. Name of the annotated dataset to delete, format:
  projects/\\{project_id}/datasets/\\{dataset_id}/annotatedDatasets/
  \\{annotated_dataset_id}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1074
def delete_annotated_dataset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::DeleteAnnotatedDatasetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_annotated_dataset.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_annotated_dataset.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_annotated_dataset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :delete_annotated_dataset, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_annotation_spec_set(request, options = nil) { |response, operation| ... } click to toggle source

Deletes an annotation spec set by resource name.

@overload delete_annotation_spec_set(request, options = nil)

Pass arguments to `delete_annotation_spec_set` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::DeleteAnnotationSpecSetRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::DeleteAnnotationSpecSetRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_annotation_spec_set(name: nil)

Pass arguments to `delete_annotation_spec_set` 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).

@param name [::String]
  Required. AnnotationSpec resource name, format:
  `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1788
def delete_annotation_spec_set request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::DeleteAnnotationSpecSetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_annotation_spec_set.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_annotation_spec_set.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_annotation_spec_set.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :delete_annotation_spec_set, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_dataset(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a dataset by resource name.

@overload delete_dataset(request, options = nil)

Pass arguments to `delete_dataset` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::DeleteDatasetRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::DeleteDatasetRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_dataset(name: nil)

Pass arguments to `delete_dataset` 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).

@param name [::String]
  Required. Dataset resource name, format:
  projects/\\{project_id}/datasets/\\{dataset_id}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 539
def delete_dataset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::DeleteDatasetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_dataset.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_dataset.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_dataset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_evaluation_job(request, options = nil) { |response, operation| ... } click to toggle source

Stops and deletes an evaluation job.

@overload delete_evaluation_job(request, options = nil)

Pass arguments to `delete_evaluation_job` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::DeleteEvaluationJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::DeleteEvaluationJobRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_evaluation_job(name: nil)

Pass arguments to `delete_evaluation_job` 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).

@param name [::String]
  Required. Name of the evaluation job that is going to be deleted. Format:

  "projects/<var>\\{project_id}</var>/evaluationJobs/<var>\\{evaluation_job_id}</var>"

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2784
def delete_evaluation_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::DeleteEvaluationJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_evaluation_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_evaluation_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_evaluation_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :delete_evaluation_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_instruction(request, options = nil) { |response, operation| ... } click to toggle source

Deletes an instruction object by resource name.

@overload delete_instruction(request, options = nil)

Pass arguments to `delete_instruction` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::DeleteInstructionRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::DeleteInstructionRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_instruction(name: nil)

Pass arguments to `delete_instruction` 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).

@param name [::String]
  Required. Instruction resource name, format:
  projects/\\{project_id}/instructions/\\{instruction_id}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2079
def delete_instruction request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::DeleteInstructionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_instruction.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_instruction.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_instruction.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :delete_instruction, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
export_data(request, options = nil) { |response, operation| ... } click to toggle source

Exports data and annotations from dataset.

@overload export_data(request, options = nil)

Pass arguments to `export_data` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ExportDataRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ExportDataRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload export_data(name: nil, annotated_dataset: nil, filter: nil, output_config: nil, user_email_address: nil)

Pass arguments to `export_data` 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).

@param name [::String]
  Required. Dataset resource name, format:
  projects/\\{project_id}/datasets/\\{dataset_id}
@param annotated_dataset [::String]
  Required. Annotated dataset resource name. DataItem in
  Dataset and their annotations in specified annotated dataset will be
  exported. It's in format of
  projects/\\{project_id}/datasets/\\{dataset_id}/annotatedDatasets/
  \\{annotated_dataset_id}
@param filter [::String]
  Optional. Filter is not supported at this moment.
@param output_config [::Google::Cloud::DataLabeling::V1beta1::OutputConfig, ::Hash]
  Required. Specify the output destination.
@param user_email_address [::String]
  Email of the user who started the export task and should be notified by
  email. If empty no notification will be sent.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 700
def export_data request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ExportDataRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.export_data.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.export_data.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.export_data.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :export_data, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_annotated_dataset(request, options = nil) { |response, operation| ... } click to toggle source

Gets an annotated dataset by resource name.

@overload get_annotated_dataset(request, options = nil)

Pass arguments to `get_annotated_dataset` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::GetAnnotatedDatasetRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::GetAnnotatedDatasetRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_annotated_dataset(name: nil)

Pass arguments to `get_annotated_dataset` 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).

@param name [::String]
  Required. Name of the annotated dataset to get, format:
  projects/\\{project_id}/datasets/\\{dataset_id}/annotatedDatasets/
  \\{annotated_dataset_id}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 923
def get_annotated_dataset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::GetAnnotatedDatasetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_annotated_dataset.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_annotated_dataset.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_annotated_dataset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :get_annotated_dataset, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_annotation_spec_set(request, options = nil) { |response, operation| ... } click to toggle source

Gets an annotation spec set by resource name.

@overload get_annotation_spec_set(request, options = nil)

Pass arguments to `get_annotation_spec_set` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::GetAnnotationSpecSetRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::GetAnnotationSpecSetRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_annotation_spec_set(name: nil)

Pass arguments to `get_annotation_spec_set` 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).

@param name [::String]
  Required. AnnotationSpecSet resource name, format:
  projects/\\{project_id}/annotationSpecSets/\\{annotation_spec_set_id}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1638
def get_annotation_spec_set request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::GetAnnotationSpecSetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_annotation_spec_set.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_annotation_spec_set.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_annotation_spec_set.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :get_annotation_spec_set, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_data_item(request, options = nil) { |response, operation| ... } click to toggle source

Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.

@overload get_data_item(request, options = nil)

Pass arguments to `get_data_item` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::GetDataItemRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::GetDataItemRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_data_item(name: nil)

Pass arguments to `get_data_item` 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).

@param name [::String]
  Required. The name of the data item to get, format:
  projects/\\{project_id}/datasets/\\{dataset_id}/dataItems/\\{data_item_id}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::DataItem] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::DataItem]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 771
def get_data_item request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::GetDataItemRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_data_item.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_data_item.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_data_item.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :get_data_item, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_dataset(request, options = nil) { |response, operation| ... } click to toggle source

Gets dataset by resource name.

@overload get_dataset(request, options = nil)

Pass arguments to `get_dataset` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::GetDatasetRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::GetDatasetRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_dataset(name: nil)

Pass arguments to `get_dataset` 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).

@param name [::String]
  Required. Dataset resource name, format:
  projects/\\{project_id}/datasets/\\{dataset_id}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::Dataset] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::Dataset]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 389
def get_dataset request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::GetDatasetRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_dataset.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_dataset.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_dataset.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :get_dataset, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_evaluation(request, options = nil) { |response, operation| ... } click to toggle source

Gets an evaluation by resource name (to search, use {::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#search_evaluations projects.evaluations.search}).

@overload get_evaluation(request, options = nil)

Pass arguments to `get_evaluation` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::GetEvaluationRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::GetEvaluationRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_evaluation(name: nil)

Pass arguments to `get_evaluation` 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).

@param name [::String]
  Required. Name of the evaluation. Format:

  "projects/<var>\\{project_id}</var>/datasets/<var>\\{dataset_id}</var>/evaluations/<var>\\{evaluation_id}</var>'

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::Evaluation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::Evaluation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2150
def get_evaluation request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::GetEvaluationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_evaluation.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_evaluation.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_evaluation.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_evaluation_job(request, options = nil) { |response, operation| ... } click to toggle source

Gets an evaluation job by resource name.

@overload get_evaluation_job(request, options = nil)

Pass arguments to `get_evaluation_job` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::GetEvaluationJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::GetEvaluationJobRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_evaluation_job(name: nil)

Pass arguments to `get_evaluation_job` 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).

@param name [::String]
  Required. Name of the evaluation job. Format:

  "projects/<var>\\{project_id}</var>/evaluationJobs/<var>\\{evaluation_job_id}</var>"

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::EvaluationJob] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::EvaluationJob]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2572
def get_evaluation_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::GetEvaluationJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_evaluation_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_evaluation_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_evaluation_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :get_evaluation_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_example(request, options = nil) { |response, operation| ... } click to toggle source

Gets an example by resource name, including both data and annotation.

@overload get_example(request, options = nil)

Pass arguments to `get_example` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::GetExampleRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::GetExampleRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_example(name: nil, filter: nil)

Pass arguments to `get_example` 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).

@param name [::String]
  Required. Name of example, format:
  projects/\\{project_id}/datasets/\\{dataset_id}/annotatedDatasets/
  \\{annotated_dataset_id}/examples/\\{example_id}
@param filter [::String]
  Optional. An expression for filtering Examples. Filter by
  annotation_spec.display_name is supported. Format
  "annotation_spec.display_name = \\{display_name}"

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::Example] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::Example]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1413
def get_example request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::GetExampleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_example.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_example.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_example.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :get_example, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_instruction(request, options = nil) { |response, operation| ... } click to toggle source

Gets an instruction by resource name.

@overload get_instruction(request, options = nil)

Pass arguments to `get_instruction` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::GetInstructionRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::GetInstructionRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_instruction(name: nil)

Pass arguments to `get_instruction` 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).

@param name [::String]
  Required. Instruction resource name, format:
  projects/\\{project_id}/instructions/\\{instruction_id}

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::Instruction] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::Instruction]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1929
def get_instruction request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::GetInstructionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_instruction.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_instruction.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_instruction.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :get_instruction, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
import_data(request, options = nil) { |response, operation| ... } click to toggle source

Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.

@overload import_data(request, options = nil)

Pass arguments to `import_data` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ImportDataRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ImportDataRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload import_data(name: nil, input_config: nil, user_email_address: nil)

Pass arguments to `import_data` 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).

@param name [::String]
  Required. Dataset resource name, format:
  projects/\\{project_id}/datasets/\\{dataset_id}
@param input_config [::Google::Cloud::DataLabeling::V1beta1::InputConfig, ::Hash]
  Required. Specify the input source of the data.
@param user_email_address [::String]
  Email of the user who started the import task and should be notified by
  email. If empty no notification will be sent.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 617
def import_data request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ImportDataRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.import_data.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.import_data.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.import_data.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :import_data, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
label_image(request, options = nil) { |response, operation| ... } click to toggle source

Starts a labeling task for image. The type of image labeling task is configured by feature in the request.

@overload label_image(request, options = nil)

Pass arguments to `label_image` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::LabelImageRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::LabelImageRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload label_image(image_classification_config: nil, bounding_poly_config: nil, polyline_config: nil, segmentation_config: nil, parent: nil, basic_config: nil, feature: nil)

Pass arguments to `label_image` 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).

@param image_classification_config [::Google::Cloud::DataLabeling::V1beta1::ImageClassificationConfig, ::Hash]
  Configuration for image classification task.
  One of image_classification_config, bounding_poly_config,
  polyline_config and segmentation_config are required.
@param bounding_poly_config [::Google::Cloud::DataLabeling::V1beta1::BoundingPolyConfig, ::Hash]
  Configuration for bounding box and bounding poly task.
  One of image_classification_config, bounding_poly_config,
  polyline_config and segmentation_config are required.
@param polyline_config [::Google::Cloud::DataLabeling::V1beta1::PolylineConfig, ::Hash]
  Configuration for polyline task.
  One of image_classification_config, bounding_poly_config,
  polyline_config and segmentation_config are required.
@param segmentation_config [::Google::Cloud::DataLabeling::V1beta1::SegmentationConfig, ::Hash]
  Configuration for segmentation task.
  One of image_classification_config, bounding_poly_config,
  polyline_config and segmentation_config are required.
@param parent [::String]
  Required. Name of the dataset to request labeling task, format:
  projects/\\{project_id}/datasets/\\{dataset_id}
@param basic_config [::Google::Cloud::DataLabeling::V1beta1::HumanAnnotationConfig, ::Hash]
  Required. Basic human annotation config.
@param feature [::Google::Cloud::DataLabeling::V1beta1::LabelImageRequest::Feature]
  Required. The type of image labeling task.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1164
def label_image request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::LabelImageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.label_image.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.label_image.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.label_image.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :label_image, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
label_text(request, options = nil) { |response, operation| ... } click to toggle source

Starts a labeling task for text. The type of text labeling task is configured by feature in the request.

@overload label_text(request, options = nil)

Pass arguments to `label_text` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::LabelTextRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::LabelTextRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload label_text(text_classification_config: nil, text_entity_extraction_config: nil, parent: nil, basic_config: nil, feature: nil)

Pass arguments to `label_text` 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).

@param text_classification_config [::Google::Cloud::DataLabeling::V1beta1::TextClassificationConfig, ::Hash]
  Configuration for text classification task.
  One of text_classification_config and text_entity_extraction_config
  is required.
@param text_entity_extraction_config [::Google::Cloud::DataLabeling::V1beta1::TextEntityExtractionConfig, ::Hash]
  Configuration for entity extraction task.
  One of text_classification_config and text_entity_extraction_config
  is required.
@param parent [::String]
  Required. Name of the data set to request labeling task, format:
  projects/\\{project_id}/datasets/\\{dataset_id}
@param basic_config [::Google::Cloud::DataLabeling::V1beta1::HumanAnnotationConfig, ::Hash]
  Required. Basic human annotation config.
@param feature [::Google::Cloud::DataLabeling::V1beta1::LabelTextRequest::Feature]
  Required. The type of text labeling task.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1338
def label_text request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::LabelTextRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.label_text.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.label_text.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.label_text.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :label_text, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
label_video(request, options = nil) { |response, operation| ... } click to toggle source

Starts a labeling task for video. The type of video labeling task is configured by feature in the request.

@overload label_video(request, options = nil)

Pass arguments to `label_video` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::LabelVideoRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::LabelVideoRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload label_video(video_classification_config: nil, object_detection_config: nil, object_tracking_config: nil, event_config: nil, parent: nil, basic_config: nil, feature: nil)

Pass arguments to `label_video` 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).

@param video_classification_config [::Google::Cloud::DataLabeling::V1beta1::VideoClassificationConfig, ::Hash]
  Configuration for video classification task.
  One of video_classification_config, object_detection_config,
  object_tracking_config and event_config is required.
@param object_detection_config [::Google::Cloud::DataLabeling::V1beta1::ObjectDetectionConfig, ::Hash]
  Configuration for video object detection task.
  One of video_classification_config, object_detection_config,
  object_tracking_config and event_config is required.
@param object_tracking_config [::Google::Cloud::DataLabeling::V1beta1::ObjectTrackingConfig, ::Hash]
  Configuration for video object tracking task.
  One of video_classification_config, object_detection_config,
  object_tracking_config and event_config is required.
@param event_config [::Google::Cloud::DataLabeling::V1beta1::EventConfig, ::Hash]
  Configuration for video event task.
  One of video_classification_config, object_detection_config,
  object_tracking_config and event_config is required.
@param parent [::String]
  Required. Name of the dataset to request labeling task, format:
  projects/\\{project_id}/datasets/\\{dataset_id}
@param basic_config [::Google::Cloud::DataLabeling::V1beta1::HumanAnnotationConfig, ::Hash]
  Required. Basic human annotation config.
@param feature [::Google::Cloud::DataLabeling::V1beta1::LabelVideoRequest::Feature]
  Required. The type of video labeling task.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1255
def label_video request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::LabelVideoRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.label_video.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.label_video.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.label_video.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :label_video, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_annotated_datasets(request, options = nil) { |response, operation| ... } click to toggle source

Lists annotated datasets for a dataset. Pagination is supported.

@overload list_annotated_datasets(request, options = nil)

Pass arguments to `list_annotated_datasets` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ListAnnotatedDatasetsRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ListAnnotatedDatasetsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_annotated_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil)

Pass arguments to `list_annotated_datasets` 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).

@param parent [::String]
  Required. Name of the dataset to list annotated datasets, format:
  projects/\\{project_id}/datasets/\\{dataset_id}
@param filter [::String]
  Optional. Filter is not supported at this moment.
@param page_size [::Integer]
  Optional. Requested page size. Server may return fewer results than
  requested. Default value is 100.
@param page_token [::String]
  Optional. A token identifying a page of results for the server to return.
  Typically obtained by
  {::Google::Cloud::DataLabeling::V1beta1::ListAnnotatedDatasetsResponse#next_page_token ListAnnotatedDatasetsResponse.next_page_token} of the previous
  [DataLabelingService.ListAnnotatedDatasets] call.
  Return first page if empty.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1003
def list_annotated_datasets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ListAnnotatedDatasetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_annotated_datasets.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_annotated_datasets.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_annotated_datasets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :list_annotated_datasets, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_labeling_service_stub, :list_annotated_datasets, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_annotation_spec_sets(request, options = nil) { |response, operation| ... } click to toggle source

Lists annotation spec sets for a project. Pagination is supported.

@overload list_annotation_spec_sets(request, options = nil)

Pass arguments to `list_annotation_spec_sets` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ListAnnotationSpecSetsRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ListAnnotationSpecSetsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_annotation_spec_sets(parent: nil, filter: nil, page_size: nil, page_token: nil)

Pass arguments to `list_annotation_spec_sets` 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).

@param parent [::String]
  Required. Parent of AnnotationSpecSet resource, format:
  projects/\\{project_id}
@param filter [::String]
  Optional. Filter is not supported at this moment.
@param page_size [::Integer]
  Optional. Requested page size. Server may return fewer results than
  requested. Default value is 100.
@param page_token [::String]
  Optional. A token identifying a page of results for the server to return.
  Typically obtained by
  {::Google::Cloud::DataLabeling::V1beta1::ListAnnotationSpecSetsResponse#next_page_token ListAnnotationSpecSetsResponse.next_page_token} of the previous
  [DataLabelingService.ListAnnotationSpecSets] call.
  Return first page if empty.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1718
def list_annotation_spec_sets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ListAnnotationSpecSetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_annotation_spec_sets.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_annotation_spec_sets.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_annotation_spec_sets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :list_annotation_spec_sets, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_labeling_service_stub, :list_annotation_spec_sets, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_data_items(request, options = nil) { |response, operation| ... } click to toggle source

Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.

@overload list_data_items(request, options = nil)

Pass arguments to `list_data_items` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ListDataItemsRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ListDataItemsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_data_items(parent: nil, filter: nil, page_size: nil, page_token: nil)

Pass arguments to `list_data_items` 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).

@param parent [::String]
  Required. Name of the dataset to list data items, format:
  projects/\\{project_id}/datasets/\\{dataset_id}
@param filter [::String]
  Optional. Filter is not supported at this moment.
@param page_size [::Integer]
  Optional. Requested page size. Server may return fewer results than
  requested. Default value is 100.
@param page_token [::String]
  Optional. A token identifying a page of results for the server to return.
  Typically obtained by
  {::Google::Cloud::DataLabeling::V1beta1::ListDataItemsResponse#next_page_token ListDataItemsResponse.next_page_token} of the previous
  [DataLabelingService.ListDataItems] call.
  Return first page if empty.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::DataItem>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::DataItem>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 852
def list_data_items request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ListDataItemsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_data_items.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_data_items.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_data_items.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :list_data_items, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_labeling_service_stub, :list_data_items, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_datasets(request, options = nil) { |response, operation| ... } click to toggle source

Lists datasets under a project. Pagination is supported.

@overload list_datasets(request, options = nil)

Pass arguments to `list_datasets` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ListDatasetsRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ListDatasetsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_datasets(parent: nil, filter: nil, page_size: nil, page_token: nil)

Pass arguments to `list_datasets` 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).

@param parent [::String]
  Required. Dataset resource parent, format:
  projects/\\{project_id}
@param filter [::String]
  Optional. Filter on dataset is not supported at this moment.
@param page_size [::Integer]
  Optional. Requested page size. Server may return fewer results than
  requested. Default value is 100.
@param page_token [::String]
  Optional. A token identifying a page of results for the server to return.
  Typically obtained by
  {::Google::Cloud::DataLabeling::V1beta1::ListDatasetsResponse#next_page_token ListDatasetsResponse.next_page_token} of the previous
  [DataLabelingService.ListDatasets] call.
  Returns the first page if empty.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::Dataset>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::Dataset>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 469
def list_datasets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ListDatasetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_datasets.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_datasets.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_datasets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :list_datasets, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_labeling_service_stub, :list_datasets, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_evaluation_jobs(request, options = nil) { |response, operation| ... } click to toggle source

Lists all evaluation jobs within a project with possible filters. Pagination is supported.

@overload list_evaluation_jobs(request, options = nil)

Pass arguments to `list_evaluation_jobs` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ListEvaluationJobsRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ListEvaluationJobsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_evaluation_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil)

Pass arguments to `list_evaluation_jobs` 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).

@param parent [::String]
  Required. Evaluation job resource parent. Format:
  "projects/<var>\\{project_id}</var>"
@param filter [::String]
  Optional. You can filter the jobs to list by model_id (also known as
  model_name, as described in
  {::Google::Cloud::DataLabeling::V1beta1::EvaluationJob#model_version EvaluationJob.modelVersion}) or by
  evaluation job state (as described in {::Google::Cloud::DataLabeling::V1beta1::EvaluationJob#state EvaluationJob.state}). To filter
  by both criteria, use the `AND` operator or the `OR` operator. For example,
  you can use the following string for your filter:
  "evaluation<span>_</span>job.model_id = <var>\\{model_name}</var> AND
  evaluation<span>_</span>job.state = <var>\\{evaluation_job_state}</var>"
@param page_size [::Integer]
  Optional. Requested page size. Server may return fewer results than
  requested. Default value is 100.
@param page_token [::String]
  Optional. A token identifying a page of results for the server to return.
  Typically obtained by the
  {::Google::Cloud::DataLabeling::V1beta1::ListEvaluationJobsResponse#next_page_token nextPageToken} in the response
  to the previous request. The request returns the first page if this is
  empty.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::EvaluationJob>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::EvaluationJob>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2872
def list_evaluation_jobs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ListEvaluationJobsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_evaluation_jobs.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_evaluation_jobs.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_evaluation_jobs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :list_evaluation_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_labeling_service_stub, :list_evaluation_jobs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_examples(request, options = nil) { |response, operation| ... } click to toggle source

Lists examples in an annotated dataset. Pagination is supported.

@overload list_examples(request, options = nil)

Pass arguments to `list_examples` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ListExamplesRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ListExamplesRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_examples(parent: nil, filter: nil, page_size: nil, page_token: nil)

Pass arguments to `list_examples` 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).

@param parent [::String]
  Required. Example resource parent.
@param filter [::String]
  Optional. An expression for filtering Examples. For annotated datasets that
  have annotation spec set, filter by
  annotation_spec.display_name is supported. Format
  "annotation_spec.display_name = \\{display_name}"
@param page_size [::Integer]
  Optional. Requested page size. Server may return fewer results than
  requested. Default value is 100.
@param page_token [::String]
  Optional. A token identifying a page of results for the server to return.
  Typically obtained by
  {::Google::Cloud::DataLabeling::V1beta1::ListExamplesResponse#next_page_token ListExamplesResponse.next_page_token} of the previous
  [DataLabelingService.ListExamples] call.
  Return first page if empty.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::Example>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::Example>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 1495
def list_examples request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ListExamplesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_examples.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_examples.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_examples.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :list_examples, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_labeling_service_stub, :list_examples, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_instructions(request, options = nil) { |response, operation| ... } click to toggle source

Lists instructions for a project. Pagination is supported.

@overload list_instructions(request, options = nil)

Pass arguments to `list_instructions` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ListInstructionsRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ListInstructionsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_instructions(parent: nil, filter: nil, page_size: nil, page_token: nil)

Pass arguments to `list_instructions` 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).

@param parent [::String]
  Required. Instruction resource parent, format:
  projects/\\{project_id}
@param filter [::String]
  Optional. Filter is not supported at this moment.
@param page_size [::Integer]
  Optional. Requested page size. Server may return fewer results than
  requested. Default value is 100.
@param page_token [::String]
  Optional. A token identifying a page of results for the server to return.
  Typically obtained by
  {::Google::Cloud::DataLabeling::V1beta1::ListInstructionsResponse#next_page_token ListInstructionsResponse.next_page_token} of the previous
  [DataLabelingService.ListInstructions] call.
  Return first page if empty.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::Instruction>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::Instruction>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2009
def list_instructions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ListInstructionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_instructions.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_instructions.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_instructions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :list_instructions, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_labeling_service_stub, :list_instructions, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
pause_evaluation_job(request, options = nil) { |response, operation| ... } click to toggle source

Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a no-op.

@overload pause_evaluation_job(request, options = nil)

Pass arguments to `pause_evaluation_job` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::PauseEvaluationJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::PauseEvaluationJobRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload pause_evaluation_job(name: nil)

Pass arguments to `pause_evaluation_job` 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).

@param name [::String]
  Required. Name of the evaluation job that is going to be paused. Format:

  "projects/<var>\\{project_id}</var>/evaluationJobs/<var>\\{evaluation_job_id}</var>"

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2643
def pause_evaluation_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::PauseEvaluationJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.pause_evaluation_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.pause_evaluation_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.pause_evaluation_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :pause_evaluation_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
resume_evaluation_job(request, options = nil) { |response, operation| ... } click to toggle source

Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running or scheduled evaluation job is a no-op.

@overload resume_evaluation_job(request, options = nil)

Pass arguments to `resume_evaluation_job` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::ResumeEvaluationJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::ResumeEvaluationJobRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload resume_evaluation_job(name: nil)

Pass arguments to `resume_evaluation_job` 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).

@param name [::String]
  Required. Name of the evaluation job that is going to be resumed. Format:

  "projects/<var>\\{project_id}</var>/evaluationJobs/<var>\\{evaluation_job_id}</var>"

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2714
def resume_evaluation_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::ResumeEvaluationJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.resume_evaluation_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.resume_evaluation_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.resume_evaluation_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :resume_evaluation_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
search_evaluations(request, options = nil) { |response, operation| ... } click to toggle source

Searches {::Google::Cloud::DataLabeling::V1beta1::Evaluation evaluations} within a project.

@overload search_evaluations(request, options = nil)

Pass arguments to `search_evaluations` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::SearchEvaluationsRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::SearchEvaluationsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload search_evaluations(parent: nil, filter: nil, page_size: nil, page_token: nil)

Pass arguments to `search_evaluations` 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).

@param parent [::String]
  Required. Evaluation search parent (project ID). Format:
  "projects/<var>\\{project_id}</var>"
@param filter [::String]
  Optional. To search evaluations, you can filter by the following:

  * evaluation<span>_</span>job.evaluation_job_id (the last part of
    {::Google::Cloud::DataLabeling::V1beta1::EvaluationJob#name EvaluationJob.name})
  * evaluation<span>_</span>job.model_id (the <var>\\{model_name}</var> portion
    of {::Google::Cloud::DataLabeling::V1beta1::EvaluationJob#model_version EvaluationJob.modelVersion})
  * evaluation<span>_</span>job.evaluation_job_run_time_start (Minimum
    threshold for the
    {::Google::Cloud::DataLabeling::V1beta1::Evaluation#evaluation_job_run_time evaluationJobRunTime} that created
    the evaluation)
  * evaluation<span>_</span>job.evaluation_job_run_time_end (Maximum
    threshold for the
    {::Google::Cloud::DataLabeling::V1beta1::Evaluation#evaluation_job_run_time evaluationJobRunTime} that created
    the evaluation)
  * evaluation<span>_</span>job.job_state ({::Google::Cloud::DataLabeling::V1beta1::EvaluationJob#state EvaluationJob.state})
  * annotation<span>_</span>spec.display_name (the Evaluation contains a
    metric for the annotation spec with this
    {::Google::Cloud::DataLabeling::V1beta1::AnnotationSpec#display_name displayName})

  To filter by multiple critiera, use the `AND` operator or the `OR`
  operator. The following examples shows a string that filters by several
  critiera:

  "evaluation<span>_</span>job.evaluation_job_id =
  <var>\\{evaluation_job_id}</var> AND evaluation<span>_</span>job.model_id =
  <var>\\{model_name}</var> AND
  evaluation<span>_</span>job.evaluation_job_run_time_start =
  <var>\\{timestamp_1}</var> AND
  evaluation<span>_</span>job.evaluation_job_run_time_end =
  <var>\\{timestamp_2}</var> AND annotation<span>_</span>spec.display_name =
  <var>\\{display_name}</var>"
@param page_size [::Integer]
  Optional. Requested page size. Server may return fewer results than
  requested. Default value is 100.
@param page_token [::String]
  Optional. A token identifying a page of results for the server to return.
  Typically obtained by the
  {::Google::Cloud::DataLabeling::V1beta1::SearchEvaluationsResponse#next_page_token nextPageToken} of the response
  to a previous search request.

  If you don't specify this field, the API call requests the first page of
  the search.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::Evaluation>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::Evaluation>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2262
def search_evaluations request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::SearchEvaluationsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.search_evaluations.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.search_evaluations.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.search_evaluations.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :search_evaluations, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_labeling_service_stub, :search_evaluations, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
search_example_comparisons(request, options = nil) { |response, operation| ... } click to toggle source

Searches example comparisons from an evaluation. The return format is a list of example comparisons that show ground truth and prediction(s) for a single input. Search by providing an evaluation ID.

@overload search_example_comparisons(request, options = nil)

Pass arguments to `search_example_comparisons` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload search_example_comparisons(parent: nil, page_size: nil, page_token: nil)

Pass arguments to `search_example_comparisons` 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).

@param parent [::String]
  Required. Name of the {::Google::Cloud::DataLabeling::V1beta1::Evaluation Evaluation} resource to search for example
  comparisons from. Format:

  "projects/<var>\\{project_id}</var>/datasets/<var>\\{dataset_id}</var>/evaluations/<var>\\{evaluation_id}</var>"
@param page_size [::Integer]
  Optional. Requested page size. Server may return fewer results than
  requested. Default value is 100.
@param page_token [::String]
  Optional. A token identifying a page of results for the server to return.
  Typically obtained by the
  [nextPageToken][SearchExampleComparisons.next_page_token] of the response
  to a previous search rquest.

  If you don't specify this field, the API call requests the first page of
  the search.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsResponse::ExampleComparison>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsResponse::ExampleComparison>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2347
def search_example_comparisons request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.search_example_comparisons.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.search_example_comparisons.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.search_example_comparisons.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :search_example_comparisons, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_labeling_service_stub, :search_example_comparisons, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
update_evaluation_job(request, options = nil) { |response, operation| ... } click to toggle source

Updates an evaluation job. You can only update certain fields of the job's {::Google::Cloud::DataLabeling::V1beta1::EvaluationJobConfig EvaluationJobConfig}: `humanAnnotationConfig.instruction`, `exampleCount`, and `exampleSamplePercentage`.

If you want to change any other aspect of the evaluation job, you must delete the job and create a new one.

@overload update_evaluation_job(request, options = nil)

Pass arguments to `update_evaluation_job` via a request object, either of type
{::Google::Cloud::DataLabeling::V1beta1::UpdateEvaluationJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::DataLabeling::V1beta1::UpdateEvaluationJobRequest, ::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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload update_evaluation_job(evaluation_job: nil, update_mask: nil)

Pass arguments to `update_evaluation_job` 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).

@param evaluation_job [::Google::Cloud::DataLabeling::V1beta1::EvaluationJob, ::Hash]
  Required. Evaluation job that is going to be updated.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Optional. Mask for which fields to update. You can only provide the
  following fields:

  * `evaluationJobConfig.humanAnnotationConfig.instruction`
  * `evaluationJobConfig.exampleCount`
  * `evaluationJobConfig.exampleSamplePercentage`

  You can provide more than one of these fields by separating them with
  commas.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::DataLabeling::V1beta1::EvaluationJob] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::DataLabeling::V1beta1::EvaluationJob]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb, line 2502
def update_evaluation_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataLabeling::V1beta1::UpdateEvaluationJobRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.update_evaluation_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "evaluation_job.name" => request.evaluation_job.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_evaluation_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.update_evaluation_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @data_labeling_service_stub.call_rpc :update_evaluation_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end