google-cloud-ai_platform-v1 0.24.0 → 0.26.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/ai_platform/v1/dataset_service/client.rb +4 -2
  3. data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +3 -1
  4. data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +4 -2
  5. data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +3 -1
  6. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb +4 -2
  7. data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +5 -3
  8. data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +3 -1
  9. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +4 -2
  10. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +3 -1
  11. data/lib/google/cloud/ai_platform/v1/index_service/client.rb +4 -2
  12. data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +3 -1
  13. data/lib/google/cloud/ai_platform/v1/job_service/client.rb +4 -2
  14. data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +3 -1
  15. data/lib/google/cloud/ai_platform/v1/match_service/client.rb +4 -2
  16. data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +16 -5
  17. data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +3 -1
  18. data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +4 -2
  19. data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +3 -1
  20. data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +424 -0
  21. data/lib/google/cloud/ai_platform/v1/model_garden_service/credentials.rb +47 -0
  22. data/lib/google/cloud/ai_platform/v1/model_garden_service/paths.rb +50 -0
  23. data/lib/google/cloud/ai_platform/v1/model_garden_service.rb +49 -0
  24. data/lib/google/cloud/ai_platform/v1/model_service/client.rb +107 -2
  25. data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +3 -1
  26. data/lib/google/cloud/ai_platform/v1/model_service/paths.rb +19 -0
  27. data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +4 -2
  28. data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +3 -1
  29. data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +5 -4
  30. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +4 -2
  31. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +3 -1
  32. data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +4 -2
  33. data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +3 -1
  34. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  35. data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +6 -3
  36. data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +3 -1
  37. data/lib/google/cloud/ai_platform/v1.rb +1 -0
  38. data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +24 -14
  39. data/lib/google/cloud/aiplatform/v1/annotation_pb.rb +27 -11
  40. data/lib/google/cloud/aiplatform/v1/annotation_spec_pb.rb +25 -8
  41. data/lib/google/cloud/aiplatform/v1/artifact_pb.rb +26 -20
  42. data/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb +34 -57
  43. data/lib/google/cloud/aiplatform/v1/completion_stats_pb.rb +24 -7
  44. data/lib/google/cloud/aiplatform/v1/context_pb.rb +26 -14
  45. data/lib/google/cloud/aiplatform/v1/custom_job_pb.rb +31 -55
  46. data/lib/google/cloud/aiplatform/v1/data_item_pb.rb +26 -9
  47. data/lib/google/cloud/aiplatform/v1/data_labeling_job_pb.rb +29 -45
  48. data/lib/google/cloud/aiplatform/v1/dataset_pb.rb +29 -37
  49. data/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb +30 -121
  50. data/lib/google/cloud/aiplatform/v1/deployed_index_ref_pb.rb +24 -5
  51. data/lib/google/cloud/aiplatform/v1/deployed_model_ref_pb.rb +24 -5
  52. data/lib/google/cloud/aiplatform/v1/encryption_spec_pb.rb +24 -4
  53. data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +29 -44
  54. data/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb +27 -63
  55. data/lib/google/cloud/aiplatform/v1/entity_type_pb.rb +26 -11
  56. data/lib/google/cloud/aiplatform/v1/env_var_pb.rb +24 -5
  57. data/lib/google/cloud/aiplatform/v1/evaluated_annotation_pb.rb +26 -36
  58. data/lib/google/cloud/aiplatform/v1/event_pb.rb +25 -13
  59. data/lib/google/cloud/aiplatform/v1/execution_pb.rb +26 -23
  60. data/lib/google/cloud/aiplatform/v1/explanation_metadata_pb.rb +25 -78
  61. data/lib/google/cloud/aiplatform/v1/explanation_pb.rb +27 -125
  62. data/lib/google/cloud/aiplatform/v1/feature_monitoring_stats_pb.rb +25 -10
  63. data/lib/google/cloud/aiplatform/v1/feature_pb.rb +26 -33
  64. data/lib/google/cloud/aiplatform/v1/feature_selector_pb.rb +24 -7
  65. data/lib/google/cloud/aiplatform/v1/featurestore_monitoring_pb.rb +24 -33
  66. data/lib/google/cloud/aiplatform/v1/featurestore_online_service_pb.rb +27 -62
  67. data/lib/google/cloud/aiplatform/v1/featurestore_pb.rb +26 -26
  68. data/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb +33 -249
  69. data/lib/google/cloud/aiplatform/v1/hyperparameter_tuning_job_pb.rb +29 -19
  70. data/lib/google/cloud/aiplatform/v1/index_endpoint_pb.rb +27 -41
  71. data/lib/google/cloud/aiplatform/v1/index_endpoint_service_pb.rb +27 -60
  72. data/lib/google/cloud/aiplatform/v1/index_pb.rb +27 -38
  73. data/lib/google/cloud/aiplatform/v1/index_service_pb.rb +27 -73
  74. data/lib/google/cloud/aiplatform/v1/io_pb.rb +24 -28
  75. data/lib/google/cloud/aiplatform/v1/job_service_pb.rb +33 -186
  76. data/lib/google/cloud/aiplatform/v1/job_state_pb.rb +24 -14
  77. data/lib/google/cloud/aiplatform/v1/lineage_subgraph_pb.rb +27 -6
  78. data/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb +24 -37
  79. data/lib/google/cloud/aiplatform/v1/manual_batch_tuning_parameters_pb.rb +24 -4
  80. data/lib/google/cloud/aiplatform/v1/match_service_pb.rb +25 -33
  81. data/lib/google/cloud/aiplatform/v1/metadata_schema_pb.rb +25 -15
  82. data/lib/google/cloud/aiplatform/v1/metadata_service_pb.rb +32 -203
  83. data/lib/google/cloud/aiplatform/v1/metadata_store_pb.rb +26 -12
  84. data/lib/google/cloud/aiplatform/v1/migratable_resource_pb.rb +25 -32
  85. data/lib/google/cloud/aiplatform/v1/migration_service_pb.rb +27 -66
  86. data/lib/google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb.rb +32 -78
  87. data/lib/google/cloud/aiplatform/v1/model_evaluation_pb.rb +27 -18
  88. data/lib/google/cloud/aiplatform/v1/model_evaluation_slice_pb.rb +28 -34
  89. data/lib/google/cloud/aiplatform/v1/model_garden_service_pb.rb +49 -0
  90. data/lib/google/cloud/aiplatform/v1/model_garden_service_services_pb.rb +45 -0
  91. data/lib/google/cloud/aiplatform/v1/model_monitoring_pb.rb +25 -63
  92. data/lib/google/cloud/aiplatform/v1/model_pb.rb +31 -78
  93. data/lib/google/cloud/aiplatform/v1/model_service_pb.rb +37 -137
  94. data/lib/google/cloud/aiplatform/v1/model_service_services_pb.rb +2 -0
  95. data/lib/google/cloud/aiplatform/v1/nas_job_pb.rb +29 -84
  96. data/lib/google/cloud/aiplatform/v1/operation_pb.rb +26 -9
  97. data/lib/google/cloud/aiplatform/v1/pipeline_failure_policy_pb.rb +24 -6
  98. data/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb +32 -91
  99. data/lib/google/cloud/aiplatform/v1/pipeline_service_pb.rb +27 -51
  100. data/lib/google/cloud/aiplatform/v1/pipeline_state_pb.rb +24 -12
  101. data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +27 -29
  102. data/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb +1 -2
  103. data/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb +57 -0
  104. data/lib/google/cloud/aiplatform/v1/saved_query_pb.rb +26 -13
  105. data/lib/google/cloud/aiplatform/v1/service_networking_pb.rb +24 -5
  106. data/lib/google/cloud/aiplatform/v1/specialist_pool_pb.rb +24 -9
  107. data/lib/google/cloud/aiplatform/v1/specialist_pool_service_pb.rb +27 -33
  108. data/lib/google/cloud/aiplatform/v1/study_pb.rb +27 -157
  109. data/lib/google/cloud/aiplatform/v1/tensorboard_data_pb.rb +25 -29
  110. data/lib/google/cloud/aiplatform/v1/tensorboard_experiment_pb.rb +25 -11
  111. data/lib/google/cloud/aiplatform/v1/tensorboard_pb.rb +26 -14
  112. data/lib/google/cloud/aiplatform/v1/tensorboard_run_pb.rb +25 -10
  113. data/lib/google/cloud/aiplatform/v1/tensorboard_service_pb.rb +31 -186
  114. data/lib/google/cloud/aiplatform/v1/tensorboard_time_series_pb.rb +25 -24
  115. data/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb +30 -63
  116. data/lib/google/cloud/aiplatform/v1/types_pb.rb +24 -13
  117. data/lib/google/cloud/aiplatform/v1/unmanaged_container_model_pb.rb +25 -6
  118. data/lib/google/cloud/aiplatform/v1/user_action_reference_pb.rb +24 -8
  119. data/lib/google/cloud/aiplatform/v1/value_pb.rb +24 -8
  120. data/lib/google/cloud/aiplatform/v1/vizier_service_pb.rb +27 -88
  121. data/lib/google/cloud/aiplatform/v1/vizier_service_services_pb.rb +2 -1
  122. data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
  123. data/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb +6 -2
  124. data/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb +7 -8
  125. data/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb +12 -3
  126. data/proto_docs/google/cloud/aiplatform/v1/model.rb +14 -0
  127. data/proto_docs/google/cloud/aiplatform/v1/model_evaluation.rb +3 -2
  128. data/proto_docs/google/cloud/aiplatform/v1/model_garden_service.rb +61 -0
  129. data/proto_docs/google/cloud/aiplatform/v1/model_service.rb +32 -0
  130. data/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb +235 -0
  131. data/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb +2 -1
  132. data/proto_docs/google/protobuf/any.rb +7 -4
  133. data/proto_docs/google/protobuf/struct.rb +1 -1
  134. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  135. metadata +13 -4
