google-cloud-ai_platform-v1 0.35.0 → 0.36.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -99
  3. data/lib/google/cloud/ai_platform/v1/dataset_service/client.rb +43 -17
  4. data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +28 -6
  5. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb +896 -0
  6. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/credentials.rb +47 -0
  7. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb +809 -0
  8. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/paths.rb +83 -0
  9. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service.rb +50 -0
  10. data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +43 -17
  11. data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +28 -6
  12. data/lib/google/cloud/ai_platform/v1/endpoint_service/paths.rb +19 -0
  13. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb +46 -18
  14. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +28 -6
  15. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb +146 -17
  16. data/lib/google/cloud/ai_platform/v1/feature_online_store_service.rb +2 -0
  17. data/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb +44 -18
  18. data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +28 -6
  19. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb +42 -17
  20. data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +44 -18
  21. data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +28 -6
  22. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +43 -17
  23. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +28 -6
  24. data/lib/google/cloud/ai_platform/v1/index_service/client.rb +52 -18
  25. data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +28 -6
  26. data/lib/google/cloud/ai_platform/v1/job_service/client.rb +43 -17
  27. data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +28 -6
  28. data/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb +49 -18
  29. data/lib/google/cloud/ai_platform/v1/match_service/client.rb +42 -17
  30. data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +43 -17
  31. data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +28 -6
  32. data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +43 -17
  33. data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +28 -6
  34. data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +42 -17
  35. data/lib/google/cloud/ai_platform/v1/model_service/client.rb +47 -21
  36. data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +28 -6
  37. data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +43 -17
  38. data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +28 -6
  39. data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +544 -20
  40. data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +43 -17
  41. data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +28 -6
  42. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +43 -17
  43. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +28 -6
  44. data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +43 -17
  45. data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +28 -6
  46. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  47. data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +43 -17
  48. data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +28 -6
  49. data/lib/google/cloud/ai_platform/v1.rb +1 -0
  50. data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -1
  51. data/lib/google/cloud/aiplatform/v1/annotation_pb.rb +1 -1
  52. data/lib/google/cloud/aiplatform/v1/annotation_spec_pb.rb +1 -1
  53. data/lib/google/cloud/aiplatform/v1/artifact_pb.rb +1 -1
  54. data/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb +1 -1
  55. data/lib/google/cloud/aiplatform/v1/completion_stats_pb.rb +1 -1
  56. data/lib/google/cloud/aiplatform/v1/content_pb.rb +64 -0
  57. data/lib/google/cloud/aiplatform/v1/context_pb.rb +1 -1
  58. data/lib/google/cloud/aiplatform/v1/custom_job_pb.rb +2 -2
  59. data/lib/google/cloud/aiplatform/v1/data_item_pb.rb +1 -1
  60. data/lib/google/cloud/aiplatform/v1/data_labeling_job_pb.rb +1 -1
  61. data/lib/google/cloud/aiplatform/v1/dataset_pb.rb +4 -2
  62. data/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb +4 -2
  63. data/lib/google/cloud/aiplatform/v1/dataset_version_pb.rb +1 -1
  64. data/lib/google/cloud/aiplatform/v1/deployed_index_ref_pb.rb +2 -2
  65. data/lib/google/cloud/aiplatform/v1/deployed_model_ref_pb.rb +1 -1
  66. data/lib/google/cloud/aiplatform/v1/deployment_resource_pool_pb.rb +49 -0
  67. data/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_pb.rb +65 -0
  68. data/lib/google/cloud/aiplatform/v1/deployment_resource_pool_service_services_pb.rb +53 -0
  69. data/lib/google/cloud/aiplatform/v1/encryption_spec_pb.rb +1 -1
  70. data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +2 -2
  71. data/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb +2 -2
  72. data/lib/google/cloud/aiplatform/v1/entity_type_pb.rb +1 -1
  73. data/lib/google/cloud/aiplatform/v1/env_var_pb.rb +1 -1
  74. data/lib/google/cloud/aiplatform/v1/evaluated_annotation_pb.rb +1 -1
  75. data/lib/google/cloud/aiplatform/v1/event_pb.rb +1 -1
  76. data/lib/google/cloud/aiplatform/v1/execution_pb.rb +1 -1
  77. data/lib/google/cloud/aiplatform/v1/explanation_metadata_pb.rb +1 -1
  78. data/lib/google/cloud/aiplatform/v1/explanation_pb.rb +1 -1
  79. data/lib/google/cloud/aiplatform/v1/feature_group_pb.rb +2 -2
  80. data/lib/google/cloud/aiplatform/v1/feature_monitoring_stats_pb.rb +1 -1
  81. data/lib/google/cloud/aiplatform/v1/feature_online_store_admin_service_pb.rb +2 -2
  82. data/lib/google/cloud/aiplatform/v1/feature_online_store_pb.rb +2 -2
  83. data/lib/google/cloud/aiplatform/v1/feature_online_store_service_pb.rb +10 -2
  84. data/lib/google/cloud/aiplatform/v1/feature_online_store_service_services_pb.rb +5 -0
  85. data/lib/google/cloud/aiplatform/v1/feature_pb.rb +2 -2
  86. data/lib/google/cloud/aiplatform/v1/feature_registry_service_pb.rb +2 -2
  87. data/lib/google/cloud/aiplatform/v1/feature_selector_pb.rb +1 -1
  88. data/lib/google/cloud/aiplatform/v1/feature_view_pb.rb +2 -2
  89. data/lib/google/cloud/aiplatform/v1/feature_view_sync_pb.rb +2 -2
  90. data/lib/google/cloud/aiplatform/v1/featurestore_monitoring_pb.rb +1 -1
  91. data/lib/google/cloud/aiplatform/v1/featurestore_online_service_pb.rb +2 -2
  92. data/lib/google/cloud/aiplatform/v1/featurestore_pb.rb +1 -1
  93. data/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb +2 -2
  94. data/lib/google/cloud/aiplatform/v1/hyperparameter_tuning_job_pb.rb +1 -1
  95. data/lib/google/cloud/aiplatform/v1/index_endpoint_pb.rb +2 -2
  96. data/lib/google/cloud/aiplatform/v1/index_endpoint_service_pb.rb +2 -2
  97. data/lib/google/cloud/aiplatform/v1/index_pb.rb +1 -1
  98. data/lib/google/cloud/aiplatform/v1/index_service_pb.rb +2 -2
  99. data/lib/google/cloud/aiplatform/v1/io_pb.rb +1 -1
  100. data/lib/google/cloud/aiplatform/v1/job_service_pb.rb +2 -2
  101. data/lib/google/cloud/aiplatform/v1/job_state_pb.rb +1 -1
  102. data/lib/google/cloud/aiplatform/v1/lineage_subgraph_pb.rb +1 -1
  103. data/lib/google/cloud/aiplatform/v1/llm_utility_service_pb.rb +2 -2
  104. data/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb +1 -1
  105. data/lib/google/cloud/aiplatform/v1/manual_batch_tuning_parameters_pb.rb +1 -1
  106. data/lib/google/cloud/aiplatform/v1/match_service_pb.rb +1 -1
  107. data/lib/google/cloud/aiplatform/v1/metadata_schema_pb.rb +1 -1
  108. data/lib/google/cloud/aiplatform/v1/metadata_service_pb.rb +2 -2
  109. data/lib/google/cloud/aiplatform/v1/metadata_store_pb.rb +1 -1
  110. data/lib/google/cloud/aiplatform/v1/migratable_resource_pb.rb +1 -1
  111. data/lib/google/cloud/aiplatform/v1/migration_service_pb.rb +2 -2
  112. data/lib/google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb.rb +2 -2
  113. data/lib/google/cloud/aiplatform/v1/model_evaluation_pb.rb +1 -1
  114. data/lib/google/cloud/aiplatform/v1/model_evaluation_slice_pb.rb +1 -1
  115. data/lib/google/cloud/aiplatform/v1/model_garden_service_pb.rb +2 -2
  116. data/lib/google/cloud/aiplatform/v1/model_monitoring_pb.rb +1 -1
  117. data/lib/google/cloud/aiplatform/v1/model_pb.rb +3 -2
  118. data/lib/google/cloud/aiplatform/v1/model_service_pb.rb +2 -2
  119. data/lib/google/cloud/aiplatform/v1/nas_job_pb.rb +1 -1
  120. data/lib/google/cloud/aiplatform/v1/openapi_pb.rb +47 -0
  121. data/lib/google/cloud/aiplatform/v1/operation_pb.rb +1 -1
  122. data/lib/google/cloud/aiplatform/v1/pipeline_failure_policy_pb.rb +1 -1
  123. data/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb +1 -1
  124. data/lib/google/cloud/aiplatform/v1/pipeline_service_pb.rb +2 -2
  125. data/lib/google/cloud/aiplatform/v1/pipeline_state_pb.rb +1 -1
  126. data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +16 -2
  127. data/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb +16 -3
  128. data/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb +6 -2
  129. data/lib/google/cloud/aiplatform/v1/saved_query_pb.rb +1 -1
  130. data/lib/google/cloud/aiplatform/v1/schedule_pb.rb +1 -1
  131. data/lib/google/cloud/aiplatform/v1/schedule_service_pb.rb +2 -2
  132. data/lib/google/cloud/aiplatform/v1/service_networking_pb.rb +4 -2
  133. data/lib/google/cloud/aiplatform/v1/specialist_pool_pb.rb +1 -1
  134. data/lib/google/cloud/aiplatform/v1/specialist_pool_service_pb.rb +2 -2
  135. data/lib/google/cloud/aiplatform/v1/study_pb.rb +1 -1
  136. data/lib/google/cloud/aiplatform/v1/tensorboard_data_pb.rb +1 -1
  137. data/lib/google/cloud/aiplatform/v1/tensorboard_experiment_pb.rb +1 -1
  138. data/lib/google/cloud/aiplatform/v1/tensorboard_pb.rb +1 -1
  139. data/lib/google/cloud/aiplatform/v1/tensorboard_run_pb.rb +1 -1
  140. data/lib/google/cloud/aiplatform/v1/tensorboard_service_pb.rb +2 -2
  141. data/lib/google/cloud/aiplatform/v1/tensorboard_time_series_pb.rb +1 -1
  142. data/lib/google/cloud/aiplatform/v1/tool_pb.rb +51 -0
  143. data/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb +1 -1
  144. data/lib/google/cloud/aiplatform/v1/types_pb.rb +1 -1
  145. data/lib/google/cloud/aiplatform/v1/unmanaged_container_model_pb.rb +1 -1
  146. data/lib/google/cloud/aiplatform/v1/user_action_reference_pb.rb +1 -1
  147. data/lib/google/cloud/aiplatform/v1/value_pb.rb +1 -1
  148. data/lib/google/cloud/aiplatform/v1/vizier_service_pb.rb +2 -2
  149. data/proto_docs/google/api/client.rb +1 -0
  150. data/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb +2 -2
  151. data/proto_docs/google/cloud/aiplatform/v1/content.rb +312 -0
  152. data/proto_docs/google/cloud/aiplatform/v1/custom_job.rb +15 -0
  153. data/proto_docs/google/cloud/aiplatform/v1/dataset.rb +102 -0
  154. data/proto_docs/google/cloud/aiplatform/v1/dataset_service.rb +12 -1
  155. data/proto_docs/google/cloud/aiplatform/v1/deployed_index_ref.rb +3 -0
  156. data/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool.rb +45 -0
  157. data/proto_docs/google/cloud/aiplatform/v1/deployment_resource_pool_service.rb +170 -0
  158. data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +6 -0
  159. data/proto_docs/google/cloud/aiplatform/v1/explanation.rb +8 -0
  160. data/proto_docs/google/cloud/aiplatform/v1/feature.rb +5 -1
  161. data/proto_docs/google/cloud/aiplatform/v1/feature_group.rb +2 -2
  162. data/proto_docs/google/cloud/aiplatform/v1/feature_online_store.rb +2 -2
  163. data/proto_docs/google/cloud/aiplatform/v1/feature_online_store_admin_service.rb +3 -1
  164. data/proto_docs/google/cloud/aiplatform/v1/feature_online_store_service.rb +136 -0
  165. data/proto_docs/google/cloud/aiplatform/v1/feature_view.rb +3 -2
  166. data/proto_docs/google/cloud/aiplatform/v1/feature_view_sync.rb +2 -2
  167. data/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb +1 -1
  168. data/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb +5 -0
  169. data/proto_docs/google/cloud/aiplatform/v1/index_service.rb +28 -0
  170. data/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb +1 -0
  171. data/proto_docs/google/cloud/aiplatform/v1/model.rb +55 -4
  172. data/proto_docs/google/cloud/aiplatform/v1/model_deployment_monitoring_job.rb +4 -0
  173. data/proto_docs/google/cloud/aiplatform/v1/model_evaluation.rb +1 -1
  174. data/proto_docs/google/cloud/aiplatform/v1/model_monitoring.rb +1 -0
  175. data/proto_docs/google/cloud/aiplatform/v1/model_service.rb +4 -4
  176. data/proto_docs/google/cloud/aiplatform/v1/nas_job.rb +1 -0
  177. data/proto_docs/google/cloud/aiplatform/v1/openapi.rb +102 -0
  178. data/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb +1 -0
  179. data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +195 -0
  180. data/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb +73 -1
  181. data/proto_docs/google/cloud/aiplatform/v1/service_networking.rb +16 -0
  182. data/proto_docs/google/cloud/aiplatform/v1/tool.rb +112 -0
  183. data/proto_docs/google/protobuf/any.rb +2 -1
  184. data/proto_docs/google/type/date.rb +53 -0
  185. metadata +26 -9
@@ -29,7 +29,12 @@ module Google
29
29
  ##
30
30
  # Client for the FeatureOnlineStoreService service.
31
31
  #
32
+ # A service for fetching feature values from the online store.
33
+ #
32
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
37
+
33
38
  include Paths
34
39
 
35
40
  # @private
@@ -90,6 +95,15 @@ module Google
90
95
  @config
91
96
  end
92
97
 
98
+ ##
99
+ # The effective universe domain
100
+ #
101
+ # @return [String]
102
+ #
103
+ def universe_domain
104
+ @feature_online_store_service_stub.universe_domain
105
+ end
106
+
93
107
  ##
94
108
  # Create a new FeatureOnlineStoreService client object.
95
109
  #
@@ -123,8 +137,9 @@ module Google
123
137
  credentials = @config.credentials
124
138
  # Use self-signed JWT if the endpoint is unchanged from default,
125
139
  # but only if the default endpoint does not have a region prefix.
126
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
127
- !@config.endpoint.split(".").first.include?("-")
140
+ enable_self_signed_jwt = @config.endpoint.nil? ||
141
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
+ !@config.endpoint.split(".").first.include?("-"))
128
143
  credentials ||= Credentials.default scope: @config.scope,
129
144
  enable_self_signed_jwt: enable_self_signed_jwt
130
145
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -133,26 +148,30 @@ module Google
133
148
  @quota_project_id = @config.quota_project
134
149
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
135
150
 
151
+ @feature_online_store_service_stub = ::Gapic::ServiceStub.new(
152
+ ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Stub,
153
+ credentials: credentials,
154
+ endpoint: @config.endpoint,
155
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
156
+ universe_domain: @config.universe_domain,
157
+ channel_args: @config.channel_args,
158
+ interceptors: @config.interceptors,
159
+ channel_pool_config: @config.channel_pool
160
+ )
161
+
136
162
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
137
163
  config.credentials = credentials
138
164
  config.quota_project = @quota_project_id
139
- config.endpoint = @config.endpoint
165
+ config.endpoint = @feature_online_store_service_stub.endpoint
166
+ config.universe_domain = @feature_online_store_service_stub.universe_domain
140
167
  end
141
168
 
142
169
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
143
170
  config.credentials = credentials
144
171
  config.quota_project = @quota_project_id
145
- config.endpoint = @config.endpoint
172
+ config.endpoint = @feature_online_store_service_stub.endpoint
173
+ config.universe_domain = @feature_online_store_service_stub.universe_domain
146
174
  end
147
-
148
- @feature_online_store_service_stub = ::Gapic::ServiceStub.new(
149
- ::Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Stub,
150
- credentials: credentials,
151
- endpoint: @config.endpoint,
152
- channel_args: @config.channel_args,
153
- interceptors: @config.interceptors,
154
- channel_pool_config: @config.channel_pool
155
- )
156
175
  end
