google-cloud-ai_platform-v1 0.60.0 → 0.62.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/ai_platform/v1/dataset_service/client.rb +43 -20
  4. data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +9 -5
  5. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb +43 -20
  6. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb +84 -35
  7. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb +166 -116
  8. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb +34 -7
  9. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb +9 -5
  10. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client.rb +33 -7
  11. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb +84 -35
  12. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub.rb +62 -38
  13. data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +36 -10
  14. data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +9 -5
  15. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb +36 -10
  16. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb +84 -35
  17. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb +86 -56
  18. data/lib/google/cloud/ai_platform/v1/evaluation_service/client.rb +29 -2
  19. data/lib/google/cloud/ai_platform/v1/evaluation_service/rest/client.rb +29 -2
  20. data/lib/google/cloud/ai_platform/v1/evaluation_service/rest/service_stub.rb +22 -8
  21. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb +38 -14
  22. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +9 -5
  23. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb +38 -14
  24. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb +84 -35
  25. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub.rb +118 -80
  26. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb +29 -3
  27. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/client.rb +29 -3
  28. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub.rb +30 -14
  29. data/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb +38 -12
  30. data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +9 -5
  31. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb +38 -12
  32. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb +84 -35
  33. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub.rb +102 -68
  34. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb +29 -4
  35. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client.rb +29 -3
  36. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub.rb +31 -14
  37. data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +45 -22
  38. data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +9 -5
  39. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/client.rb +45 -22
  40. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb +84 -35
  41. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/service_stub.rb +182 -128
  42. data/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/client.rb +872 -0
  43. data/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/credentials.rb +47 -0
  44. data/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/paths.rb +88 -0
  45. data/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/client.rb +820 -0
  46. data/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest/service_stub.rb +388 -0
  47. data/lib/google/cloud/ai_platform/v1/gen_ai_cache_service/rest.rb +53 -0
  48. data/lib/google/cloud/ai_platform/v1/gen_ai_cache_service.rb +55 -0
  49. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb +31 -6
  50. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb +9 -5
  51. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb +31 -6
  52. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb +84 -35
  53. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb +54 -32
  54. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +35 -9
  55. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +9 -5
  56. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb +35 -9
  57. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb +84 -35
  58. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb +78 -50
  59. data/lib/google/cloud/ai_platform/v1/index_service/client.rb +33 -8
  60. data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +9 -5
  61. data/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb +33 -8
  62. data/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb +84 -35
  63. data/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb +70 -44
  64. data/lib/google/cloud/ai_platform/v1/job_service/client.rb +44 -36
  65. data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +9 -5
  66. data/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb +44 -36
  67. data/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb +84 -35
  68. data/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb +294 -212
  69. data/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb +29 -3
  70. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb +29 -3
  71. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb +30 -14
  72. data/lib/google/cloud/ai_platform/v1/match_service/client.rb +29 -3
  73. data/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb +29 -3
  74. data/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb +30 -14
  75. data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +42 -33
  76. data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +9 -5
  77. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb +42 -33
  78. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb +84 -35
  79. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb +270 -194
  80. data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +31 -3
  81. data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +9 -5
  82. data/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb +31 -3
  83. data/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb +84 -35
  84. data/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb +30 -14
  85. data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +29 -2
  86. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb +29 -2
  87. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb +22 -8
  88. data/lib/google/cloud/ai_platform/v1/model_service/client.rb +39 -19
  89. data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +9 -5
  90. data/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb +39 -19
  91. data/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb +84 -35
  92. data/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb +158 -110
  93. data/lib/google/cloud/ai_platform/v1/notebook_service/client.rb +41 -17
  94. data/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb +9 -5
  95. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb +41 -17
  96. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +84 -35
  97. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb +142 -98
  98. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb +34 -7
  99. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb +9 -5
  100. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb +34 -7
  101. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb +84 -35
  102. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb +62 -38
  103. data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +35 -13
  104. data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +9 -5
  105. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb +35 -13
  106. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb +84 -35
  107. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb +110 -74
  108. data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +43 -16
  109. data/lib/google/cloud/ai_platform/v1/prediction_service/paths.rb +19 -0
  110. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb +43 -9
  111. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb +65 -38
  112. data/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/client.rb +593 -0
  113. data/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/credentials.rb +47 -0
  114. data/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/paths.rb +52 -0
  115. data/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/client.rb +564 -0
  116. data/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest/service_stub.rb +199 -0
  117. data/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service/rest.rb +53 -0
  118. data/lib/google/cloud/ai_platform/v1/reasoning_engine_execution_service.rb +55 -0
  119. data/lib/google/cloud/ai_platform/v1/reasoning_engine_service/client.rb +914 -0
  120. data/lib/google/cloud/ai_platform/v1/reasoning_engine_service/credentials.rb +47 -0
  121. data/lib/google/cloud/ai_platform/v1/reasoning_engine_service/operations.rb +814 -0
  122. data/lib/google/cloud/ai_platform/v1/reasoning_engine_service/paths.rb +69 -0
  123. data/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/client.rb +862 -0
  124. data/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/operations.rb +4293 -0
  125. data/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest/service_stub.rb +388 -0
  126. data/lib/google/cloud/ai_platform/v1/reasoning_engine_service/rest.rb +54 -0
  127. data/lib/google/cloud/ai_platform/v1/reasoning_engine_service.rb +56 -0
  128. data/lib/google/cloud/ai_platform/v1/rest.rb +3 -0
  129. data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +31 -8
  130. data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +9 -5
  131. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb +31 -8
  132. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +84 -35
  133. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb +70 -44
  134. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +33 -6
  135. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +9 -5
  136. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb +33 -6
  137. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +84 -35
  138. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb +54 -32
  139. data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +40 -31
  140. data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +9 -5
  141. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb +40 -30
  142. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +84 -35
  143. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb +247 -176
  144. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  145. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb +36 -11
  146. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb +9 -5
  147. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb +36 -11
  148. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb +84 -35
  149. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb +94 -62
  150. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb +29 -4
  151. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb +29 -4
  152. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb +38 -20
  153. data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +33 -16
  154. data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +9 -5
  155. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb +33 -16
  156. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +84 -35
  157. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb +134 -92
  158. data/lib/google/cloud/ai_platform/v1.rb +3 -0
  159. data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -1
  160. data/lib/google/cloud/aiplatform/v1/cached_content_pb.rb +54 -0
  161. data/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_pb.rb +57 -0
  162. data/lib/google/cloud/aiplatform/v1/gen_ai_cache_service_services_pb.rb +54 -0
  163. data/lib/google/cloud/aiplatform/v1/notebook_runtime_pb.rb +1 -1
  164. data/lib/google/cloud/aiplatform/v1/prediction_service_pb.rb +1 -1
  165. data/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_pb.rb +52 -0
  166. data/lib/google/cloud/aiplatform/v1/reasoning_engine_execution_service_services_pb.rb +47 -0
  167. data/lib/google/cloud/aiplatform/v1/reasoning_engine_pb.rb +51 -0
  168. data/lib/google/cloud/aiplatform/v1/reasoning_engine_service_pb.rb +62 -0
  169. data/lib/google/cloud/aiplatform/v1/reasoning_engine_service_services_pb.rb +53 -0
  170. data/lib/google/cloud/aiplatform/v1/tool_pb.rb +4 -1
  171. data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
  172. data/proto_docs/google/cloud/aiplatform/v1/cached_content.rb +101 -0
  173. data/proto_docs/google/cloud/aiplatform/v1/gen_ai_cache_service.rb +108 -0
  174. data/proto_docs/google/cloud/aiplatform/v1/notebook_runtime.rb +42 -2
  175. data/proto_docs/google/cloud/aiplatform/v1/prediction_service.rb +11 -0
  176. data/proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb +87 -0
  177. data/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_execution_service.rb +73 -0
  178. data/proto_docs/google/cloud/aiplatform/v1/reasoning_engine_service.rb +136 -0
  179. data/proto_docs/google/cloud/aiplatform/v1/tool.rb +15 -0
  180. data/proto_docs/google/type/latlng.rb +38 -0
  181. metadata +42 -8
