google-cloud-ai_platform-v1 0.23.0 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) 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 +533 -0
  16. data/lib/google/cloud/ai_platform/v1/match_service/credentials.rb +47 -0
  17. data/lib/google/cloud/ai_platform/v1/match_service/paths.rb +52 -0
  18. data/lib/google/cloud/ai_platform/v1/match_service.rb +50 -0
  19. data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +16 -5
  20. data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +3 -1
  21. data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +4 -2
  22. data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +3 -1
  23. data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +424 -0
  24. data/lib/google/cloud/ai_platform/v1/model_garden_service/credentials.rb +47 -0
  25. data/lib/google/cloud/ai_platform/v1/model_garden_service/paths.rb +50 -0
  26. data/lib/google/cloud/ai_platform/v1/model_garden_service.rb +49 -0
  27. data/lib/google/cloud/ai_platform/v1/model_service/client.rb +4 -2
  28. data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +3 -1
  29. data/lib/google/cloud/ai_platform/v1/model_service/paths.rb +19 -0
  30. data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +4 -2
  31. data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +3 -1
  32. data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +5 -4
  33. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +4 -2
  34. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +3 -1
  35. data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +4 -2
  36. data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +3 -1
  37. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  38. data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +6 -3
  39. data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +3 -1
  40. data/lib/google/cloud/ai_platform/v1.rb +2 -0
  41. data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +24 -14
  42. data/lib/google/cloud/aiplatform/v1/annotation_pb.rb +27 -11
  43. data/lib/google/cloud/aiplatform/v1/annotation_spec_pb.rb +25 -8
  44. data/lib/google/cloud/aiplatform/v1/artifact_pb.rb +26 -20
  45. data/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb +34 -57
  46. data/lib/google/cloud/aiplatform/v1/completion_stats_pb.rb +24 -7
  47. data/lib/google/cloud/aiplatform/v1/context_pb.rb +26 -14
  48. data/lib/google/cloud/aiplatform/v1/custom_job_pb.rb +31 -55
  49. data/lib/google/cloud/aiplatform/v1/data_item_pb.rb +26 -9
  50. data/lib/google/cloud/aiplatform/v1/data_labeling_job_pb.rb +29 -45
  51. data/lib/google/cloud/aiplatform/v1/dataset_pb.rb +29 -37
  52. data/lib/google/cloud/aiplatform/v1/dataset_service_pb.rb +30 -121
  53. data/lib/google/cloud/aiplatform/v1/deployed_index_ref_pb.rb +24 -5
  54. data/lib/google/cloud/aiplatform/v1/deployed_model_ref_pb.rb +24 -5
  55. data/lib/google/cloud/aiplatform/v1/encryption_spec_pb.rb +24 -4
  56. data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +29 -44
  57. data/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb +27 -63
  58. data/lib/google/cloud/aiplatform/v1/entity_type_pb.rb +26 -11
  59. data/lib/google/cloud/aiplatform/v1/env_var_pb.rb +24 -5
  60. data/lib/google/cloud/aiplatform/v1/evaluated_annotation_pb.rb +26 -36
  61. data/lib/google/cloud/aiplatform/v1/event_pb.rb +25 -13
  62. data/lib/google/cloud/aiplatform/v1/execution_pb.rb +26 -23
  63. data/lib/google/cloud/aiplatform/v1/explanation_metadata_pb.rb +25 -78
  64. data/lib/google/cloud/aiplatform/v1/explanation_pb.rb +34 -92
  65. data/lib/google/cloud/aiplatform/v1/feature_monitoring_stats_pb.rb +25 -10
  66. data/lib/google/cloud/aiplatform/v1/feature_pb.rb +26 -33
  67. data/lib/google/cloud/aiplatform/v1/feature_selector_pb.rb +24 -7
  68. data/lib/google/cloud/aiplatform/v1/featurestore_monitoring_pb.rb +24 -33
  69. data/lib/google/cloud/aiplatform/v1/featurestore_online_service_pb.rb +27 -62
  70. data/lib/google/cloud/aiplatform/v1/featurestore_pb.rb +26 -26
  71. data/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb +33 -249
  72. data/lib/google/cloud/aiplatform/v1/hyperparameter_tuning_job_pb.rb +29 -19
  73. data/lib/google/cloud/aiplatform/v1/index_endpoint_pb.rb +27 -41
  74. data/lib/google/cloud/aiplatform/v1/index_endpoint_service_pb.rb +27 -60
  75. data/lib/google/cloud/aiplatform/v1/index_pb.rb +27 -38
  76. data/lib/google/cloud/aiplatform/v1/index_service_pb.rb +27 -73
  77. data/lib/google/cloud/aiplatform/v1/io_pb.rb +24 -28
  78. data/lib/google/cloud/aiplatform/v1/job_service_pb.rb +33 -186
  79. data/lib/google/cloud/aiplatform/v1/job_state_pb.rb +24 -14
  80. data/lib/google/cloud/aiplatform/v1/lineage_subgraph_pb.rb +27 -6
  81. data/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb +24 -37
  82. data/lib/google/cloud/aiplatform/v1/manual_batch_tuning_parameters_pb.rb +24 -4
  83. data/lib/google/cloud/aiplatform/v1/match_service_pb.rb +55 -0
  84. data/lib/google/cloud/aiplatform/v1/match_service_services_pb.rb +49 -0
  85. data/lib/google/cloud/aiplatform/v1/metadata_schema_pb.rb +25 -15
  86. data/lib/google/cloud/aiplatform/v1/metadata_service_pb.rb +32 -203
  87. data/lib/google/cloud/aiplatform/v1/metadata_store_pb.rb +26 -12
  88. data/lib/google/cloud/aiplatform/v1/migratable_resource_pb.rb +25 -32
  89. data/lib/google/cloud/aiplatform/v1/migration_service_pb.rb +27 -66
  90. data/lib/google/cloud/aiplatform/v1/model_deployment_monitoring_job_pb.rb +32 -78
  91. data/lib/google/cloud/aiplatform/v1/model_evaluation_pb.rb +27 -18
  92. data/lib/google/cloud/aiplatform/v1/model_evaluation_slice_pb.rb +28 -34
  93. data/lib/google/cloud/aiplatform/v1/model_garden_service_pb.rb +49 -0
  94. data/lib/google/cloud/aiplatform/v1/model_garden_service_services_pb.rb +45 -0
  95. data/lib/google/cloud/aiplatform/v1/model_monitoring_pb.rb +25 -63
  96. data/lib/google/cloud/aiplatform/v1/model_pb.rb +31 -78
  97. data/lib/google/cloud/aiplatform/v1/model_service_pb.rb +32 -137
  98. data/lib/google/cloud/aiplatform/v1/nas_job_pb.rb +29 -84
  99. data/lib/google/cloud/aiplatform/v1/operation_pb.rb +26 -9
  100. data/lib/google/cloud/aiplatform/v1/pipeline_failure_policy_pb.rb +24 -6
  101. data/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb +32 -91
  102. data/lib/google/cloud/aiplatform/v1/pipeline_service_pb.rb +27 -51
  103. data/lib/google/cloud/aiplatform/v1/pipeline_state_pb.rb +24 -12
  104. data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +27 -29
  105. data/lib/google/cloud/aiplatform/v1/prediction_service_services_pb.rb +1 -2
  106. data/lib/google/cloud/aiplatform/v1/publisher_model_pb.rb +57 -0
  107. data/lib/google/cloud/aiplatform/v1/saved_query_pb.rb +26 -13
  108. data/lib/google/cloud/aiplatform/v1/service_networking_pb.rb +24 -5
  109. data/lib/google/cloud/aiplatform/v1/specialist_pool_pb.rb +24 -9
  110. data/lib/google/cloud/aiplatform/v1/specialist_pool_service_pb.rb +27 -33
  111. data/lib/google/cloud/aiplatform/v1/study_pb.rb +27 -157
  112. data/lib/google/cloud/aiplatform/v1/tensorboard_data_pb.rb +25 -29
  113. data/lib/google/cloud/aiplatform/v1/tensorboard_experiment_pb.rb +25 -11
  114. data/lib/google/cloud/aiplatform/v1/tensorboard_pb.rb +26 -14
  115. data/lib/google/cloud/aiplatform/v1/tensorboard_run_pb.rb +25 -10
  116. data/lib/google/cloud/aiplatform/v1/tensorboard_service_pb.rb +31 -186
  117. data/lib/google/cloud/aiplatform/v1/tensorboard_time_series_pb.rb +25 -24
  118. data/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb +30 -63
  119. data/lib/google/cloud/aiplatform/v1/types_pb.rb +24 -13
  120. data/lib/google/cloud/aiplatform/v1/unmanaged_container_model_pb.rb +25 -6
  121. data/lib/google/cloud/aiplatform/v1/user_action_reference_pb.rb +24 -8
  122. data/lib/google/cloud/aiplatform/v1/value_pb.rb +24 -8
  123. data/lib/google/cloud/aiplatform/v1/vizier_service_pb.rb +27 -88
  124. data/lib/google/cloud/aiplatform/v1/vizier_service_services_pb.rb +2 -1
  125. data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
  126. data/proto_docs/google/cloud/aiplatform/v1/explanation.rb +89 -0
  127. data/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb +6 -2
  128. data/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb +7 -8
  129. data/proto_docs/google/cloud/aiplatform/v1/match_service.rb +156 -0
  130. data/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb +12 -3
  131. data/proto_docs/google/cloud/aiplatform/v1/model.rb +14 -0
  132. data/proto_docs/google/cloud/aiplatform/v1/model_evaluation.rb +3 -2
  133. data/proto_docs/google/cloud/aiplatform/v1/model_garden_service.rb +61 -0
  134. data/proto_docs/google/cloud/aiplatform/v1/publisher_model.rb +235 -0
  135. data/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb +2 -1
  136. data/proto_docs/google/protobuf/any.rb +7 -4
  137. data/proto_docs/google/protobuf/struct.rb +1 -1
  138. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  139. metadata +20 -4
@@ -125,7 +125,7 @@ module Google
125
125
  credentials = @config.credentials
126
126
  # Use self-signed JWT if the endpoint is unchanged from default,
127
127
  # but only if the default endpoint does not have a region prefix.
128
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
128
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
129
129
  !@config.endpoint.split(".").first.include?("-")
130
130
  credentials ||= Credentials.default scope: @config.scope,
131
131
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -815,6 +815,9 @@ module Google
815
815
  # To filter on metadata fields use traversal operation as follows:
816
816
  # `metadata.<field_name>.<type_value>`.
817
817
  # For example: `metadata.field_1.number_value = 10.0`
818
+ # In case the field name contains special characters (such as colon), one
819
+ # can embed it inside double quote.
820
+ # For example: `metadata."field:1".number_value = 10.0`
818
821
  # * **Context based filtering**:
819
822
  # To filter Artifacts based on the contexts to which they belong, use the
820
823
  # function operator with the full resource name
@@ -929,7 +932,6 @@ module Google
929
932
  # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact}`
930
933
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
931
934
  # Optional. A FieldMask indicating which fields should be updated.
932
- # Functionality of this field is not yet supported.
933
935
  # @param allow_missing [::Boolean]
934
936
  # If set to true, and the {::Google::Cloud::AIPlatform::V1::Artifact Artifact} is