157
176
 
158
177
  ##
@@ -263,6 +282,101 @@ module Google
263
282
  raise ::Google::Cloud::Error.from_error(e)
264
283
  end
265
284
 
285
+ ##
286
+ # Search the nearest entities under a FeatureView.
287
+ # Search only works for indexable feature view; if a feature view isn't
288
+ # indexable, returns Invalid argument response.
289
+ #
290
+ # @overload search_nearest_entities(request, options = nil)
291
+ # Pass arguments to `search_nearest_entities` via a request object, either of type
292
+ # {::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest} or an equivalent Hash.
293
+ #
294
+ # @param request [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest, ::Hash]
295
+ # A request object representing the call parameters. Required. To specify no
296
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
297
+ # @param options [::Gapic::CallOptions, ::Hash]
298
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
299
+ #
300
+ # @overload search_nearest_entities(feature_view: nil, query: nil, return_full_entity: nil)
301
+ # Pass arguments to `search_nearest_entities` via keyword arguments. Note that at
302
+ # least one keyword argument is required. To specify no parameters, or to keep all
303
+ # the default parameter values, pass an empty Hash as a request object (see above).
304
+ #
305
+ # @param feature_view [::String]
306
+ # Required. FeatureView resource format
307
+ # `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}`
308
+ # @param query [::Google::Cloud::AIPlatform::V1::NearestNeighborQuery, ::Hash]
309
+ # Required. The query.
310
+ # @param return_full_entity [::Boolean]
311
+ # Optional. If set to true, the full entities (including all vector values
312
+ # and metadata) of the nearest neighbors are returned; otherwise only entity
313
+ # id of the nearest neighbors will be returned. Note that returning full
314
+ # entities will significantly increase the latency and cost of the query.
315
+ #
316
+ # @yield [response, operation] Access the result along with the RPC operation
317
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse]
318
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
319
+ #
320
+ # @return [::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse]
321
+ #
322
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
323
+ #
324
+ # @example Basic example
325
+ # require "google/cloud/ai_platform/v1"
326
+ #
327
+ # # Create a client object. The client can be reused for multiple calls.
328
+ # client = Google::Cloud::AIPlatform::V1::FeatureOnlineStoreService::Client.new
329
+ #
330
+ # # Create a request. To set request fields, pass in keyword arguments.
331
+ # request = Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest.new
332
+ #
333
+ # # Call the search_nearest_entities method.
334
+ # result = client.search_nearest_entities request
335
+ #
336
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::SearchNearestEntitiesResponse.
337
+ # p result
338
+ #
339
+ def search_nearest_entities request, options = nil
340
+ raise ::ArgumentError, "request must be provided" if request.nil?
341
+
342
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::SearchNearestEntitiesRequest
343
+
344
+ # Converts hash and nil to an options object
345
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
346
+
347
+ # Customize the options with defaults
348
+ metadata = @config.rpcs.search_nearest_entities.metadata.to_h
349
+
350
+ # Set x-goog-api-client and x-goog-user-project headers
351
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
352
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
353
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
354
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
355
+
356
+ header_params = {}
357
+ if request.feature_view
358
+ header_params["feature_view"] = request.feature_view
359
+ end
360
+
361
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
362
+ metadata[:"x-goog-request-params"] ||= request_params_header
363
+
364
+ options.apply_defaults timeout: @config.rpcs.search_nearest_entities.timeout,
365
+ metadata: metadata,
366
+ retry_policy: @config.rpcs.search_nearest_entities.retry_policy
367
+
368
+ options.apply_defaults timeout: @config.timeout,
369
+ metadata: @config.metadata,
370
+ retry_policy: @config.retry_policy
371
+
372
+ @feature_online_store_service_stub.call_rpc :search_nearest_entities, request, options: options do |response, operation|
373
+ yield response, operation if block_given?
374
+ return response
375
+ end
376
+ rescue ::GRPC::BadStatus => e
377
+ raise ::Google::Cloud::Error.from_error(e)
378
+ end
379
+
266
380
  ##
