Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHANGE ME] OwlBot on-demand for google-cloud-discovery_engine-v1 #27508

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions google-cloud-discovery_engine-v1/.owlbot-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
"snippets/schema_service/list_schemas.rb",
"snippets/schema_service/update_schema.rb",
"snippets/search_service/search.rb",
"snippets/search_service/search_lite.rb",
"snippets/search_tuning_service/list_custom_models.rb",
"snippets/search_tuning_service/train_custom_model.rb",
"snippets/site_search_engine_service/batch_create_target_sites.rb",
Expand Down
5 changes: 5 additions & 0 deletions google-cloud-discovery_engine-v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
"methods": [
"search"
]
},
"SearchLite": {
"methods": [
"search_lite"
]
}
}
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,44 @@ def search request_pb, options = nil
result
end

##
# Baseline implementation for the search_lite REST call
#
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest]
# A request object representing the call parameters. Required.
# @param options [::Gapic::CallOptions]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1::SearchResponse]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse]
# A result object deserialized from the server's reply
def search_lite request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?

verb, uri, query_string_params, body = ServiceStub.transcode_search_lite_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end

response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Cloud::DiscoveryEngine::V1::SearchResponse.decode_json response.body, ignore_unknown_fields: true

yield result, operation if block_given?
result
end

##
# @private
#
Expand Down Expand Up @@ -136,6 +174,44 @@ def self.transcode_search_request request_pb
)
transcoder.transcode request_pb
end

##
# @private
#
# GRPC transcoding helper method for the search_lite REST call
#
# @param request_pb [::Google::Cloud::DiscoveryEngine::V1::SearchRequest]
# A request object representing the call parameters. Required.
# @return [Array(String, [String, nil], Hash{String => String})]
# Uri, Body, Query string parameters
def self.transcode_search_lite_request request_pb
transcoder = Gapic::Rest::GrpcTranscoder.new
.with_bindings(
uri_method: :post,
uri_template: "/v1/{serving_config}:searchLite",
body: "*",
matches: [
["serving_config", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false]
]
)
.with_bindings(
uri_method: :post,
uri_template: "/v1/{serving_config}:searchLite",
body: "*",
matches: [
["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/servingConfigs/[^/]+/?$}, false]
]
)
.with_bindings(
uri_method: :post,
uri_template: "/v1/{serving_config}:searchLite",
body: "*",
matches: [
["serving_config", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/engines/[^/]+/servingConfigs/[^/]+/?$}, false]
]
)
transcoder.transcode request_pb
end
end
end
end
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading