google-cloud-discovery_engine-v1 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +186 -4
  3. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +181 -4
  4. data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +72 -0
  5. data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +8 -2
  6. data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +8 -2
  7. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb +1 -3
  8. data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb +1 -3
  9. data/lib/google/cloud/discovery_engine/v1/rank_service/client.rb +1 -1
  10. data/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb +1 -1
  11. data/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb +3 -3
  12. data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +3 -3
  13. data/lib/google/cloud/discovery_engine/v1/rest.rb +1 -0
  14. data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +44 -12
  15. data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +44 -12
  16. data/lib/google/cloud/discovery_engine/v1/serving_config_service/client.rb +484 -0
  17. data/lib/google/cloud/discovery_engine/v1/serving_config_service/credentials.rb +47 -0
  18. data/lib/google/cloud/discovery_engine/v1/serving_config_service/paths.rb +101 -0
  19. data/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/client.rb +451 -0
  20. data/lib/google/cloud/discovery_engine/v1/serving_config_service/rest/service_stub.rb +159 -0
  21. data/lib/google/cloud/discovery_engine/v1/serving_config_service/rest.rb +53 -0
  22. data/lib/google/cloud/discovery_engine/v1/serving_config_service.rb +56 -0
  23. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +316 -3
  24. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/paths.rb +49 -0
  25. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +295 -3
  26. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/service_stub.rb +206 -0
  27. data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +21 -9
  28. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +21 -9
  29. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +8 -0
  30. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  31. data/lib/google/cloud/discovery_engine/v1.rb +1 -0
  32. data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +4 -1
  33. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +4 -1
  34. data/lib/google/cloud/discoveryengine/v1/control_pb.rb +7 -1
  35. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +12 -1
  36. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb +8 -0
  37. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +2 -1
  38. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +1 -1
  39. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +1 -1
  40. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +6 -1
  41. data/lib/google/cloud/discoveryengine/v1/import_config_pb.rb +1 -1
  42. data/lib/google/cloud/discoveryengine/v1/safety_pb.rb +47 -0
  43. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +5 -1
  44. data/lib/google/cloud/discoveryengine/v1/serving_config_pb.rb +52 -0
  45. data/lib/google/cloud/discoveryengine/v1/serving_config_service_pb.rb +51 -0
  46. data/lib/google/cloud/discoveryengine/v1/serving_config_service_services_pb.rb +48 -0
  47. data/lib/google/cloud/discoveryengine/v1/session_pb.rb +3 -1
  48. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +2 -1
  49. data/lib/google/cloud/discoveryengine/v1/site_search_engine_service_pb.rb +10 -1
  50. data/lib/google/cloud/discoveryengine/v1/site_search_engine_service_services_pb.rb +7 -0
  51. data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
  52. data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
  53. data/proto_docs/google/api/client.rb +6 -0
  54. data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +53 -2
  55. data/proto_docs/google/cloud/discoveryengine/v1/chunk.rb +2 -1
  56. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +40 -0
  57. data/proto_docs/google/cloud/discoveryengine/v1/control.rb +122 -7
  58. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +159 -2
  59. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +25 -4
  60. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +7 -2
  61. data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +1 -1
  62. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +16 -3
  63. data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +90 -12
  64. data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +19 -1
  65. data/proto_docs/google/cloud/discoveryengine/v1/purge_config.rb +9 -5
  66. data/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb +3 -1
  67. data/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb +3 -3
  68. data/proto_docs/google/cloud/discoveryengine/v1/safety.rb +108 -0
  69. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +109 -8
  70. data/proto_docs/google/cloud/discoveryengine/v1/serving_config.rb +261 -0
  71. data/proto_docs/google/cloud/discoveryengine/v1/serving_config_service.rb +44 -0
  72. data/proto_docs/google/cloud/discoveryengine/v1/session.rb +18 -0
  73. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +19 -2
  74. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine_service.rb +146 -4
  75. data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +34 -0
  76. data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +12 -4
  77. metadata +17 -3
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/discovery_engine/v1/version"
24
+
25
+ require "google/cloud/discovery_engine/v1/serving_config_service/credentials"
26
+ require "google/cloud/discovery_engine/v1/serving_config_service/paths"
27
+ require "google/cloud/discovery_engine/v1/serving_config_service/client"
28
+ require "google/cloud/discovery_engine/v1/serving_config_service/rest"
29
+
30
+ module Google
31
+ module Cloud
32
+ module DiscoveryEngine
33
+ module V1
34
+ ##
35
+ # Service for operations related to
36
+ # {::Google::Cloud::DiscoveryEngine::V1::ServingConfig ServingConfig}.
37
+ #
38
+ # @example Load this service and instantiate a gRPC client
39
+ #
40
+ # require "google/cloud/discovery_engine/v1/serving_config_service"
41
+ # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Client.new
42
+ #
43
+ # @example Load this service and instantiate a REST client
44
+ #
45
+ # require "google/cloud/discovery_engine/v1/serving_config_service/rest"
46
+ # client = ::Google::Cloud::DiscoveryEngine::V1::ServingConfigService::Rest::Client.new
47
+ #
48
+ module ServingConfigService
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+
55
+ helper_path = ::File.join __dir__, "serving_config_service", "helpers.rb"
56
+ require "google/cloud/discovery_engine/v1/serving_config_service/helpers" if ::File.file? helper_path
@@ -912,6 +912,300 @@ module Google
912
912
  raise ::Google::Cloud::Error.from_error(e)