267
381
  # Configuration class for the FeatureOnlineStoreService API.
268
382
  #
@@ -293,9 +407,9 @@ module Google
293
407
  # end
294
408
  #
295
409
  # @!attribute [rw] endpoint
296
- # The hostname or hostname:port of the service endpoint.
297
- # Defaults to `"aiplatform.googleapis.com"`.
298
- # @return [::String]
410
+ # A custom service endpoint, as a hostname or hostname:port. The default is
411
+ # nil, indicating to use the default endpoint in the current universe domain.
412
+ # @return [::String,nil]
299
413
  # @!attribute [rw] credentials
300
414
  # Credentials to send with calls. You may provide any of the following types:
301
415
  # * (`String`) The path to a service account key file in JSON format
@@ -341,13 +455,20 @@ module Google
341
455
  # @!attribute [rw] quota_project
342
456
  # A separate project against which to charge quota.
343
457
  # @return [::String]
458
+ # @!attribute [rw] universe_domain
459
+ # The universe domain within which to make requests. This determines the
460
+ # default endpoint URL. The default value of nil uses the environment
461
+ # universe (usually the default "googleapis.com" universe).
462
+ # @return [::String,nil]
344
463
  #
345
464
  class Configuration
346
465
  extend ::Gapic::Config
347
466
 
467
+ # @private
468
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
348
469
  DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
349
470
 
350
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
471
+ config_attr :endpoint, nil, ::String, nil
351
472
  config_attr :credentials, nil do |value|
352
473
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
353
474
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -362,6 +483,7 @@ module Google
362
483
  config_attr :metadata, nil, ::Hash, nil
363
484
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
364
485
  config_attr :quota_project, nil, ::String, nil
486
+ config_attr :universe_domain, nil, ::String, nil
365
487
 
366
488
  # @private
367
489
  def initialize parent_config = nil
@@ -413,11 +535,18 @@ module Google
413
535
  # @return [::Gapic::Config::Method]
414
536
  #
415
537
  attr_reader :fetch_feature_values