935
937
  # not found, a new {::Google::Cloud::AIPlatform::V1::Artifact Artifact} is
@@ -1434,6 +1436,9 @@ module Google
1434
1436
  # To filter on metadata fields use traversal operation as follows:
1435
1437
  # `metadata.<field_name>.<type_value>`.
1436
1438
  # For example: `metadata.field_1.number_value = 10.0`.
1439
+ # In case the field name contains special characters (such as colon), one
1440
+ # can embed it inside double quote.
1441
+ # For example: `metadata."field:1".number_value = 10.0`
1437
1442
  # * **Parent Child filtering**:
1438
1443
  # To filter Contexts based on parent-child relationship use the HAS
1439
1444
  # operator as follows:
@@ -1552,7 +1557,6 @@ module Google
1552
1557
  # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}`
1553
1558
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1554
1559
  # Optional. A FieldMask indicating which fields should be updated.
1555
- # Functionality of this field is not yet supported.
1556
1560
  # @param allow_missing [::Boolean]
1557
1561
  # If set to true, and the {::Google::Cloud::AIPlatform::V1::Context Context} is
1558
1562
  # not found, a new {::Google::Cloud::AIPlatform::V1::Context Context} is created.
@@ -2440,6 +2444,9 @@ module Google
2440
2444
  # To filter on metadata fields use traversal operation as follows:
2441
2445
  # `metadata.<field_name>.<type_value>`
2442
2446
  # For example: `metadata.field_1.number_value = 10.0`
2447
+ # In case the field name contains special characters (such as colon), one
2448
+ # can embed it inside double quote.
2449
+ # For example: `metadata."field:1".number_value = 10.0`
2443
2450
  # * **Context based filtering**:
2444
2451
  # To filter Executions based on the contexts to which they belong use
2445
2452
  # the function operator with the full resource name:
@@ -2554,7 +2561,6 @@ module Google
2554
2561
  # `projects/{project}/locations/{location}/metadataStores/{metadatastore}/executions/{execution}`
2555
2562
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2556
2563
  # Optional. A FieldMask indicating which fields should be updated.
2557
- # Functionality of this field is not yet supported.
2558
2564
  # @param allow_missing [::Boolean]
2559
2565
  # If set to true, and the {::Google::Cloud::AIPlatform::V1::Execution Execution}
2560
2566
  # is not found, a new {::Google::Cloud::AIPlatform::V1::Execution Execution} is
@@ -3348,6 +3354,9 @@ module Google
3348
3354
  # To filter on metadata fields use traversal operation as follows:
3349
3355
  # `metadata.<field_name>.<type_value>`.
3350
3356
  # For example: `metadata.field_1.number_value = 10.0`
3357
+ # In case the field name contains special characters (such as colon), one
3358
+ # can embed it inside double quote.
3359
+ # For example: `metadata."field:1".number_value = 10.0`
3351
3360
  #
3352
3361
  # Each of the above supported filter types can be combined together using
3353
3362
  # logical operators (`AND` & `OR`). Maximum nested expression depth allowed
@@ -3501,7 +3510,9 @@ module Google
3501
3510
  class Configuration
3502
3511
  extend ::Gapic::Config
3503
3512
 
3504
- config_attr :endpoint, "aiplatform.googleapis.com", ::String
3513
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
3514
+
3515
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
3505
3516
  config_attr :credentials, nil do |value|
3506
3517
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3507
3518
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -672,7 +672,9 @@ module Google
672
672
  class Configuration
673
673
  extend ::Gapic::Config
674
674
 
675
- config_attr :endpoint, "aiplatform.googleapis.com", ::String
675
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
676
+
677
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
676
678
  config_attr :credentials, nil do |value|
677
679
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
678
680
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -126,7 +126,7 @@ module Google
126
126
  credentials = @config.credentials
127
127
  # Use self-signed JWT if the endpoint is unchanged from default,
128
128
  # but only if the default endpoint does not have a region prefix.
129
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
129
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
130
130
  !@config.endpoint.split(".").first.include?("-")
131
131
  credentials ||= Credentials.default scope: @config.scope,
132
132
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -480,7 +480,9 @@ module Google
480
480
  class Configuration
481
481
  extend ::Gapic::Config
482
482
 
483
- config_attr :endpoint, "aiplatform.googleapis.com", ::String
483
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
484
+
485
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
484
486
  config_attr :credentials, nil do |value|
485
487
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
486
488
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -672,7 +672,9 @@ module Google
672
672
  class Configuration
673
673
  extend ::Gapic::Config
674
674
 
675
- config_attr :endpoint, "aiplatform.googleapis.com", ::String
675
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
676
+
677
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
676
678
  config_attr :credentials, nil do |value|
677
679
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
678
680
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -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