google-cloud-ai_platform-v1 0.61.0 → 0.63.0

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