@@ -0,0 +1,872 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/aiplatform/v1/gen_ai_cache_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 GenAiCacheService
29
+ ##
30
+ # Client for the GenAiCacheService service.
31
+ #
32
+ # Service for managing Vertex AI's CachedContent resource.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :gen_ai_cache_service_stub
45
+
46
+ ##
47
+ # Configure the GenAiCacheService Client class.
48
+ #
49
+ # See {::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all GenAiCacheService clients
55
+ # ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "AIPlatform", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the GenAiCacheService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @gen_ai_cache_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new GenAiCacheService client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the GenAiCacheService client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # These require statements are intentionally placed here to initialize
128
+ # the gRPC module only when it's required.
129
+ # See https://github.com/googleapis/toolkit/issues/446
130
+ require "gapic/grpc"
131
+ require "google/cloud/aiplatform/v1/gen_ai_cache_service_services_pb"
132
+
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @gen_ai_cache_service_stub = ::Gapic::ServiceStub.new(
155
+ ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Stub,
156
+ credentials: credentials,
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
160
+ channel_args: @config.channel_args,
161
+ interceptors: @config.interceptors,
162
+ channel_pool_config: @config.channel_pool,
163
+ logger: @config.logger
164
+ )
165
+
166
+ @gen_ai_cache_service_stub.stub_logger&.info do |entry|
167
+ entry.set_system_name
168
+ entry.set_service
169
+ entry.message = "Created client for #{entry.service}"
170
+ entry.set_credentials_fields credentials
171
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
172
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
173
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
174
+ end
175
+
176
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
177
+ config.credentials = credentials
178
+ config.quota_project = @quota_project_id
179
+ config.endpoint = @gen_ai_cache_service_stub.endpoint
180
+ config.universe_domain = @gen_ai_cache_service_stub.universe_domain
181
+ config.logger = @gen_ai_cache_service_stub.logger if config.respond_to? :logger=
182
+ end
183
+
184
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
185
+ config.credentials = credentials
186
+ config.quota_project = @quota_project_id
187
+ config.endpoint = @gen_ai_cache_service_stub.endpoint
188
+ config.universe_domain = @gen_ai_cache_service_stub.universe_domain
189
+ config.logger = @gen_ai_cache_service_stub.logger if config.respond_to? :logger=
190
+ end
191
+ end
192
+
193
+ ##
194
+ # Get the associated client for mix-in of the Locations.
195
+ #
196
+ # @return [Google::Cloud::Location::Locations::Client]
197
+ #
198
+ attr_reader :location_client
199
+
200
+ ##
201
+ # Get the associated client for mix-in of the IAMPolicy.
202
+ #
203
+ # @return [Google::Iam::V1::IAMPolicy::Client]
204
+ #
205
+ attr_reader :iam_policy_client
206
+
207
+ ##
208
+ # The logger used for request/response debug logging.
209
+ #
210
+ # @return [Logger]
211
+ #
212
+ def logger
213
+ @gen_ai_cache_service_stub.logger
214
+ end
215
+
216
+ # Service calls
217
+
218
+ ##
219
+ # Creates cached content, this call will initialize the cached content in the
220
+ # data storage, and users need to pay for the cache data storage.
221
+ #
222
+ # @overload create_cached_content(request, options = nil)
223
+ # Pass arguments to `create_cached_content` via a request object, either of type
224
+ # {::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest} or an equivalent Hash.
225
+ #
226
+ # @param request [::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest, ::Hash]
227
+ # A request object representing the call parameters. Required. To specify no
228
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
229
+ # @param options [::Gapic::CallOptions, ::Hash]
230
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
231
+ #
232
+ # @overload create_cached_content(parent: nil, cached_content: nil)
233
+ # Pass arguments to `create_cached_content` via keyword arguments. Note that at
234
+ # least one keyword argument is required. To specify no parameters, or to keep all
235
+ # the default parameter values, pass an empty Hash as a request object (see above).
236
+ #
237
+ # @param parent [::String]
238
+ # Required. The parent resource where the cached content will be created
239
+ # @param cached_content [::Google::Cloud::AIPlatform::V1::CachedContent, ::Hash]
240
+ # Required. The cached content to create
241
+ #
242
+ # @yield [response, operation] Access the result along with the RPC operation
243
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::CachedContent]
244
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
245
+ #
246
+ # @return [::Google::Cloud::AIPlatform::V1::CachedContent]
247
+ #
248
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
249
+ #
250
+ # @example Basic example
251
+ # require "google/cloud/ai_platform/v1"
252
+ #
253
+ # # Create a client object. The client can be reused for multiple calls.
254
+ # client = Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new
255
+ #
256
+ # # Create a request. To set request fields, pass in keyword arguments.
257
+ # request = Google::Cloud::AIPlatform::V1::CreateCachedContentRequest.new
258
+ #
259
+ # # Call the create_cached_content method.
260
+ # result = client.create_cached_content request
261
+ #
262
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::CachedContent.
263
+ # p result
264
+ #
265
+ def create_cached_content request, options = nil
266
+ raise ::ArgumentError, "request must be provided" if request.nil?
267
+
268
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateCachedContentRequest
269
+
270
+ # Converts hash and nil to an options object
271
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
272
+
273
+ # Customize the options with defaults
274
+ metadata = @config.rpcs.create_cached_content.metadata.to_h
275
+
276
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
277
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
278
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
279
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
280
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
281
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
282
+
283
+ header_params = {}
284
+ if request.parent
285
+ header_params["parent"] = request.parent
286
+ end
287
+
288
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
289
+ metadata[:"x-goog-request-params"] ||= request_params_header
290
+
291
+ options.apply_defaults timeout: @config.rpcs.create_cached_content.timeout,
292
+ metadata: metadata,
293
+ retry_policy: @config.rpcs.create_cached_content.retry_policy
294
+
295
+ options.apply_defaults timeout: @config.timeout,
296
+ metadata: @config.metadata,
297
+ retry_policy: @config.retry_policy
298
+
299
+ @gen_ai_cache_service_stub.call_rpc :create_cached_content, request, options: options do |response, operation|
300
+ yield response, operation if block_given?
301
+ end
302
+ rescue ::GRPC::BadStatus => e
303
+ raise ::Google::Cloud::Error.from_error(e)
304
+ end
305
+
306
+ ##
307
+ # Gets cached content configurations
308
+ #
309
+ # @overload get_cached_content(request, options = nil)
310
+ # Pass arguments to `get_cached_content` via a request object, either of type
311
+ # {::Google::Cloud::AIPlatform::V1::GetCachedContentRequest} or an equivalent Hash.
312
+ #
313
+ # @param request [::Google::Cloud::AIPlatform::V1::GetCachedContentRequest, ::Hash]
314
+ # A request object representing the call parameters. Required. To specify no
315
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
316
+ # @param options [::Gapic::CallOptions, ::Hash]
317
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
318
+ #
319
+ # @overload get_cached_content(name: nil)
320
+ # Pass arguments to `get_cached_content` via keyword arguments. Note that at
321
+ # least one keyword argument is required. To specify no parameters, or to keep all
322
+ # the default parameter values, pass an empty Hash as a request object (see above).
323
+ #
324
+ # @param name [::String]
325
+ # Required. The resource name referring to the cached content
326
+ #
327
+ # @yield [response, operation] Access the result along with the RPC operation
328
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::CachedContent]
329
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
330
+ #
331
+ # @return [::Google::Cloud::AIPlatform::V1::CachedContent]
332
+ #
333
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
334
+ #
335
+ # @example Basic example
336
+ # require "google/cloud/ai_platform/v1"
337
+ #
338
+ # # Create a client object. The client can be reused for multiple calls.
339
+ # client = Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new
340
+ #
341
+ # # Create a request. To set request fields, pass in keyword arguments.
342
+ # request = Google::Cloud::AIPlatform::V1::GetCachedContentRequest.new
343
+ #
344
+ # # Call the get_cached_content method.
345
+ # result = client.get_cached_content request
346
+ #
347
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::CachedContent.
348
+ # p result
349
+ #
350
+ def get_cached_content request, options = nil
351
+ raise ::ArgumentError, "request must be provided" if request.nil?
352
+
353
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetCachedContentRequest
354
+
355
+ # Converts hash and nil to an options object
356
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
357
+
358
+ # Customize the options with defaults
359
+ metadata = @config.rpcs.get_cached_content.metadata.to_h
360
+
361
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
362
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
363
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
364
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
365
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
366
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
367
+
368
+ header_params = {}
369
+ if request.name
370
+ header_params["name"] = request.name
371
+ end
372
+
373
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
374
+ metadata[:"x-goog-request-params"] ||= request_params_header
375
+
376
+ options.apply_defaults timeout: @config.rpcs.get_cached_content.timeout,
377
+ metadata: metadata,
378
+ retry_policy: @config.rpcs.get_cached_content.retry_policy
379
+
380
+ options.apply_defaults timeout: @config.timeout,
381
+ metadata: @config.metadata,
382
+ retry_policy: @config.retry_policy
383
+
384
+ @gen_ai_cache_service_stub.call_rpc :get_cached_content, request, options: options do |response, operation|
385
+ yield response, operation if block_given?
386
+ end
387
+ rescue ::GRPC::BadStatus => e
388
+ raise ::Google::Cloud::Error.from_error(e)
389
+ end
390
+
391
+ ##
392
+ # Updates cached content configurations
393
+ #
394
+ # @overload update_cached_content(request, options = nil)
395
+ # Pass arguments to `update_cached_content` via a request object, either of type
396
+ # {::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest} or an equivalent Hash.
397
+ #
398
+ # @param request [::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest, ::Hash]
399
+ # A request object representing the call parameters. Required. To specify no
400
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
401
+ # @param options [::Gapic::CallOptions, ::Hash]
402
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
403
+ #
404
+ # @overload update_cached_content(cached_content: nil, update_mask: nil)
405
+ # Pass arguments to `update_cached_content` via keyword arguments. Note that at
406
+ # least one keyword argument is required. To specify no parameters, or to keep all
407
+ # the default parameter values, pass an empty Hash as a request object (see above).
408
+ #
409
+ # @param cached_content [::Google::Cloud::AIPlatform::V1::CachedContent, ::Hash]
410
+ # Required. The cached content to update
411
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
412
+ # Required. The list of fields to update.
413
+ #
414
+ # @yield [response, operation] Access the result along with the RPC operation
415
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::CachedContent]
416
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
417
+ #
418
+ # @return [::Google::Cloud::AIPlatform::V1::CachedContent]
419
+ #
420
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
421
+ #
422
+ # @example Basic example
423
+ # require "google/cloud/ai_platform/v1"
424
+ #
425
+ # # Create a client object. The client can be reused for multiple calls.
426
+ # client = Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new
427
+ #
428
+ # # Create a request. To set request fields, pass in keyword arguments.
429
+ # request = Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest.new
430
+ #
431
+ # # Call the update_cached_content method.
432
+ # result = client.update_cached_content request
433
+ #
434
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::CachedContent.
435
+ # p result
436
+ #
437
+ def update_cached_content request, options = nil
438
+ raise ::ArgumentError, "request must be provided" if request.nil?
439
+
440
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateCachedContentRequest
441
+
442
+ # Converts hash and nil to an options object
443
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
444
+
445
+ # Customize the options with defaults
446
+ metadata = @config.rpcs.update_cached_content.metadata.to_h
447
+
448
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
449
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
450
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
451
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
452
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
453
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
454
+
455
+ header_params = {}
456
+ if request.cached_content&.name
457
+ header_params["cached_content.name"] = request.cached_content.name
458
+ end
459
+
460
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
461
+ metadata[:"x-goog-request-params"] ||= request_params_header
462
+
463
+ options.apply_defaults timeout: @config.rpcs.update_cached_content.timeout,
464
+ metadata: metadata,
465
+ retry_policy: @config.rpcs.update_cached_content.retry_policy
466
+
467
+ options.apply_defaults timeout: @config.timeout,
468
+ metadata: @config.metadata,
469
+ retry_policy: @config.retry_policy
470
+
471
+ @gen_ai_cache_service_stub.call_rpc :update_cached_content, request, options: options do |response, operation|
472
+ yield response, operation if block_given?
473
+ end
474
+ rescue ::GRPC::BadStatus => e
475
+ raise ::Google::Cloud::Error.from_error(e)
476
+ end
477
+
478
+ ##
479
+ # Deletes cached content
480
+ #
481
+ # @overload delete_cached_content(request, options = nil)
482
+ # Pass arguments to `delete_cached_content` via a request object, either of type
483
+ # {::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest} or an equivalent Hash.
484
+ #
485
+ # @param request [::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest, ::Hash]
486
+ # A request object representing the call parameters. Required. To specify no
487
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
488
+ # @param options [::Gapic::CallOptions, ::Hash]
489
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
490
+ #
491
+ # @overload delete_cached_content(name: nil)
492
+ # Pass arguments to `delete_cached_content` via keyword arguments. Note that at
493
+ # least one keyword argument is required. To specify no parameters, or to keep all
494
+ # the default parameter values, pass an empty Hash as a request object (see above).
495
+ #
496
+ # @param name [::String]
497
+ # Required. The resource name referring to the cached content
498
+ #
499
+ # @yield [response, operation] Access the result along with the RPC operation
500
+ # @yieldparam response [::Google::Protobuf::Empty]
501
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
502
+ #
503
+ # @return [::Google::Protobuf::Empty]
504
+ #
505
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
506
+ #
507
+ # @example Basic example
508
+ # require "google/cloud/ai_platform/v1"
509
+ #
510
+ # # Create a client object. The client can be reused for multiple calls.
511
+ # client = Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new
512
+ #
513
+ # # Create a request. To set request fields, pass in keyword arguments.
514
+ # request = Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest.new
515
+ #
516
+ # # Call the delete_cached_content method.
517
+ # result = client.delete_cached_content request
518
+ #
519
+ # # The returned object is of type Google::Protobuf::Empty.
520
+ # p result
521
+ #
522
+ def delete_cached_content request, options = nil
523
+ raise ::ArgumentError, "request must be provided" if request.nil?
524
+
525
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteCachedContentRequest
526
+
527
+ # Converts hash and nil to an options object
528
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
529
+
530
+ # Customize the options with defaults
531
+ metadata = @config.rpcs.delete_cached_content.metadata.to_h
532
+
533
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
534
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
535
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
536
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
537
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
538
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
539
+
540
+ header_params = {}
541
+ if request.name
542
+ header_params["name"] = request.name
543
+ end
544
+
545
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
546
+ metadata[:"x-goog-request-params"] ||= request_params_header
547
+
548
+ options.apply_defaults timeout: @config.rpcs.delete_cached_content.timeout,
549
+ metadata: metadata,
550
+ retry_policy: @config.rpcs.delete_cached_content.retry_policy
551
+
552
+ options.apply_defaults timeout: @config.timeout,
553
+ metadata: @config.metadata,
554
+ retry_policy: @config.retry_policy
555
+
556
+ @gen_ai_cache_service_stub.call_rpc :delete_cached_content, request, options: options do |response, operation|
557
+ yield response, operation if block_given?
558
+ end
559
+ rescue ::GRPC::BadStatus => e
560
+ raise ::Google::Cloud::Error.from_error(e)
561
+ end
562
+
563
+ ##
564
+ # Lists cached contents in a project
565
+ #
566
+ # @overload list_cached_contents(request, options = nil)
567
+ # Pass arguments to `list_cached_contents` via a request object, either of type
568
+ # {::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest} or an equivalent Hash.
569
+ #
570
+ # @param request [::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest, ::Hash]
571
+ # A request object representing the call parameters. Required. To specify no
572
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
573
+ # @param options [::Gapic::CallOptions, ::Hash]
574
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
575
+ #
576
+ # @overload list_cached_contents(parent: nil, page_size: nil, page_token: nil)
577
+ # Pass arguments to `list_cached_contents` via keyword arguments. Note that at
578
+ # least one keyword argument is required. To specify no parameters, or to keep all
579
+ # the default parameter values, pass an empty Hash as a request object (see above).
580
+ #
581
+ # @param parent [::String]
582
+ # Required. The parent, which owns this collection of cached contents.
583
+ # @param page_size [::Integer]
584
+ # Optional. The maximum number of cached contents to return. The service may
585
+ # return fewer than this value. If unspecified, some default (under maximum)
586
+ # number of items will be returned. The maximum value is 1000; values above
587
+ # 1000 will be coerced to 1000.
588
+ # @param page_token [::String]
589
+ # Optional. A page token, received from a previous `ListCachedContents` call.
590
+ # Provide this to retrieve the subsequent page.
591
+ #
592
+ # When paginating, all other parameters provided to `ListCachedContents` must
593
+ # match the call that provided the page token.
594
+ #
595
+ # @yield [response, operation] Access the result along with the RPC operation
596
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CachedContent>]
597
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
598
+ #
599
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::CachedContent>]
600
+ #
601
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
602
+ #
603
+ # @example Basic example
604
+ # require "google/cloud/ai_platform/v1"
605
+ #
606
+ # # Create a client object. The client can be reused for multiple calls.
607
+ # client = Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new
608
+ #
609
+ # # Create a request. To set request fields, pass in keyword arguments.
610
+ # request = Google::Cloud::AIPlatform::V1::ListCachedContentsRequest.new
611
+ #
612
+ # # Call the list_cached_contents method.
613
+ # result = client.list_cached_contents request
614
+ #
615
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
616
+ # # over elements, and API calls will be issued to fetch pages as needed.
617
+ # result.each do |item|
618
+ # # Each element is of type ::Google::Cloud::AIPlatform::V1::CachedContent.
619
+ # p item
620
+ # end
621
+ #
622
+ def list_cached_contents request, options = nil
623
+ raise ::ArgumentError, "request must be provided" if request.nil?
624
+
625
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListCachedContentsRequest
626
+
627
+ # Converts hash and nil to an options object
628
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
629
+
630
+ # Customize the options with defaults
631
+ metadata = @config.rpcs.list_cached_contents.metadata.to_h
632
+
633
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
634
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
635
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
636
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
637
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
638
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
639
+
640
+ header_params = {}
641
+ if request.parent
642
+ header_params["parent"] = request.parent
643
+ end
644
+
645
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
646
+ metadata[:"x-goog-request-params"] ||= request_params_header
647
+
648
+ options.apply_defaults timeout: @config.rpcs.list_cached_contents.timeout,
649
+ metadata: metadata,
650
+ retry_policy: @config.rpcs.list_cached_contents.retry_policy
651
+
652
+ options.apply_defaults timeout: @config.timeout,
653
+ metadata: @config.metadata,
654
+ retry_policy: @config.retry_policy
655
+
656
+ @gen_ai_cache_service_stub.call_rpc :list_cached_contents, request, options: options do |response, operation|
657
+ response = ::Gapic::PagedEnumerable.new @gen_ai_cache_service_stub, :list_cached_contents, request, response, operation, options
658
+ yield response, operation if block_given?
659
+ throw :response, response
660
+ end
661
+ rescue ::GRPC::BadStatus => e
662
+ raise ::Google::Cloud::Error.from_error(e)
663
+ end
664
+
665
+ ##
666
+ # Configuration class for the GenAiCacheService API.
667
+ #
668
+ # This class represents the configuration for GenAiCacheService,
669
+ # providing control over timeouts, retry behavior, logging, transport
670
+ # parameters, and other low-level controls. Certain parameters can also be
671
+ # applied individually to specific RPCs. See
672
+ # {::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client::Configuration::Rpcs}
673
+ # for a list of RPCs that can be configured independently.
674
+ #
675
+ # Configuration can be applied globally to all clients, or to a single client
676
+ # on construction.
677
+ #
678
+ # @example
679
+ #
680
+ # # Modify the global config, setting the timeout for
681
+ # # create_cached_content to 20 seconds,
682
+ # # and all remaining timeouts to 10 seconds.
683
+ # ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.configure do |config|
684
+ # config.timeout = 10.0
685
+ # config.rpcs.create_cached_content.timeout = 20.0
686
+ # end
687
+ #
688
+ # # Apply the above configuration only to a new client.
689
+ # client = ::Google::Cloud::AIPlatform::V1::GenAiCacheService::Client.new do |config|
690
+ # config.timeout = 10.0
691
+ # config.rpcs.create_cached_content.timeout = 20.0
692
+ # end
693
+ #
694
+ # @!attribute [rw] endpoint
695
+ # A custom service endpoint, as a hostname or hostname:port. The default is
696
+ # nil, indicating to use the default endpoint in the current universe domain.
697
+ # @return [::String,nil]
698
+ # @!attribute [rw] credentials
699
+ # Credentials to send with calls. You may provide any of the following types:
700
+ # * (`String`) The path to a service account key file in JSON format
701
+ # * (`Hash`) A service account key as a Hash
702
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
703
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
704
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
705
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
706
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
707
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
708
+ # * (`nil`) indicating no credentials
709
+ # @return [::Object]
710
+ # @!attribute [rw] scope
711
+ # The OAuth scopes
712
+ # @return [::Array<::String>]
713
+ # @!attribute [rw] lib_name
714
+ # The library name as recorded in instrumentation and logging
715
+ # @return [::String]
716
+ # @!attribute [rw] lib_version
717
+ # The library version as recorded in instrumentation and logging
718
+ # @return [::String]
719
+ # @!attribute [rw] channel_args
720
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
721
+ # `GRPC::Core::Channel` object is provided as the credential.
722
+ # @return [::Hash]
723
+ # @!attribute [rw] interceptors
724
+ # An array of interceptors that are run before calls are executed.
725
+ # @return [::Array<::GRPC::ClientInterceptor>]
726
+ # @!attribute [rw] timeout
727
+ # The call timeout in seconds.
728
+ # @return [::Numeric]
729
+ # @!attribute [rw] metadata
730
+ # Additional gRPC headers to be sent with the call.
731
+ # @return [::Hash{::Symbol=>::String}]
732
+ # @!attribute [rw] retry_policy
733
+ # The retry policy. The value is a hash with the following keys:
734
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
735
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
736
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
737
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
738
+ # trigger a retry.
739
+ # @return [::Hash]
740
+ # @!attribute [rw] quota_project
741
+ # A separate project against which to charge quota.
742
+ # @return [::String]
743
+ # @!attribute [rw] universe_domain
744
+ # The universe domain within which to make requests. This determines the
745
+ # default endpoint URL. The default value of nil uses the environment
746
+ # universe (usually the default "googleapis.com" universe).
747
+ # @return [::String,nil]
748
+ # @!attribute [rw] logger
749
+ # A custom logger to use for request/response debug logging, or the value
750
+ # `:default` (the default) to construct a default logger, or `nil` to
751
+ # explicitly disable logging.
752
+ # @return [::Logger,:default,nil]
753
+ #
754
+ class Configuration
755
+ extend ::Gapic::Config
756
+
757
+ # @private
758
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
759
+ DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
760
+
761
+ config_attr :endpoint, nil, ::String, nil
762
+ config_attr :credentials, nil do |value|
763
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
764
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
765
+ allowed.any? { |klass| klass === value }
766
+ end
767
+ config_attr :scope, nil, ::String, ::Array, nil
768
+ config_attr :lib_name, nil, ::String, nil
769
+ config_attr :lib_version, nil, ::String, nil
770
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
771
+ config_attr :interceptors, nil, ::Array, nil
772
+ config_attr :timeout, nil, ::Numeric, nil
773
+ config_attr :metadata, nil, ::Hash, nil
774
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
775
+ config_attr :quota_project, nil, ::String, nil
776
+ config_attr :universe_domain, nil, ::String, nil
777
+ config_attr :logger, :default, ::Logger, nil, :default
778
+
779
+ # @private
780
+ def initialize parent_config = nil
781
+ @parent_config = parent_config unless parent_config.nil?
782
+
783
+ yield self if block_given?
784
+ end
785
+
786
+ ##
787
+ # Configurations for individual RPCs
788
+ # @return [Rpcs]
789
+ #
790
+ def rpcs
791
+ @rpcs ||= begin
792
+ parent_rpcs = nil
793
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
794
+ Rpcs.new parent_rpcs
795
+ end
796
+ end
797
+
798
+ ##
799
+ # Configuration for the channel pool
800
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
801
+ #
802
+ def channel_pool
803
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
804
+ end
805
+
806
+ ##
807
+ # Configuration RPC class for the GenAiCacheService API.
808
+ #
809
+ # Includes fields providing the configuration for each RPC in this service.
810
+ # Each configuration object is of type `Gapic::Config::Method` and includes
811
+ # the following configuration fields:
812
+ #
813
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
814
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
815
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
816
+ # include the following keys:
817
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
818
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
819
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
820
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
821
+ # trigger a retry.
822
+ #
823
+ class Rpcs
824
+ ##
825
+ # RPC-specific configuration for `create_cached_content`
826
+ # @return [::Gapic::Config::Method]
827
+ #
828
+ attr_reader :create_cached_content
829
+ ##
830
+ # RPC-specific configuration for `get_cached_content`
831
+ # @return [::Gapic::Config::Method]
832
+ #
833
+ attr_reader :get_cached_content
834
+ ##
835
+ # RPC-specific configuration for `update_cached_content`
836
+ # @return [::Gapic::Config::Method]
837
+ #
838
+ attr_reader :update_cached_content
839
+ ##
840
+ # RPC-specific configuration for `delete_cached_content`
841
+ # @return [::Gapic::Config::Method]
842
+ #
843
+ attr_reader :delete_cached_content
844
+ ##
845
+ # RPC-specific configuration for `list_cached_contents`
846
+ # @return [::Gapic::Config::Method]
847
+ #
848
+ attr_reader :list_cached_contents
849
+
850
+ # @private
851
+ def initialize parent_rpcs = nil
852
+ create_cached_content_config = parent_rpcs.create_cached_content if parent_rpcs.respond_to? :create_cached_content
853
+ @create_cached_content = ::Gapic::Config::Method.new create_cached_content_config
854
+ get_cached_content_config = parent_rpcs.get_cached_content if parent_rpcs.respond_to? :get_cached_content
855
+ @get_cached_content = ::Gapic::Config::Method.new get_cached_content_config
856
+ update_cached_content_config = parent_rpcs.update_cached_content if parent_rpcs.respond_to? :update_cached_content
857
+ @update_cached_content = ::Gapic::Config::Method.new update_cached_content_config
858
+ delete_cached_content_config = parent_rpcs.delete_cached_content if parent_rpcs.respond_to? :delete_cached_content
859
+ @delete_cached_content = ::Gapic::Config::Method.new delete_cached_content_config
860
+ list_cached_contents_config = parent_rpcs.list_cached_contents if parent_rpcs.respond_to? :list_cached_contents
861
+ @list_cached_contents = ::Gapic::Config::Method.new list_cached_contents_config
862
+
863
+ yield self if block_given?
864
+ end
865
+ end
866
+ end
867
+ end
868
+ end
869
+ end
870
+ end
871
+ end
872
+ end