538
+ ##
539
+ # RPC-specific configuration for `search_nearest_entities`
540
+ # @return [::Gapic::Config::Method]
541
+ #
542
+ attr_reader :search_nearest_entities
416
543
 
417
544
  # @private
418
545
  def initialize parent_rpcs = nil
419
546
  fetch_feature_values_config = parent_rpcs.fetch_feature_values if parent_rpcs.respond_to? :fetch_feature_values
420
547
  @fetch_feature_values = ::Gapic::Config::Method.new fetch_feature_values_config
548
+ search_nearest_entities_config = parent_rpcs.search_nearest_entities if parent_rpcs.respond_to? :search_nearest_entities
549
+ @search_nearest_entities = ::Gapic::Config::Method.new search_nearest_entities_config
421
550
 
422
551
  yield self if block_given?
423
552
  end
@@ -31,6 +31,8 @@ module Google
31
31
  module AIPlatform
32
32
  module V1
33
33
  ##
34
+ # A service for fetching feature values from the online store.
35
+ #
34
36
  # @example Load this service and instantiate a gRPC client
35
37
  #
36
38
  # require "google/cloud/ai_platform/v1/feature_online_store_service"
@@ -33,6 +33,9 @@ module Google
33
33
  # FeatureRegistry.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
38
+
36
39
  include Paths
37
40
 
38
41
  # @private
@@ -93,6 +96,15 @@ module Google
93
96
  @config
94
97
  end
95
98
 
99
+ ##
100
+ # The effective universe domain
101
+ #
102
+ # @return [String]
103
+ #
104
+ def universe_domain
105
+ @feature_registry_service_stub.universe_domain
106
+ end
107
+
96
108
  ##
97
109
  # Create a new FeatureRegistryService client object.
98
110
  #
@@ -126,8 +138,9 @@ module Google
126
138
  credentials = @config.credentials
127
139
  # Use self-signed JWT if the endpoint is unchanged from default,
128
140
  # but only if the default endpoint does not have a region prefix.
129
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
130
- !@config.endpoint.split(".").first.include?("-")
141
+ enable_self_signed_jwt = @config.endpoint.nil? ||
142
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
143
+ !@config.endpoint.split(".").first.include?("-"))
131
144
  credentials ||= Credentials.default scope: @config.scope,
132
145
  enable_self_signed_jwt: enable_self_signed_jwt
133
146
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -140,28 +153,33 @@ module Google
140
153
  config.credentials = credentials
141
154
  config.quota_project = @quota_project_id
142
155
  config.endpoint = @config.endpoint
156
+ config.universe_domain = @config.universe_domain
143
157
  end
144
158
 
159
+ @feature_registry_service_stub = ::Gapic::ServiceStub.new(
160
+ ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Stub,
161
+ credentials: credentials,
162
+ endpoint: @config.endpoint,
163
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
164
+ universe_domain: @config.universe_domain,
165
+ channel_args: @config.channel_args,
166
+ interceptors: @config.interceptors,
167
+ channel_pool_config: @config.channel_pool
168
+ )
169
+
145
170
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
146
171
  config.credentials = credentials
147
172
  config.quota_project = @quota_project_id
148
- config.endpoint = @config.endpoint
173
+ config.endpoint = @feature_registry_service_stub.endpoint
174
+ config.universe_domain = @feature_registry_service_stub.universe_domain
149
175
  end
150
176
 
151
177
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
152
178
  config.credentials = credentials
153
179
  config.quota_project = @quota_project_id
154
- config.endpoint = @config.endpoint
180
+ config.endpoint = @feature_registry_service_stub.endpoint
181
+ config.universe_domain = @feature_registry_service_stub.universe_domain
155
182
  end
156
-
157
- @feature_registry_service_stub = ::Gapic::ServiceStub.new(
158
- ::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Stub,
159
- credentials: credentials,
160
- endpoint: @config.endpoint,
161
- channel_args: @config.channel_args,
162
- interceptors: @config.interceptors,
163
- channel_pool_config: @config.channel_pool
164
- )
165
183
  end
166
184
 
167
185
  ##
@@ -968,7 +986,7 @@ module Google
968
986
  #
969
987
  # When paginating, all other parameters provided to
970
988
  # {::Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features FeaturestoreService.ListFeatures}
971
- # or or
989
+ # or
972
990
  # {::Google::Cloud::AIPlatform::V1::FeatureRegistryService::Client#list_features FeatureRegistryService.ListFeatures}
973
991
  # must match the call that provided the page token.
974
992
  # @param order_by [::String]
@@ -1297,9 +1315,9 @@ module Google
1297
1315
  # end
1298
1316
  #
1299
1317
  # @!attribute [rw] endpoint