@@ -0,0 +1,424 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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 "google/cloud/errors"
20
+ require "google/cloud/aiplatform/v1/model_garden_service_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module AIPlatform
27
+ module V1
28
+ module ModelGardenService
29
+ ##
30
+ # Client for the ModelGardenService service.
31
+ #
32
+ # The interface of Model Garden Service.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :model_garden_service_stub
39
+
40
+ ##
41
+ # Configure the ModelGardenService Client class.
42
+ #
43
+ # See {::Google::Cloud::AIPlatform::V1::ModelGardenService::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all ModelGardenService clients
49
+ # ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "AIPlatform", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config
70
+ end
71
+ yield @configure if block_given?
72
+ @configure
73
+ end
74
+
75
+ ##
76
+ # Configure the ModelGardenService Client instance.
77
+ #
78
+ # The configuration is set to the derived mode, meaning that values can be changed,
79
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
80
+ # should be made on {Client.configure}.
81
+ #
82
+ # See {::Google::Cloud::AIPlatform::V1::ModelGardenService::Client::Configuration}
83
+ # for a description of the configuration fields.
84
+ #
85
+ # @yield [config] Configure the Client client.
86
+ # @yieldparam config [Client::Configuration]
87
+ #
88
+ # @return [Client::Configuration]
89
+ #
90
+ def configure
91
+ yield @config if block_given?
92
+ @config
93
+ end
94
+
95
+ ##
96
+ # Create a new ModelGardenService client object.
97
+ #
98
+ # @example
99
+ #
100
+ # # Create a client using the default configuration
101
+ # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new
102
+ #
103
+ # # Create a client using a custom configuration
104
+ # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new do |config|
105
+ # config.timeout = 10.0
106
+ # end
107
+ #
108
+ # @yield [config] Configure the ModelGardenService client.
109
+ # @yieldparam config [Client::Configuration]
110
+ #
111
+ def initialize
112
+ # These require statements are intentionally placed here to initialize
113
+ # the gRPC module only when it's required.
114
+ # See https://github.com/googleapis/toolkit/issues/446
115
+ require "gapic/grpc"
116
+ require "google/cloud/aiplatform/v1/model_garden_service_services_pb"
117
+
118
+ # Create the configuration object
119
+ @config = Configuration.new Client.configure
120
+
121
+ # Yield the configuration if needed
122
+ yield @config if block_given?
123
+
124
+ # Create credentials
125
+ credentials = @config.credentials
126
+ # Use self-signed JWT if the endpoint is unchanged from default,
127
+ # 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?("-")
130
+ credentials ||= Credentials.default scope: @config.scope,
131
+ enable_self_signed_jwt: enable_self_signed_jwt
132
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
133
+ credentials = Credentials.new credentials, scope: @config.scope
134
+ end
135
+ @quota_project_id = @config.quota_project
136
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
137
+
138
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
139
+ config.credentials = credentials
140
+ config.quota_project = @quota_project_id
141
+ config.endpoint = @config.endpoint
142
+ end
143
+
144
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
145
+ config.credentials = credentials
146
+ config.quota_project = @quota_project_id
147
+ config.endpoint = @config.endpoint
148
+ end
149
+
150
+ @model_garden_service_stub = ::Gapic::ServiceStub.new(
151
+ ::Google::Cloud::AIPlatform::V1::ModelGardenService::Stub,
152
+ credentials: credentials,
153
+ endpoint: @config.endpoint,
154
+ channel_args: @config.channel_args,
155
+ interceptors: @config.interceptors
156
+ )
157
+ end
158
+
159
+ ##
160
+ # Get the associated client for mix-in of the Locations.
161
+ #
162
+ # @return [Google::Cloud::Location::Locations::Client]
163
+ #
164
+ attr_reader :location_client
165
+
166
+ ##
167
+ # Get the associated client for mix-in of the IAMPolicy.
168
+ #
169
+ # @return [Google::Iam::V1::IAMPolicy::Client]
170
+ #
171
+ attr_reader :iam_policy_client
172
+
173
+ # Service calls
174
+
175
+ ##
176
+ # Gets a Model Garden publisher model.
177
+ #
178
+ # @overload get_publisher_model(request, options = nil)
179
+ # Pass arguments to `get_publisher_model` via a request object, either of type
180
+ # {::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest} or an equivalent Hash.
181
+ #
182
+ # @param request [::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest, ::Hash]
183
+ # A request object representing the call parameters. Required. To specify no
184
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
185
+ # @param options [::Gapic::CallOptions, ::Hash]
186
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
187
+ #
188
+ # @overload get_publisher_model(name: nil, language_code: nil, view: nil)
189
+ # Pass arguments to `get_publisher_model` via keyword arguments. Note that at
190
+ # least one keyword argument is required. To specify no parameters, or to keep all
191
+ # the default parameter values, pass an empty Hash as a request object (see above).
192
+ #
193
+ # @param name [::String]
194
+ # Required. The name of the PublisherModel resource.
195
+ # Format:
196
+ # `publishers/{publisher}/models/{publisher_model}`
197
+ # @param language_code [::String]
198
+ # Optional. The IETF BCP-47 language code representing the language in which
199
+ # the publisher model's text information should be written in (see go/bcp47).
200
+ # @param view [::Google::Cloud::AIPlatform::V1::PublisherModelView]
201
+ # Optional. PublisherModel view specifying which fields to read.
202
+ #
203
+ # @yield [response, operation] Access the result along with the RPC operation
204
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::PublisherModel]
205
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
206
+ #
207
+ # @return [::Google::Cloud::AIPlatform::V1::PublisherModel]
208
+ #
209
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
210
+ #
211
+ # @example Basic example
212
+ # require "google/cloud/ai_platform/v1"
213
+ #
214
+ # # Create a client object. The client can be reused for multiple calls.
215
+ # client = Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new
216
+ #
217
+ # # Create a request. To set request fields, pass in keyword arguments.
218
+ # request = Google::Cloud::AIPlatform::V1::GetPublisherModelRequest.new
219
+ #
220
+ # # Call the get_publisher_model method.
221
+ # result = client.get_publisher_model request
222
+ #
223
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::PublisherModel.
224
+ # p result
225
+ #
226
+ def get_publisher_model request, options = nil
227
+ raise ::ArgumentError, "request must be provided" if request.nil?
228
+
229
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetPublisherModelRequest
230
+
231
+ # Converts hash and nil to an options object
232
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
233
+
234
+ # Customize the options with defaults
235
+ metadata = @config.rpcs.get_publisher_model.metadata.to_h
236
+
237
+ # Set x-goog-api-client and x-goog-user-project headers
238
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
239
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
240
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
241
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
242
+
243
+ header_params = {}
244
+ if request.name
245
+ header_params["name"] = request.name
246
+ end
247
+
248
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
249
+ metadata[:"x-goog-request-params"] ||= request_params_header
250
+
251
+ options.apply_defaults timeout: @config.rpcs.get_publisher_model.timeout,
252
+ metadata: metadata,
253
+ retry_policy: @config.rpcs.get_publisher_model.retry_policy
254
+
255
+ options.apply_defaults timeout: @config.timeout,
256
+ metadata: @config.metadata,
257
+ retry_policy: @config.retry_policy
258
+
259
+ @model_garden_service_stub.call_rpc :get_publisher_model, request, options: options do |response, operation|
260
+ yield response, operation if block_given?
261
+ return response
262
+ end
263
+ rescue ::GRPC::BadStatus => e
264
+ raise ::Google::Cloud::Error.from_error(e)
265
+ end
266
+
267
+ ##
268
+ # Configuration class for the ModelGardenService API.
269
+ #
270
+ # This class represents the configuration for ModelGardenService,
271
+ # providing control over timeouts, retry behavior, logging, transport
272
+ # parameters, and other low-level controls. Certain parameters can also be
273
+ # applied individually to specific RPCs. See
274
+ # {::Google::Cloud::AIPlatform::V1::ModelGardenService::Client::Configuration::Rpcs}
275
+ # for a list of RPCs that can be configured independently.
276
+ #
277
+ # Configuration can be applied globally to all clients, or to a single client
278
+ # on construction.
279
+ #
280
+ # @example
281
+ #
282
+ # # Modify the global config, setting the timeout for
283
+ # # get_publisher_model to 20 seconds,
284
+ # # and all remaining timeouts to 10 seconds.
285
+ # ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.configure do |config|
286
+ # config.timeout = 10.0
287
+ # config.rpcs.get_publisher_model.timeout = 20.0
288
+ # end
289
+ #
290
+ # # Apply the above configuration only to a new client.
291
+ # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new do |config|
292
+ # config.timeout = 10.0
293
+ # config.rpcs.get_publisher_model.timeout = 20.0
294
+ # end
295
+ #
296
+ # @!attribute [rw] endpoint
297
+ # The hostname or hostname:port of the service endpoint.
298
+ # Defaults to `"aiplatform.googleapis.com"`.
299
+ # @return [::String]
300
+ # @!attribute [rw] credentials
301
+ # Credentials to send with calls. You may provide any of the following types:
302
+ # * (`String`) The path to a service account key file in JSON format
303
+ # * (`Hash`) A service account key as a Hash
304
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
305
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
306
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
307
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
308
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
309
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
310
+ # * (`nil`) indicating no credentials
311
+ # @return [::Object]
312
+ # @!attribute [rw] scope
313
+ # The OAuth scopes
314
+ # @return [::Array<::String>]
315
+ # @!attribute [rw] lib_name
316
+ # The library name as recorded in instrumentation and logging
317
+ # @return [::String]
318
+ # @!attribute [rw] lib_version
319
+ # The library version as recorded in instrumentation and logging
320
+ # @return [::String]
321
+ # @!attribute [rw] channel_args
322
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
323
+ # `GRPC::Core::Channel` object is provided as the credential.
324
+ # @return [::Hash]
325
+ # @!attribute [rw] interceptors
326
+ # An array of interceptors that are run before calls are executed.
327
+ # @return [::Array<::GRPC::ClientInterceptor>]
328
+ # @!attribute [rw] timeout
329
+ # The call timeout in seconds.
330
+ # @return [::Numeric]
331
+ # @!attribute [rw] metadata
332
+ # Additional gRPC headers to be sent with the call.
333
+ # @return [::Hash{::Symbol=>::String}]
334
+ # @!attribute [rw] retry_policy
335
+ # The retry policy. The value is a hash with the following keys:
336
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
337
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
338
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
339
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
340
+ # trigger a retry.
341
+ # @return [::Hash]
342
+ # @!attribute [rw] quota_project
343
+ # A separate project against which to charge quota.
344
+ # @return [::String]
345
+ #
346
+ class Configuration
347
+ extend ::Gapic::Config
348
+
349
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
350
+
351
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
352
+ config_attr :credentials, nil do |value|
353
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
354
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
355
+ allowed.any? { |klass| klass === value }
356
+ end
357
+ config_attr :scope, nil, ::String, ::Array, nil
358
+ config_attr :lib_name, nil, ::String, nil
359
+ config_attr :lib_version, nil, ::String, nil
360
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
361
+ config_attr :interceptors, nil, ::Array, nil
362
+ config_attr :timeout, nil, ::Numeric, nil
363
+ config_attr :metadata, nil, ::Hash, nil
364
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
365
+ config_attr :quota_project, nil, ::String, nil
366
+
367
+ # @private
368
+ def initialize parent_config = nil
369
+ @parent_config = parent_config unless parent_config.nil?
370
+
371
+ yield self if block_given?
372
+ end
373
+
374
+ ##
375
+ # Configurations for individual RPCs
376
+ # @return [Rpcs]
377
+ #
378
+ def rpcs
379
+ @rpcs ||= begin
380
+ parent_rpcs = nil
381
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
382
+ Rpcs.new parent_rpcs
383
+ end
384
+ end
385
+
386
+ ##
387
+ # Configuration RPC class for the ModelGardenService API.
388
+ #
389
+ # Includes fields providing the configuration for each RPC in this service.
390
+ # Each configuration object is of type `Gapic::Config::Method` and includes
391
+ # the following configuration fields:
392
+ #
393
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
394
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
395
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
396
+ # include the following keys:
397
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
398
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
399
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
400
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
401
+ # trigger a retry.
402
+ #
403
+ class Rpcs
404
+ ##
405
+ # RPC-specific configuration for `get_publisher_model`
406
+ # @return [::Gapic::Config::Method]
407
+ #
408
+ attr_reader :get_publisher_model
409
+
410
+ # @private
411
+ def initialize parent_rpcs = nil
412
+ get_publisher_model_config = parent_rpcs.get_publisher_model if parent_rpcs.respond_to? :get_publisher_model
413
+ @get_publisher_model = ::Gapic::Config::Method.new get_publisher_model_config
414
+
415
+ yield self if block_given?
416
+ end
417
+ end
418
+ end
419
+ end
420
+ end
421
+ end
422
+ end
423
+ end
424
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module AIPlatform
24
+ module V1
25
+ module ModelGardenService
26
+ # Credentials for the ModelGardenService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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
+
20
+ module Google
21
+ module Cloud
22
+ module AIPlatform
23
+ module V1
24
+ module ModelGardenService
25
+ # Path helper methods for the ModelGardenService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified PublisherModel resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `publishers/{publisher}/models/{model}`
33
+ #
34
+ # @param publisher [String]
35
+ # @param model [String]
36
+ #
37
+ # @return [::String]
38
+ def publisher_model_path publisher:, model:
39
+ raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/"
40
+
41
+ "publishers/#{publisher}/models/#{model}"
42
+ end
43
+
44
+ extend self
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/ai_platform/v1/version"
24
+
25
+ require "google/cloud/ai_platform/v1/model_garden_service/credentials"
26
+ require "google/cloud/ai_platform/v1/model_garden_service/paths"
27
+ require "google/cloud/ai_platform/v1/model_garden_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module AIPlatform
32
+ module V1
33
+ ##
34
+ # The interface of Model Garden Service.
35
+ #
36
+ # @example Load this service and instantiate a gRPC client
37
+ #
38
+ # require "google/cloud/ai_platform/v1/model_garden_service"
39
+ # client = ::Google::Cloud::AIPlatform::V1::ModelGardenService::Client.new
40
+ #
41
+ module ModelGardenService
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "model_garden_service", "helpers.rb"
49
+ require "google/cloud/ai_platform/v1/model_garden_service/helpers" if ::File.file? helper_path