913
913
  end
914
914
 
915
+ ##
916
+ # Creates a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}.
917
+ #
918
+ # @overload create_sitemap(request, options = nil)
919
+ # Pass arguments to `create_sitemap` via a request object, either of type
920
+ # {::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest} or an equivalent Hash.
921
+ #
922
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest, ::Hash]
923
+ # A request object representing the call parameters. Required. To specify no
924
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
925
+ # @param options [::Gapic::CallOptions, ::Hash]
926
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
927
+ #
928
+ # @overload create_sitemap(parent: nil, sitemap: nil)
929
+ # Pass arguments to `create_sitemap` via keyword arguments. Note that at
930
+ # least one keyword argument is required. To specify no parameters, or to keep all
931
+ # the default parameter values, pass an empty Hash as a request object (see above).
932
+ #
933
+ # @param parent [::String]
934
+ # Required. Parent resource name of the
935
+ # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such
936
+ # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
937
+ # @param sitemap [::Google::Cloud::DiscoveryEngine::V1::Sitemap, ::Hash]
938
+ # Required. The {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} to create.
939
+ #
940
+ # @yield [response, operation] Access the result along with the RPC operation
941
+ # @yieldparam response [::Gapic::Operation]
942
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
943
+ #
944
+ # @return [::Gapic::Operation]
945
+ #
946
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
947
+ #
948
+ # @example Basic example
949
+ # require "google/cloud/discovery_engine/v1"
950
+ #
951
+ # # Create a client object. The client can be reused for multiple calls.
952
+ # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new
953
+ #
954
+ # # Create a request. To set request fields, pass in keyword arguments.
955
+ # request = Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest.new
956
+ #
957
+ # # Call the create_sitemap method.
958
+ # result = client.create_sitemap request
959
+ #
960
+ # # The returned object is of type Gapic::Operation. You can use it to
961
+ # # check the status of an operation, cancel it, or wait for results.
962
+ # # Here is how to wait for a response.
963
+ # result.wait_until_done! timeout: 60
964
+ # if result.response?
965
+ # p result.response
966
+ # else
967
+ # puts "No response received."
968
+ # end
969
+ #
970
+ def create_sitemap request, options = nil
971
+ raise ::ArgumentError, "request must be provided" if request.nil?
972
+
973
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSitemapRequest
974
+
975
+ # Converts hash and nil to an options object
976
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
977
+
978
+ # Customize the options with defaults
979
+ metadata = @config.rpcs.create_sitemap.metadata.to_h
980
+
981
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
982
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
983
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
984
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
985
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
986
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
987
+
988
+ header_params = {}
989
+ if request.parent
990
+ header_params["parent"] = request.parent
991
+ end
992
+
993
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
994
+ metadata[:"x-goog-request-params"] ||= request_params_header
995
+
996
+ options.apply_defaults timeout: @config.rpcs.create_sitemap.timeout,
997
+ metadata: metadata,
998
+ retry_policy: @config.rpcs.create_sitemap.retry_policy
999
+
1000
+ options.apply_defaults timeout: @config.timeout,
1001
+ metadata: @config.metadata,
1002
+ retry_policy: @config.retry_policy
1003
+
1004
+ @site_search_engine_service_stub.call_rpc :create_sitemap, request, options: options do |response, operation|
1005
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1006
+ yield response, operation if block_given?
1007
+ throw :response, response
1008
+ end
1009
+ rescue ::GRPC::BadStatus => e
1010
+ raise ::Google::Cloud::Error.from_error(e)
1011
+ end
1012
+
1013
+ ##
1014
+ # Deletes a {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}.
1015
+ #
1016
+ # @overload delete_sitemap(request, options = nil)
1017
+ # Pass arguments to `delete_sitemap` via a request object, either of type
1018
+ # {::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest} or an equivalent Hash.
1019
+ #
1020
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest, ::Hash]
1021
+ # A request object representing the call parameters. Required. To specify no
1022
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1023
+ # @param options [::Gapic::CallOptions, ::Hash]
1024
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1025
+ #
1026
+ # @overload delete_sitemap(name: nil)
1027
+ # Pass arguments to `delete_sitemap` via keyword arguments. Note that at
1028
+ # least one keyword argument is required. To specify no parameters, or to keep all
1029
+ # the default parameter values, pass an empty Hash as a request object (see above).
1030
+ #
1031
+ # @param name [::String]
1032
+ # Required. Full resource name of
1033
+ # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, such as
1034
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}`.
1035
+ #
1036
+ # If the caller does not have permission to access the
1037
+ # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}, regardless of whether
1038
+ # or not it exists, a PERMISSION_DENIED error is returned.
1039
+ #
1040
+ # If the requested {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap} does
1041
+ # not exist, a NOT_FOUND error is returned.
1042
+ #
1043
+ # @yield [response, operation] Access the result along with the RPC operation
1044
+ # @yieldparam response [::Gapic::Operation]
1045
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1046
+ #
1047
+ # @return [::Gapic::Operation]
1048
+ #
1049
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1050
+ #
1051
+ # @example Basic example
1052
+ # require "google/cloud/discovery_engine/v1"
1053
+ #
1054
+ # # Create a client object. The client can be reused for multiple calls.
1055
+ # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new
1056
+ #
1057
+ # # Create a request. To set request fields, pass in keyword arguments.
1058
+ # request = Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest.new
1059
+ #
1060
+ # # Call the delete_sitemap method.
1061
+ # result = client.delete_sitemap request
1062
+ #
1063
+ # # The returned object is of type Gapic::Operation. You can use it to
1064
+ # # check the status of an operation, cancel it, or wait for results.
1065
+ # # Here is how to wait for a response.
1066
+ # result.wait_until_done! timeout: 60
1067
+ # if result.response?
1068
+ # p result.response
1069
+ # else
1070
+ # puts "No response received."
1071
+ # end
1072
+ #
1073
+ def delete_sitemap request, options = nil
1074
+ raise ::ArgumentError, "request must be provided" if request.nil?
1075
+
1076
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSitemapRequest
1077
+
1078
+ # Converts hash and nil to an options object
1079
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1080
+
1081
+ # Customize the options with defaults
1082
+ metadata = @config.rpcs.delete_sitemap.metadata.to_h
1083
+
1084
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1085
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1086
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1087
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
1088
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1089
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1090
+
1091
+ header_params = {}
1092
+ if request.name
1093
+ header_params["name"] = request.name
1094
+ end
1095
+
1096
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1097
+ metadata[:"x-goog-request-params"] ||= request_params_header
1098
+
1099
+ options.apply_defaults timeout: @config.rpcs.delete_sitemap.timeout,
1100
+ metadata: metadata,
1101
+ retry_policy: @config.rpcs.delete_sitemap.retry_policy
1102
+
1103
+ options.apply_defaults timeout: @config.timeout,
1104
+ metadata: @config.metadata,
1105
+ retry_policy: @config.retry_policy
1106
+
1107
+ @site_search_engine_service_stub.call_rpc :delete_sitemap, request, options: options do |response, operation|
1108
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1109
+ yield response, operation if block_given?
1110
+ throw :response, response
1111
+ end
1112
+ rescue ::GRPC::BadStatus => e
1113
+ raise ::Google::Cloud::Error.from_error(e)
1114
+ end
1115
+
1116
+ ##
1117
+ # Fetch {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in a
1118
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}.
1119
+ #
1120
+ # @overload fetch_sitemaps(request, options = nil)
1121
+ # Pass arguments to `fetch_sitemaps` via a request object, either of type
1122
+ # {::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest} or an equivalent Hash.
1123
+ #
1124
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest, ::Hash]
1125
+ # A request object representing the call parameters. Required. To specify no
1126
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1127
+ # @param options [::Gapic::CallOptions, ::Hash]
1128
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1129
+ #
1130
+ # @overload fetch_sitemaps(parent: nil, matcher: nil)
1131
+ # Pass arguments to `fetch_sitemaps` via keyword arguments. Note that at
1132
+ # least one keyword argument is required. To specify no parameters, or to keep all
1133
+ # the default parameter values, pass an empty Hash as a request object (see above).
1134
+ #
1135
+ # @param parent [::String]
1136
+ # Required. Parent resource name of the
1137
+ # {::Google::Cloud::DiscoveryEngine::V1::SiteSearchEngine SiteSearchEngine}, such
1138
+ # as `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine`.
1139
+ # @param matcher [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest::Matcher, ::Hash]
1140
+ # Optional. If specified, fetches the matching
1141
+ # {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s. If not specified,
1142
+ # fetches all {::Google::Cloud::DiscoveryEngine::V1::Sitemap Sitemap}s in the
1143
+ # {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}.
1144
+ #
1145
+ # @yield [response, operation] Access the result along with the RPC operation
1146
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse]
1147
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1148
+ #
1149
+ # @return [::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse]
1150
+ #
1151
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1152
+ #
1153
+ # @example Basic example
1154
+ # require "google/cloud/discovery_engine/v1"
1155
+ #
1156
+ # # Create a client object. The client can be reused for multiple calls.
1157
+ # client = Google::Cloud::DiscoveryEngine::V1::SiteSearchEngineService::Client.new
1158
+ #
1159
+ # # Create a request. To set request fields, pass in keyword arguments.
1160
+ # request = Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest.new
1161
+ #
1162
+ # # Call the fetch_sitemaps method.
1163
+ # result = client.fetch_sitemaps request
1164
+ #
1165
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::FetchSitemapsResponse.
1166
+ # p result
1167
+ #
1168
+ def fetch_sitemaps request, options = nil
1169
+ raise ::ArgumentError, "request must be provided" if request.nil?
1170
+
1171
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::FetchSitemapsRequest
1172
+
1173
+ # Converts hash and nil to an options object
1174
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1175
+
1176
+ # Customize the options with defaults
1177
+ metadata = @config.rpcs.fetch_sitemaps.metadata.to_h
1178
+
1179
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1180
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1181
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1182
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
1183
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1184
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1185
+
1186
+ header_params = {}
1187
+ if request.parent
1188
+ header_params["parent"] = request.parent
1189
+ end
1190
+
1191
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1192
+ metadata[:"x-goog-request-params"] ||= request_params_header
1193
+
1194
+ options.apply_defaults timeout: @config.rpcs.fetch_sitemaps.timeout,
1195
+ metadata: metadata,
1196
+ retry_policy: @config.rpcs.fetch_sitemaps.retry_policy
1197
+
1198
+ options.apply_defaults timeout: @config.timeout,
1199
+ metadata: @config.metadata,
1200
+ retry_policy: @config.retry_policy
1201
+
1202
+ @site_search_engine_service_stub.call_rpc :fetch_sitemaps, request, options: options do |response, operation|
1203
+ yield response, operation if block_given?
1204
+ end
1205
+ rescue ::GRPC::BadStatus => e
1206
+ raise ::Google::Cloud::Error.from_error(e)
1207
+ end
1208
+
915
1209
  ##
916
1210
  # Upgrade from basic site search to advanced site search.
917
1211
  #
@@ -1134,9 +1428,7 @@ module Google
1134
1428
  # {::Google::Cloud::DiscoveryEngine::V1::TargetSite TargetSite} in
1135
1429
  # `site_search_engine`.
1136
1430
  # @param site_credential [::String]
1137
- # Optional. Full resource name of the [SiteCredential][], such as
1138
- # `projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/siteCredentials/*`.
1139
- # Only set to crawl private URIs.
1431
+ # Optional. Credential id to use for crawling.
1140
1432
  #
1141
1433
  # @yield [response, operation] Access the result along with the RPC operation
1142
1434
  # @yieldparam response [::Gapic::Operation]
@@ -1618,6 +1910,21 @@ module Google
1618
1910
  #
1619
1911
  attr_reader :list_target_sites
1620
1912
  ##
1913
+ # RPC-specific configuration for `create_sitemap`
1914
+ # @return [::Gapic::Config::Method]
1915
+ #
1916
+ attr_reader :create_sitemap
1917
+ ##
1918
+ # RPC-specific configuration for `delete_sitemap`
1919
+ # @return [::Gapic::Config::Method]
1920
+ #
1921
+ attr_reader :delete_sitemap
1922
+ ##
1923
+ # RPC-specific configuration for `fetch_sitemaps`
1924
+ # @return [::Gapic::Config::Method]
1925
+ #
1926
+ attr_reader :fetch_sitemaps
1927
+ ##
1621
1928
  # RPC-specific configuration for `enable_advanced_site_search`
1622
1929
  # @return [::Gapic::Config::Method]
1623
1930
  #
@@ -1659,6 +1966,12 @@ module Google
1659
1966
  @delete_target_site = ::Gapic::Config::Method.new delete_target_site_config
1660
1967
  list_target_sites_config = parent_rpcs.list_target_sites if parent_rpcs.respond_to? :list_target_sites
1661
1968
  @list_target_sites = ::Gapic::Config::Method.new list_target_sites_config
1969
+ create_sitemap_config = parent_rpcs.create_sitemap if parent_rpcs.respond_to? :create_sitemap
1970
+ @create_sitemap = ::Gapic::Config::Method.new create_sitemap_config
1971
+ delete_sitemap_config = parent_rpcs.delete_sitemap if parent_rpcs.respond_to? :delete_sitemap
1972
+ @delete_sitemap = ::Gapic::Config::Method.new delete_sitemap_config
1973
+ fetch_sitemaps_config = parent_rpcs.fetch_sitemaps if parent_rpcs.respond_to? :fetch_sitemaps
1974
+ @fetch_sitemaps = ::Gapic::Config::Method.new fetch_sitemaps_config
1662
1975
  enable_advanced_site_search_config = parent_rpcs.enable_advanced_site_search if parent_rpcs.respond_to? :enable_advanced_site_search
1663
1976
  @enable_advanced_site_search = ::Gapic::Config::Method.new enable_advanced_site_search_config
1664
1977
  disable_advanced_site_search_config = parent_rpcs.disable_advanced_site_search if parent_rpcs.respond_to? :disable_advanced_site_search
@@ -69,6 +69,55 @@ module Google
69
69
  resource.call(**args)
70
70
  end
71
71
 
72
+ ##
73
+ # Create a fully-qualified Sitemap resource string.
74
+ #
75
+ # @overload sitemap_path(project:, location:, data_store:, sitemap:)
76
+ # The resource will be in the following format:
77
+ #
78
+ # `projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}`
79
+ #
80
+ # @param project [String]
81
+ # @param location [String]
82
+ # @param data_store [String]
83
+ # @param sitemap [String]
84
+ #
85
+ # @overload sitemap_path(project:, location:, collection:, data_store:, sitemap:)
86
+ # The resource will be in the following format:
87
+ #
88
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine/sitemaps/{sitemap}`
89
+ #
90
+ # @param project [String]
91
+ # @param location [String]
92
+ # @param collection [String]
93
+ # @param data_store [String]
94
+ # @param sitemap [String]
95
+ #
96
+ # @return [::String]
97
+ def sitemap_path **args
98
+ resources = {
99
+ "data_store:location:project:sitemap" => (proc do |project:, location:, data_store:, sitemap:|
100
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
101
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
102
+ raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
103
+
104
+ "projects/#{project}/locations/#{location}/dataStores/#{data_store}/siteSearchEngine/sitemaps/#{sitemap}"
105
+ end),
106
+ "collection:data_store:location:project:sitemap" => (proc do |project:, location:, collection:, data_store:, sitemap:|
107
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
108
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
109
+ raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
110
+ raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
111
+
112
+ "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/siteSearchEngine/sitemaps/#{sitemap}"
113
+ end)
114
+ }
115
+
116
+ resource = resources[args.keys.sort.join(":")]
117
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
118
+ resource.call(**args)
119
+ end
120
+
72
121
  ##
73
122
  # Create a fully-qualified TargetSite resource string.
74
123
  #