1300
- # The hostname or hostname:port of the service endpoint.
1301
- # Defaults to `"aiplatform.googleapis.com"`.
1302
- # @return [::String]
1318
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1319
+ # nil, indicating to use the default endpoint in the current universe domain.
1320
+ # @return [::String,nil]
1303
1321
  # @!attribute [rw] credentials
1304
1322
  # Credentials to send with calls. You may provide any of the following types:
1305
1323
  # * (`String`) The path to a service account key file in JSON format
@@ -1345,13 +1363,20 @@ module Google
1345
1363
  # @!attribute [rw] quota_project
1346
1364
  # A separate project against which to charge quota.
1347
1365
  # @return [::String]
1366
+ # @!attribute [rw] universe_domain
1367
+ # The universe domain within which to make requests. This determines the
1368
+ # default endpoint URL. The default value of nil uses the environment
1369
+ # universe (usually the default "googleapis.com" universe).
1370
+ # @return [::String,nil]
1348
1371
  #
1349
1372
  class Configuration
1350
1373
  extend ::Gapic::Config
1351
1374
 
1375
+ # @private
1376
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1352
1377
  DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
1353
1378
 
1354
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1379
+ config_attr :endpoint, nil, ::String, nil
1355
1380
  config_attr :credentials, nil do |value|
1356
1381
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1357
1382
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1366,6 +1391,7 @@ module Google
1366
1391
  config_attr :metadata, nil, ::Hash, nil
1367
1392
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1368
1393
  config_attr :quota_project, nil, ::String, nil
1394
+ config_attr :universe_domain, nil, ::String, nil
1369
1395
 
1370
1396
  # @private
1371
1397
  def initialize parent_config = nil
@@ -26,6 +26,9 @@ module Google
26
26
  module FeatureRegistryService
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
31
+
29
32
  # @private
30
33
  attr_reader :operations_stub
31
34
 
@@ -60,6 +63,15 @@ module Google
60
63
  @config
61
64
  end
62
65
 
66
+ ##
67
+ # The effective universe domain
68
+ #
69
+ # @return [String]
70
+ #
71
+ def universe_domain
72
+ @operations_stub.universe_domain
73
+ end
74
+
63
75
  ##
64
76
  # Create a new Operations client object.
65
77
  #
@@ -90,8 +102,10 @@ module Google
90
102
 
91
103
  @operations_stub = ::Gapic::ServiceStub.new(
92
104
  ::Google::Longrunning::Operations::Stub,
93
- credentials: credentials,
94
- endpoint: @config.endpoint,
105
+ credentials: credentials,
106
+ endpoint: @config.endpoint,
107
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
108
+ universe_domain: @config.universe_domain,
95
109
  channel_args: @config.channel_args,
96
110
  interceptors: @config.interceptors,
97
111
  channel_pool_config: @config.channel_pool
@@ -621,9 +635,9 @@ module Google
621
635
  # end
622
636
  #
623
637
  # @!attribute [rw] endpoint
624
- # The hostname or hostname:port of the service endpoint.
625
- # Defaults to `"aiplatform.googleapis.com"`.
626
- # @return [::String]
638
+ # A custom service endpoint, as a hostname or hostname:port. The default is
639
+ # nil, indicating to use the default endpoint in the current universe domain.
640
+ # @return [::String,nil]
627
641
  # @!attribute [rw] credentials
628
642
  # Credentials to send with calls. You may provide any of the following types:
629
643
  # * (`String`) The path to a service account key file in JSON format
@@ -669,13 +683,20 @@ module Google
669
683
  # @!attribute [rw] quota_project
670
684
  # A separate project against which to charge quota.
671
685
  # @return [::String]
686
+ # @!attribute [rw] universe_domain
687
+ # The universe domain within which to make requests. This determines the
688
+ # default endpoint URL. The default value of nil uses the environment
689
+ # universe (usually the default "googleapis.com" universe).
690
+ # @return [::String,nil]
672
691
  #
673
692
  class Configuration
674
693
  extend ::Gapic::Config
675
694
 
695
+ # @private
696
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
676
697
  DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
677
698
 
678
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
699
+ config_attr :endpoint, nil, ::String, nil
679
700
  config_attr :credentials, nil do |value|
680
701
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
681
702
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -690,6 +711,7 @@ module Google
690
711
  config_attr :metadata, nil, ::Hash, nil
691
712
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
692
713
  config_attr :quota_project, nil, ::String, nil
714
+ config_attr :universe_domain, nil, ::String, nil
693
715
 
694
716
  # @private
695
717
  def initialize parent_config = nil
@@ -32,6 +32,9 @@ module Google
32
32
  # A service for serving online feature values.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
37
+
35
38
  include Paths
36
39
 
37
40
  # @private
@@ -92,6 +95,15 @@ module Google
92
95
  @config
93
96
  end
94
97
 
98
+ ##
99
+ # The effective universe domain
100
+ #
101
+ # @return [String]
102
+ #
103
+ def universe_domain
104
+ @featurestore_online_serving_service_stub.universe_domain
105
+ end
106
+
95
107
  ##
96
108
  # Create a new FeaturestoreOnlineServingService client object.
97
109
  #
@@ -125,8 +137,9 @@ module Google
125
137
  credentials = @config.credentials
126
138
  # Use self-signed JWT if the endpoint is unchanged from default,
127
139
  # but only if the default endpoint does not have a region prefix.
128
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
129
- !@config.endpoint.split(".").first.include?("-")
140
+ enable_self_signed_jwt = @config.endpoint.nil? ||
141
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
+ !@config.endpoint.split(".").first.include?("-"))
130
143
  credentials ||= Credentials.default scope: @config.scope,
