Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.
Client for the SampleQueryService service.
Service for managing {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}s,
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the SampleQueryService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all SampleQueryService clients ::Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the SampleQueryService 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 Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_sample_query
def create_sample_query(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
def create_sample_query(parent: nil, sample_query: nil, sample_query_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
Creates a SampleQuery
def create_sample_query(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
create_sample_query
via a request object, either of type
CreateSampleQueryRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::CreateSampleQueryRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_sample_query(parent: nil, sample_query: nil, sample_query_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
create_sample_query
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).
-
parent (::String) — Required. The parent resource name, such as
projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}
. - sample_query (::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery, ::Hash) — Required. The SampleQuery to create.
-
sample_query_id (::String) — Required. The ID to use for the
SampleQuery, which will
become the final component of the
SampleQuery.name.
If the caller does not have permission to create the SampleQuery, regardless of whether or not it exists, a
PERMISSION_DENIED
error is returned.This field must be unique among all SampleQuerys with the same parent. Otherwise, an
ALREADY_EXISTS
error is returned.This field must conform to RFC-1034 standard with a length limit of 63 characters. Otherwise, an
INVALID_ARGUMENT
error is returned.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::CreateSampleQueryRequest.new # Call the create_sample_query method. result = client.create_sample_query request # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::SampleQuery. p result
#delete_sample_query
def delete_sample_query(request, options = nil) -> ::Google::Protobuf::Empty
def delete_sample_query(name: nil) -> ::Google::Protobuf::Empty
Deletes a SampleQuery.
def delete_sample_query(request, options = nil) -> ::Google::Protobuf::Empty
delete_sample_query
via a request object, either of type
DeleteSampleQueryRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::DeleteSampleQueryRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_sample_query(name: nil) -> ::Google::Protobuf::Empty
delete_sample_query
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).
-
name (::String) — Required. Full resource name of
SampleQuery, such as
projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}
.If the caller does not have permission to delete the SampleQuery, regardless of whether or not it exists, a
PERMISSION_DENIED
error is returned.If the SampleQuery to delete does not exist, a
NOT_FOUND
error is returned.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::DeleteSampleQueryRequest.new # Call the delete_sample_query method. result = client.delete_sample_query request # The returned object is of type Google::Protobuf::Empty. p result
#get_sample_query
def get_sample_query(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
def get_sample_query(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
Gets a SampleQuery.
def get_sample_query(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
get_sample_query
via a request object, either of type
GetSampleQueryRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::GetSampleQueryRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_sample_query(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
get_sample_query
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).
-
name (::String) — Required. Full resource name of
SampleQuery, such as
projects/{project}/locations/{location}/sampleQuerySets/{sample_query_set}/sampleQueries/{sample_query}
.If the caller does not have permission to access the SampleQuery, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the requested SampleQuery does not exist, a NOT_FOUND error is returned.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::GetSampleQueryRequest.new # Call the get_sample_query method. result = client.get_sample_query request # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::SampleQuery. p result
#import_sample_queries
def import_sample_queries(request, options = nil) -> ::Gapic::Operation
def import_sample_queries(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) -> ::Gapic::Operation
Bulk import of multiple SampleQuerys. Sample queries that already exist may be deleted.
Note: It is possible for a subset of the {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}s to be successfully imported.
def import_sample_queries(request, options = nil) -> ::Gapic::Operation
import_sample_queries
via a request object, either of type
ImportSampleQueriesRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::ImportSampleQueriesRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def import_sample_queries(inline_source: nil, gcs_source: nil, bigquery_source: nil, parent: nil, error_config: nil) -> ::Gapic::Operation
import_sample_queries
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).
- inline_source (::Google::Cloud::DiscoveryEngine::V1beta::ImportSampleQueriesRequest::InlineSource, ::Hash) — The Inline source for sample query entries.
- gcs_source (::Google::Cloud::DiscoveryEngine::V1beta::GcsSource, ::Hash) — Cloud Storage location for the input content.
- bigquery_source (::Google::Cloud::DiscoveryEngine::V1beta::BigQuerySource, ::Hash) — BigQuery input source.
-
parent (::String) — Required. The parent sample query set resource name, such as
projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}
.If the caller does not have permission to list SampleQuerys under this sample query set, regardless of whether or not this sample query set exists, a
PERMISSION_DENIED
error is returned. - error_config (::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig, ::Hash) — The desired location of errors incurred during the Import.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::ImportSampleQueriesRequest.new # Call the import_sample_queries method. result = client.import_sample_queries request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end
#initialize
def initialize() { |config| ... } -> Client
Create a new SampleQueryService client object.
- (config) — Configure the SampleQueryService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.new do |config| config.timeout = 10.0 end
#list_sample_queries
def list_sample_queries(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery>
def list_sample_queries(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery>
Gets a list of {::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery SampleQuery}s.
def list_sample_queries(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery>
list_sample_queries
via a request object, either of type
ListSampleQueriesRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::ListSampleQueriesRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_sample_queries(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery>
list_sample_queries
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).
-
parent (::String) — Required. The parent sample query set resource name, such as
projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}
.If the caller does not have permission to list SampleQuerys under this sample query set, regardless of whether or not this sample query set exists, a
PERMISSION_DENIED
error is returned. -
page_size (::Integer) — Maximum number of
SampleQuerys to return.
If unspecified, defaults to 100. The maximum allowed value is 1000. Values
above 1000 will be coerced to 1000.
If this field is negative, an
INVALID_ARGUMENT
error is returned. -
page_token (::String) — A page token
ListSampleQueriesResponse.next_page_token,
received from a previous
SampleQueryService.ListSampleQueries
call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to SampleQueryService.ListSampleQueries must match the call that provided the page token. Otherwise, an
INVALID_ARGUMENT
error is returned.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::ListSampleQueriesRequest.new # Call the list_sample_queries method. result = client.list_sample_queries request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Operations
Get the associated client for long-running operations.
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)
#update_sample_query
def update_sample_query(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
def update_sample_query(sample_query: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
Updates a SampleQuery.
def update_sample_query(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
update_sample_query
via a request object, either of type
UpdateSampleQueryRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::UpdateSampleQueryRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_sample_query(sample_query: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery
update_sample_query
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).
-
sample_query (::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery, ::Hash) — Required. The simple query to update.
If the caller does not have permission to update the SampleQuery, regardless of whether or not it exists, a
PERMISSION_DENIED
error is returned.If the SampleQuery to update does not exist a
NOT_FOUND
error is returned. - update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided imported 'simple query' to update. If not set, will by default update all fields.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DiscoveryEngine::V1beta::SampleQuery)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SampleQueryService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::UpdateSampleQueryRequest.new # Call the update_sample_query method. result = client.update_sample_query request # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::SampleQuery. p result