131
144
  enable_self_signed_jwt: enable_self_signed_jwt
132
145
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -135,26 +148,30 @@ module Google
135
148
  @quota_project_id = @config.quota_project
136
149
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
137
150
 
151
+ @featurestore_online_serving_service_stub = ::Gapic::ServiceStub.new(
152
+ ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Stub,
153
+ credentials: credentials,
154
+ endpoint: @config.endpoint,
155
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
156
+ universe_domain: @config.universe_domain,
157
+ channel_args: @config.channel_args,
158
+ interceptors: @config.interceptors,
159
+ channel_pool_config: @config.channel_pool
160
+ )
161
+
138
162
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
139
163
  config.credentials = credentials
140
164
  config.quota_project = @quota_project_id
141
- config.endpoint = @config.endpoint
165
+ config.endpoint = @featurestore_online_serving_service_stub.endpoint
166
+ config.universe_domain = @featurestore_online_serving_service_stub.universe_domain
142
167
  end
143
168
 
144
169
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
145
170
  config.credentials = credentials
146
171
  config.quota_project = @quota_project_id
147
- config.endpoint = @config.endpoint
172
+ config.endpoint = @featurestore_online_serving_service_stub.endpoint
173
+ config.universe_domain = @featurestore_online_serving_service_stub.universe_domain
148
174
  end
149
-
150
- @featurestore_online_serving_service_stub = ::Gapic::ServiceStub.new(
151
- ::Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Stub,
152
- credentials: credentials,
153
- endpoint: @config.endpoint,
154
- channel_args: @config.channel_args,
155
- interceptors: @config.interceptors,
156
- channel_pool_config: @config.channel_pool
157
- )
158
175
  end
159
176
 
160
177
  ##
@@ -499,9 +516,9 @@ module Google
499
516
  # end
500
517
  #
501
518
  # @!attribute [rw] endpoint
502
- # The hostname or hostname:port of the service endpoint.
503
- # Defaults to `"aiplatform.googleapis.com"`.
504
- # @return [::String]
519
+ # A custom service endpoint, as a hostname or hostname:port. The default is
520
+ # nil, indicating to use the default endpoint in the current universe domain.
521
+ # @return [::String,nil]
505
522
  # @!attribute [rw] credentials
506
523
  # Credentials to send with calls. You may provide any of the following types:
507
524
  # * (`String`) The path to a service account key file in JSON format
@@ -547,13 +564,20 @@ module Google
547
564
  # @!attribute [rw] quota_project
548
565
  # A separate project against which to charge quota.
549
566
  # @return [::String]
567
+ # @!attribute [rw] universe_domain
568
+ # The universe domain within which to make requests. This determines the
569
+ # default endpoint URL. The default value of nil uses the environment
570
+ # universe (usually the default "googleapis.com" universe).
571
+ # @return [::String,nil]
550
572
  #
551
573
  class Configuration
552
574
  extend ::Gapic::Config
553
575
 
576
+ # @private
577
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
554
578
  DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
555
579
 
556
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
580
+ config_attr :endpoint, nil, ::String, nil
557
581
  config_attr :credentials, nil do |value|
558
582
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
559
583
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -568,6 +592,7 @@ module Google
568
592
  config_attr :metadata, nil, ::Hash, nil
569
593
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
570
594
  config_attr :quota_project, nil, ::String, nil
595
+ config_attr :universe_domain, nil, ::String, nil
571
596
 
572
597
  # @private
573
598
  def initialize parent_config = nil