google-cloud-sql-v1 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +146 -8
  5. data/lib/google/cloud/sql/v1/cloud_sql_available_database_versions_pb.rb +25 -0
  6. data/lib/google/cloud/sql/v1/cloud_sql_available_database_versions_services_pb.rb +29 -0
  7. data/lib/google/cloud/sql/v1/cloud_sql_backup_runs_pb.rb +35 -0
  8. data/lib/google/cloud/sql/v1/cloud_sql_backup_runs_services_pb.rb +53 -0
  9. data/lib/google/cloud/sql/v1/cloud_sql_backups_pb.rb +41 -0
  10. data/lib/google/cloud/sql/v1/cloud_sql_backups_services_pb.rb +54 -0
  11. data/lib/google/cloud/sql/v1/cloud_sql_connect_pb.rb +34 -0
  12. data/lib/google/cloud/sql/v1/cloud_sql_connect_services_pb.rb +50 -0
  13. data/lib/google/cloud/sql/v1/cloud_sql_databases_pb.rb +30 -0
  14. data/lib/google/cloud/sql/v1/cloud_sql_databases_services_pb.rb +61 -0
  15. data/lib/google/cloud/sql/v1/cloud_sql_events_pb.rb +25 -0
  16. data/lib/google/cloud/sql/v1/cloud_sql_events_services_pb.rb +29 -0
  17. data/lib/google/cloud/sql/v1/cloud_sql_feature_eligibility_pb.rb +24 -0
  18. data/lib/google/cloud/sql/v1/cloud_sql_feature_eligibility_services_pb.rb +29 -0
  19. data/lib/google/cloud/sql/v1/cloud_sql_flags_pb.rb +31 -0
  20. data/lib/google/cloud/sql/v1/cloud_sql_flags_services_pb.rb +45 -0
  21. data/lib/google/cloud/sql/v1/cloud_sql_iam_policies_pb.rb +23 -0
  22. data/lib/google/cloud/sql/v1/cloud_sql_iam_policies_services_pb.rb +29 -0
  23. data/lib/google/cloud/sql/v1/cloud_sql_instance_names_pb.rb +24 -0
  24. data/lib/google/cloud/sql/v1/cloud_sql_instance_names_services_pb.rb +29 -0
  25. data/lib/google/cloud/sql/v1/cloud_sql_instances_pb.rb +146 -0
  26. data/lib/google/cloud/sql/v1/cloud_sql_instances_services_pb.rb +184 -0
  27. data/lib/google/cloud/sql/v1/cloud_sql_operations_pb.rb +30 -0
  28. data/lib/google/cloud/sql/v1/cloud_sql_operations_services_pb.rb +50 -0
  29. data/lib/google/cloud/sql/v1/cloud_sql_regions_pb.rb +25 -0
  30. data/lib/google/cloud/sql/v1/cloud_sql_regions_services_pb.rb +29 -0
  31. data/lib/google/cloud/sql/v1/cloud_sql_resources_pb.rb +119 -0
  32. data/lib/google/cloud/sql/v1/cloud_sql_ssl_certs_pb.rb +31 -0
  33. data/lib/google/cloud/sql/v1/cloud_sql_ssl_certs_services_pb.rb +56 -0
  34. data/lib/google/cloud/sql/v1/cloud_sql_tiers_pb.rb +26 -0
  35. data/lib/google/cloud/sql/v1/cloud_sql_tiers_services_pb.rb +47 -0
  36. data/lib/google/cloud/sql/v1/cloud_sql_users_pb.rb +41 -0
  37. data/lib/google/cloud/sql/v1/cloud_sql_users_services_pb.rb +53 -0
  38. data/lib/google/cloud/sql/v1/rest.rb +46 -0
  39. data/lib/google/cloud/sql/v1/sql_backup_runs_service/client.rb +809 -0
  40. data/lib/google/cloud/sql/v1/sql_backup_runs_service/credentials.rb +48 -0
  41. data/lib/google/cloud/sql/v1/sql_backup_runs_service/rest/client.rb +720 -0
  42. data/lib/google/cloud/sql/v1/sql_backup_runs_service/rest/service_stub.rb +332 -0
  43. data/lib/google/cloud/sql/v1/sql_backup_runs_service/rest.rb +51 -0
  44. data/lib/google/cloud/sql/v1/sql_backup_runs_service.rb +54 -0
  45. data/lib/google/cloud/sql/v1/sql_backups_service/client.rb +896 -0
  46. data/lib/google/cloud/sql/v1/sql_backups_service/credentials.rb +48 -0
  47. data/lib/google/cloud/sql/v1/sql_backups_service/paths.rb +64 -0
  48. data/lib/google/cloud/sql/v1/sql_backups_service/rest/client.rb +818 -0
  49. data/lib/google/cloud/sql/v1/sql_backups_service/rest/service_stub.rb +388 -0
  50. data/lib/google/cloud/sql/v1/sql_backups_service/rest.rb +50 -0
  51. data/lib/google/cloud/sql/v1/sql_backups_service.rb +53 -0
  52. data/lib/google/cloud/sql/v1/sql_connect_service/client.rb +607 -0
  53. data/lib/google/cloud/sql/v1/sql_connect_service/credentials.rb +48 -0
  54. data/lib/google/cloud/sql/v1/sql_connect_service/rest/client.rb +544 -0
  55. data/lib/google/cloud/sql/v1/sql_connect_service/rest/service_stub.rb +206 -0
  56. data/lib/google/cloud/sql/v1/sql_connect_service/rest.rb +51 -0
  57. data/lib/google/cloud/sql/v1/sql_connect_service.rb +54 -0
  58. data/lib/google/cloud/sql/v1/sql_databases_service/client.rb +1011 -0
  59. data/lib/google/cloud/sql/v1/sql_databases_service/credentials.rb +48 -0
  60. data/lib/google/cloud/sql/v1/sql_databases_service/rest/client.rb +896 -0
  61. data/lib/google/cloud/sql/v1/sql_databases_service/rest/service_stub.rb +460 -0
  62. data/lib/google/cloud/sql/v1/sql_databases_service/rest.rb +51 -0
  63. data/lib/google/cloud/sql/v1/sql_databases_service.rb +54 -0
  64. data/lib/google/cloud/sql/v1/sql_flags_service/client.rb +488 -0
  65. data/lib/google/cloud/sql/v1/sql_flags_service/credentials.rb +48 -0
  66. data/lib/google/cloud/sql/v1/sql_flags_service/rest/client.rb +446 -0
  67. data/lib/google/cloud/sql/v1/sql_flags_service/rest/service_stub.rb +140 -0
  68. data/lib/google/cloud/sql/v1/sql_flags_service/rest.rb +51 -0
  69. data/lib/google/cloud/sql/v1/sql_flags_service.rb +54 -0
  70. data/lib/google/cloud/sql/v1/sql_instances_service/client.rb +4738 -0
  71. data/lib/google/cloud/sql/v1/sql_instances_service/credentials.rb +48 -0
  72. data/lib/google/cloud/sql/v1/sql_instances_service/paths.rb +95 -0
  73. data/lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb +4274 -0
  74. data/lib/google/cloud/sql/v1/sql_instances_service/rest/service_stub.rb +2769 -0
  75. data/lib/google/cloud/sql/v1/sql_instances_service/rest.rb +50 -0
  76. data/lib/google/cloud/sql/v1/sql_instances_service.rb +53 -0
  77. data/lib/google/cloud/sql/v1/sql_operations_service/client.rb +694 -0
  78. data/lib/google/cloud/sql/v1/sql_operations_service/credentials.rb +48 -0
  79. data/lib/google/cloud/sql/v1/sql_operations_service/rest/client.rb +624 -0
  80. data/lib/google/cloud/sql/v1/sql_operations_service/rest/service_stub.rb +266 -0
  81. data/lib/google/cloud/sql/v1/sql_operations_service/rest.rb +51 -0
  82. data/lib/google/cloud/sql/v1/sql_operations_service.rb +54 -0
  83. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/client.rb +804 -0
  84. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/credentials.rb +48 -0
  85. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/rest/client.rb +715 -0
  86. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/rest/service_stub.rb +332 -0
  87. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/rest.rb +51 -0
  88. data/lib/google/cloud/sql/v1/sql_ssl_certs_service.rb +54 -0
  89. data/lib/google/cloud/sql/v1/sql_tiers_service/client.rb +494 -0
  90. data/lib/google/cloud/sql/v1/sql_tiers_service/credentials.rb +48 -0
  91. data/lib/google/cloud/sql/v1/sql_tiers_service/rest/client.rb +444 -0
  92. data/lib/google/cloud/sql/v1/sql_tiers_service/rest/service_stub.rb +142 -0
  93. data/lib/google/cloud/sql/v1/sql_tiers_service/rest.rb +51 -0
  94. data/lib/google/cloud/sql/v1/sql_tiers_service.rb +54 -0
  95. data/lib/google/cloud/sql/v1/sql_users_service/client.rb +909 -0
  96. data/lib/google/cloud/sql/v1/sql_users_service/credentials.rb +48 -0
  97. data/lib/google/cloud/sql/v1/sql_users_service/rest/client.rb +813 -0
  98. data/lib/google/cloud/sql/v1/sql_users_service/rest/service_stub.rb +394 -0
  99. data/lib/google/cloud/sql/v1/sql_users_service/rest.rb +51 -0
  100. data/lib/google/cloud/sql/v1/sql_users_service.rb +54 -0
  101. data/lib/google/cloud/sql/v1/version.rb +8 -3
  102. data/lib/google/cloud/sql/v1.rb +60 -0
  103. data/lib/google-cloud-sql-v1.rb +21 -0
  104. data/proto_docs/README.md +4 -0
  105. data/proto_docs/google/api/client.rb +593 -0
  106. data/proto_docs/google/api/field_behavior.rb +85 -0
  107. data/proto_docs/google/api/field_info.rb +88 -0
  108. data/proto_docs/google/api/launch_stage.rb +71 -0
  109. data/proto_docs/google/api/resource.rb +227 -0
  110. data/proto_docs/google/cloud/sql/v1/cloud_sql_backup_runs.rb +245 -0
  111. data/proto_docs/google/cloud/sql/v1/cloud_sql_backups.rb +259 -0
  112. data/proto_docs/google/cloud/sql/v1/cloud_sql_connect.rb +190 -0
  113. data/proto_docs/google/cloud/sql/v1/cloud_sql_databases.rb +111 -0
  114. data/proto_docs/google/cloud/sql/v1/cloud_sql_flags.rb +154 -0
  115. data/proto_docs/google/cloud/sql/v1/cloud_sql_instances.rb +2357 -0
  116. data/proto_docs/google/cloud/sql/v1/cloud_sql_operations.rb +85 -0
  117. data/proto_docs/google/cloud/sql/v1/cloud_sql_resources.rb +2522 -0
  118. data/proto_docs/google/cloud/sql/v1/cloud_sql_ssl_certs.rb +120 -0
  119. data/proto_docs/google/cloud/sql/v1/cloud_sql_tiers.rb +69 -0
  120. data/proto_docs/google/cloud/sql/v1/cloud_sql_users.rb +291 -0
  121. data/proto_docs/google/protobuf/any.rb +145 -0
  122. data/proto_docs/google/protobuf/duration.rb +98 -0
  123. data/proto_docs/google/protobuf/empty.rb +34 -0
  124. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  125. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  126. data/proto_docs/google/protobuf/wrappers.rb +148 -0
  127. data/proto_docs/google/rpc/status.rb +48 -0
  128. data/proto_docs/google/type/interval.rb +45 -0
  129. metadata +176 -14
@@ -0,0 +1,804 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/sql/v1/cloud_sql_ssl_certs_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Sql
26
+ module V1
27
+ module SqlSslCertsService
28
+ ##
29
+ # Client for the SqlSslCertsService service.
30
+ #
31
+ # Service to manage SSL certs for Cloud SQL instances.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "sqladmin.$UNIVERSE_DOMAIN$"
39
+
40
+ # @private
41
+ attr_reader :sql_ssl_certs_service_stub
42
+
43
+ ##
44
+ # Configure the SqlSslCertsService Client class.
45
+ #
46
+ # See {::Google::Cloud::Sql::V1::SqlSslCertsService::Client::Configuration}
47
+ # for a description of the configuration fields.
48
+ #
49
+ # @example
50
+ #
51
+ # # Modify the configuration for all SqlSslCertsService clients
52
+ # ::Google::Cloud::Sql::V1::SqlSslCertsService::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
55
+ #
56
+ # @yield [config] Configure the Client client.
57
+ # @yieldparam config [Client::Configuration]
58
+ #
59
+ # @return [Client::Configuration]
60
+ #
61
+ def self.configure
62
+ @configure ||= begin
63
+ namespace = ["Google", "Cloud", "Sql", "V1"]
64
+ parent_config = while namespace.any?
65
+ parent_name = namespace.join "::"
66
+ parent_const = const_get parent_name
67
+ break parent_const.configure if parent_const.respond_to? :configure
68
+ namespace.pop
69
+ end
70
+ default_config = Client::Configuration.new parent_config
71
+
72
+ default_config.timeout = 60.0
73
+
74
+ default_config
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the SqlSslCertsService Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::Sql::V1::SqlSslCertsService::Client::Configuration}
88
+ # for a description of the configuration fields.
89
+ #
90
+ # @yield [config] Configure the Client client.
91
+ # @yieldparam config [Client::Configuration]
92
+ #
93
+ # @return [Client::Configuration]
94
+ #
95
+ def configure
96
+ yield @config if block_given?
97
+ @config
98
+ end
99
+
100
+ ##
101
+ # The effective universe domain
102
+ #
103
+ # @return [String]
104
+ #
105
+ def universe_domain
106
+ @sql_ssl_certs_service_stub.universe_domain
107
+ end
108
+
109
+ ##
110
+ # Create a new SqlSslCertsService client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::Sql::V1::SqlSslCertsService::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::Sql::V1::SqlSslCertsService::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the SqlSslCertsService client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # These require statements are intentionally placed here to initialize
127
+ # the gRPC module only when it's required.
128
+ # See https://github.com/googleapis/toolkit/issues/446
129
+ require "gapic/grpc"
130
+ require "google/cloud/sql/v1/cloud_sql_ssl_certs_services_pb"
131
+
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+ @quota_project_id = @config.quota_project
151
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
152
+
153
+ @sql_ssl_certs_service_stub = ::Gapic::ServiceStub.new(
154
+ ::Google::Cloud::Sql::V1::SqlSslCertsService::Stub,
155
+ credentials: credentials,
156
+ endpoint: @config.endpoint,
157
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
+ universe_domain: @config.universe_domain,
159
+ channel_args: @config.channel_args,
160
+ interceptors: @config.interceptors,
161
+ channel_pool_config: @config.channel_pool,
162
+ logger: @config.logger
163
+ )
164
+
165
+ @sql_ssl_certs_service_stub.stub_logger&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+
175
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
176
+ config.credentials = credentials
177
+ config.quota_project = @quota_project_id
178
+ config.endpoint = @sql_ssl_certs_service_stub.endpoint
179
+ config.universe_domain = @sql_ssl_certs_service_stub.universe_domain
180
+ config.logger = @sql_ssl_certs_service_stub.logger if config.respond_to? :logger=
181
+ end
182
+ end
183
+
184
+ ##
185
+ # Get the associated client for mix-in of the Locations.
186
+ #
187
+ # @return [Google::Cloud::Location::Locations::Client]
188
+ #
189
+ attr_reader :location_client
190
+
191
+ ##
192
+ # The logger used for request/response debug logging.
193
+ #
194
+ # @return [Logger]
195
+ #
196
+ def logger
197
+ @sql_ssl_certs_service_stub.logger
198
+ end
199
+
200
+ # Service calls
201
+
202
+ ##
203
+ # Deletes the SSL certificate. For First Generation instances, the
204
+ # certificate remains valid until the instance is restarted.
205
+ #
206
+ # @overload delete(request, options = nil)
207
+ # Pass arguments to `delete` via a request object, either of type
208
+ # {::Google::Cloud::Sql::V1::SqlSslCertsDeleteRequest} or an equivalent Hash.
209
+ #
210
+ # @param request [::Google::Cloud::Sql::V1::SqlSslCertsDeleteRequest, ::Hash]
211
+ # A request object representing the call parameters. Required. To specify no
212
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
213
+ # @param options [::Gapic::CallOptions, ::Hash]
214
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
215
+ #
216
+ # @overload delete(instance: nil, project: nil, sha1_fingerprint: nil)
217
+ # Pass arguments to `delete` via keyword arguments. Note that at
218
+ # least one keyword argument is required. To specify no parameters, or to keep all
219
+ # the default parameter values, pass an empty Hash as a request object (see above).
220
+ #
221
+ # @param instance [::String]
222
+ # Cloud SQL instance ID. This does not include the project ID.
223
+ # @param project [::String]
224
+ # Project ID of the project that contains the instance.
225
+ # @param sha1_fingerprint [::String]
226
+ # Sha1 FingerPrint.
227
+ #
228
+ # @yield [response, operation] Access the result along with the RPC operation
229
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
230
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
231
+ #
232
+ # @return [::Google::Cloud::Sql::V1::Operation]
233
+ #
234
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
235
+ #
236
+ # @example Basic example
237
+ # require "google/cloud/sql/v1"
238
+ #
239
+ # # Create a client object. The client can be reused for multiple calls.
240
+ # client = Google::Cloud::Sql::V1::SqlSslCertsService::Client.new
241
+ #
242
+ # # Create a request. To set request fields, pass in keyword arguments.
243
+ # request = Google::Cloud::Sql::V1::SqlSslCertsDeleteRequest.new
244
+ #
245
+ # # Call the delete method.
246
+ # result = client.delete request
247
+ #
248
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
249
+ # p result
250
+ #
251
+ def delete request, options = nil
252
+ raise ::ArgumentError, "request must be provided" if request.nil?
253
+
254
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlSslCertsDeleteRequest
255
+
256
+ # Converts hash and nil to an options object
257
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
258
+
259
+ # Customize the options with defaults
260
+ metadata = @config.rpcs.delete.metadata.to_h
261
+
262
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
263
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
264
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
265
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
266
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
267
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
268
+
269
+ header_params = {}
270
+ if request.project
271
+ header_params["project"] = request.project
272
+ end
273
+ if request.instance
274
+ header_params["instance"] = request.instance
275
+ end
276
+ if request.sha1_fingerprint
277
+ header_params["sha1_fingerprint"] = request.sha1_fingerprint
278
+ end
279
+
280
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
281
+ metadata[:"x-goog-request-params"] ||= request_params_header
282
+
283
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
284
+ metadata: metadata,
285
+ retry_policy: @config.rpcs.delete.retry_policy
286
+
287
+ options.apply_defaults timeout: @config.timeout,
288
+ metadata: @config.metadata,
289
+ retry_policy: @config.retry_policy
290
+
291
+ @sql_ssl_certs_service_stub.call_rpc :delete, request, options: options do |response, operation|
292
+ yield response, operation if block_given?
293
+ end
294
+ rescue ::GRPC::BadStatus => e
295
+ raise ::Google::Cloud::Error.from_error(e)
296
+ end
297
+
298
+ ##
299
+ # Retrieves a particular SSL certificate. Does not include the private key
300
+ # (required for usage). The private key must be saved from the response to
301
+ # initial creation.
302
+ #
303
+ # @overload get(request, options = nil)
304
+ # Pass arguments to `get` via a request object, either of type
305
+ # {::Google::Cloud::Sql::V1::SqlSslCertsGetRequest} or an equivalent Hash.
306
+ #
307
+ # @param request [::Google::Cloud::Sql::V1::SqlSslCertsGetRequest, ::Hash]
308
+ # A request object representing the call parameters. Required. To specify no
309
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
310
+ # @param options [::Gapic::CallOptions, ::Hash]
311
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
312
+ #
313
+ # @overload get(instance: nil, project: nil, sha1_fingerprint: nil)
314
+ # Pass arguments to `get` via keyword arguments. Note that at
315
+ # least one keyword argument is required. To specify no parameters, or to keep all
316
+ # the default parameter values, pass an empty Hash as a request object (see above).
317
+ #
318
+ # @param instance [::String]
319
+ # Cloud SQL instance ID. This does not include the project ID.
320
+ # @param project [::String]
321
+ # Project ID of the project that contains the instance.
322
+ # @param sha1_fingerprint [::String]
323
+ # Sha1 FingerPrint.
324
+ #
325
+ # @yield [response, operation] Access the result along with the RPC operation
326
+ # @yieldparam response [::Google::Cloud::Sql::V1::SslCert]
327
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
328
+ #
329
+ # @return [::Google::Cloud::Sql::V1::SslCert]
330
+ #
331
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
332
+ #
333
+ # @example Basic example
334
+ # require "google/cloud/sql/v1"
335
+ #
336
+ # # Create a client object. The client can be reused for multiple calls.
337
+ # client = Google::Cloud::Sql::V1::SqlSslCertsService::Client.new
338
+ #
339
+ # # Create a request. To set request fields, pass in keyword arguments.
340
+ # request = Google::Cloud::Sql::V1::SqlSslCertsGetRequest.new
341
+ #
342
+ # # Call the get method.
343
+ # result = client.get request
344
+ #
345
+ # # The returned object is of type Google::Cloud::Sql::V1::SslCert.
346
+ # p result
347
+ #
348
+ def get request, options = nil
349
+ raise ::ArgumentError, "request must be provided" if request.nil?
350
+
351
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlSslCertsGetRequest
352
+
353
+ # Converts hash and nil to an options object
354
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
355
+
356
+ # Customize the options with defaults
357
+ metadata = @config.rpcs.get.metadata.to_h
358
+
359
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
360
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
361
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
362
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
363
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
364
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
365
+
366
+ header_params = {}
367
+ if request.project
368
+ header_params["project"] = request.project
369
+ end
370
+ if request.instance
371
+ header_params["instance"] = request.instance
372
+ end
373
+ if request.sha1_fingerprint
374
+ header_params["sha1_fingerprint"] = request.sha1_fingerprint
375
+ end
376
+
377
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
378
+ metadata[:"x-goog-request-params"] ||= request_params_header
379
+
380
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
381
+ metadata: metadata,
382
+ retry_policy: @config.rpcs.get.retry_policy
383
+
384
+ options.apply_defaults timeout: @config.timeout,
385
+ metadata: @config.metadata,
386
+ retry_policy: @config.retry_policy
387
+
388
+ @sql_ssl_certs_service_stub.call_rpc :get, request, options: options do |response, operation|
389
+ yield response, operation if block_given?
390
+ end
391
+ rescue ::GRPC::BadStatus => e
392
+ raise ::Google::Cloud::Error.from_error(e)
393
+ end
394
+
395
+ ##
396
+ # Creates an SSL certificate and returns it along with the private key and
397
+ # server certificate authority. The new certificate will not be usable until
398
+ # the instance is restarted.
399
+ #
400
+ # @overload insert(request, options = nil)
401
+ # Pass arguments to `insert` via a request object, either of type
402
+ # {::Google::Cloud::Sql::V1::SqlSslCertsInsertRequest} or an equivalent Hash.
403
+ #
404
+ # @param request [::Google::Cloud::Sql::V1::SqlSslCertsInsertRequest, ::Hash]
405
+ # A request object representing the call parameters. Required. To specify no
406
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
407
+ # @param options [::Gapic::CallOptions, ::Hash]
408
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
409
+ #
410
+ # @overload insert(instance: nil, project: nil, body: nil)
411
+ # Pass arguments to `insert` via keyword arguments. Note that at
412
+ # least one keyword argument is required. To specify no parameters, or to keep all
413
+ # the default parameter values, pass an empty Hash as a request object (see above).
414
+ #
415
+ # @param instance [::String]
416
+ # Cloud SQL instance ID. This does not include the project ID.
417
+ # @param project [::String]
418
+ # Project ID of the project that contains the instance.
419
+ # @param body [::Google::Cloud::Sql::V1::SslCertsInsertRequest, ::Hash]
420
+ #
421
+ # @yield [response, operation] Access the result along with the RPC operation
422
+ # @yieldparam response [::Google::Cloud::Sql::V1::SslCertsInsertResponse]
423
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
424
+ #
425
+ # @return [::Google::Cloud::Sql::V1::SslCertsInsertResponse]
426
+ #
427
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
428
+ #
429
+ # @example Basic example
430
+ # require "google/cloud/sql/v1"
431
+ #
432
+ # # Create a client object. The client can be reused for multiple calls.
433
+ # client = Google::Cloud::Sql::V1::SqlSslCertsService::Client.new
434
+ #
435
+ # # Create a request. To set request fields, pass in keyword arguments.
436
+ # request = Google::Cloud::Sql::V1::SqlSslCertsInsertRequest.new
437
+ #
438
+ # # Call the insert method.
439
+ # result = client.insert request
440
+ #
441
+ # # The returned object is of type Google::Cloud::Sql::V1::SslCertsInsertResponse.
442
+ # p result
443
+ #
444
+ def insert request, options = nil
445
+ raise ::ArgumentError, "request must be provided" if request.nil?
446
+
447
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlSslCertsInsertRequest
448
+
449
+ # Converts hash and nil to an options object
450
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
451
+
452
+ # Customize the options with defaults
453
+ metadata = @config.rpcs.insert.metadata.to_h
454
+
455
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
456
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
457
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
458
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
459
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
460
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
461
+
462
+ header_params = {}
463
+ if request.project
464
+ header_params["project"] = request.project
465
+ end
466
+ if request.instance
467
+ header_params["instance"] = request.instance
468
+ end
469
+
470
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
471
+ metadata[:"x-goog-request-params"] ||= request_params_header
472
+
473
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
474
+ metadata: metadata,
475
+ retry_policy: @config.rpcs.insert.retry_policy
476
+
477
+ options.apply_defaults timeout: @config.timeout,
478
+ metadata: @config.metadata,
479
+ retry_policy: @config.retry_policy
480
+
481
+ @sql_ssl_certs_service_stub.call_rpc :insert, request, options: options do |response, operation|
482
+ yield response, operation if block_given?
483
+ end
484
+ rescue ::GRPC::BadStatus => e
485
+ raise ::Google::Cloud::Error.from_error(e)
486
+ end
487
+
488
+ ##
489
+ # Lists all of the current SSL certificates for the instance.
490
+ #
491
+ # @overload list(request, options = nil)
492
+ # Pass arguments to `list` via a request object, either of type
493
+ # {::Google::Cloud::Sql::V1::SqlSslCertsListRequest} or an equivalent Hash.
494
+ #
495
+ # @param request [::Google::Cloud::Sql::V1::SqlSslCertsListRequest, ::Hash]
496
+ # A request object representing the call parameters. Required. To specify no
497
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
498
+ # @param options [::Gapic::CallOptions, ::Hash]
499
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
500
+ #
501
+ # @overload list(instance: nil, project: nil)
502
+ # Pass arguments to `list` via keyword arguments. Note that at
503
+ # least one keyword argument is required. To specify no parameters, or to keep all
504
+ # the default parameter values, pass an empty Hash as a request object (see above).
505
+ #
506
+ # @param instance [::String]
507
+ # Cloud SQL instance ID. This does not include the project ID.
508
+ # @param project [::String]
509
+ # Project ID of the project that contains the instance.
510
+ #
511
+ # @yield [response, operation] Access the result along with the RPC operation
512
+ # @yieldparam response [::Google::Cloud::Sql::V1::SslCertsListResponse]
513
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
514
+ #
515
+ # @return [::Google::Cloud::Sql::V1::SslCertsListResponse]
516
+ #
517
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
518
+ #
519
+ # @example Basic example
520
+ # require "google/cloud/sql/v1"
521
+ #
522
+ # # Create a client object. The client can be reused for multiple calls.
523
+ # client = Google::Cloud::Sql::V1::SqlSslCertsService::Client.new
524
+ #
525
+ # # Create a request. To set request fields, pass in keyword arguments.
526
+ # request = Google::Cloud::Sql::V1::SqlSslCertsListRequest.new
527
+ #
528
+ # # Call the list method.
529
+ # result = client.list request
530
+ #
531
+ # # The returned object is of type Google::Cloud::Sql::V1::SslCertsListResponse.
532
+ # p result
533
+ #
534
+ def list request, options = nil
535
+ raise ::ArgumentError, "request must be provided" if request.nil?
536
+
537
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlSslCertsListRequest
538
+
539
+ # Converts hash and nil to an options object
540
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
541
+
542
+ # Customize the options with defaults
543
+ metadata = @config.rpcs.list.metadata.to_h
544
+
545
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
546
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
547
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
548
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
549
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
550
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
551
+
552
+ header_params = {}
553
+ if request.project
554
+ header_params["project"] = request.project
555
+ end
556
+ if request.instance
557
+ header_params["instance"] = request.instance
558
+ end
559
+
560
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
561
+ metadata[:"x-goog-request-params"] ||= request_params_header
562
+
563
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
564
+ metadata: metadata,
565
+ retry_policy: @config.rpcs.list.retry_policy
566
+
567
+ options.apply_defaults timeout: @config.timeout,
568
+ metadata: @config.metadata,
569
+ retry_policy: @config.retry_policy
570
+
571
+ @sql_ssl_certs_service_stub.call_rpc :list, request, options: options do |response, operation|
572
+ yield response, operation if block_given?
573
+ end
574
+ rescue ::GRPC::BadStatus => e
575
+ raise ::Google::Cloud::Error.from_error(e)
576
+ end
577
+
578
+ ##
579
+ # Configuration class for the SqlSslCertsService API.
580
+ #
581
+ # This class represents the configuration for SqlSslCertsService,
582
+ # providing control over timeouts, retry behavior, logging, transport
583
+ # parameters, and other low-level controls. Certain parameters can also be
584
+ # applied individually to specific RPCs. See
585
+ # {::Google::Cloud::Sql::V1::SqlSslCertsService::Client::Configuration::Rpcs}
586
+ # for a list of RPCs that can be configured independently.
587
+ #
588
+ # Configuration can be applied globally to all clients, or to a single client
589
+ # on construction.
590
+ #
591
+ # @example
592
+ #
593
+ # # Modify the global config, setting the timeout for
594
+ # # delete to 20 seconds,
595
+ # # and all remaining timeouts to 10 seconds.
596
+ # ::Google::Cloud::Sql::V1::SqlSslCertsService::Client.configure do |config|
597
+ # config.timeout = 10.0
598
+ # config.rpcs.delete.timeout = 20.0
599
+ # end
600
+ #
601
+ # # Apply the above configuration only to a new client.
602
+ # client = ::Google::Cloud::Sql::V1::SqlSslCertsService::Client.new do |config|
603
+ # config.timeout = 10.0
604
+ # config.rpcs.delete.timeout = 20.0
605
+ # end
606
+ #
607
+ # @!attribute [rw] endpoint
608
+ # A custom service endpoint, as a hostname or hostname:port. The default is
609
+ # nil, indicating to use the default endpoint in the current universe domain.
610
+ # @return [::String,nil]
611
+ # @!attribute [rw] credentials
612
+ # Credentials to send with calls. You may provide any of the following types:
613
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
614
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
615
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
616
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
617
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
618
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
619
+ # * (`nil`) indicating no credentials
620
+ #
621
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
622
+ # is deprecated. Providing an unvalidated credential configuration to
623
+ # Google APIs can compromise the security of your systems and data.
624
+ #
625
+ # @example
626
+ #
627
+ # # The recommended way to provide credentials is to use the `make_creds` method
628
+ # # on the appropriate credentials class for your environment.
629
+ #
630
+ # require "googleauth"
631
+ #
632
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
633
+ # json_key_io: ::File.open("/path/to/keyfile.json")
634
+ # )
635
+ #
636
+ # client = ::Google::Cloud::Sql::V1::SqlSslCertsService::Client.new do |config|
637
+ # config.credentials = credentials
638
+ # end
639
+ #
640
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
641
+ # external source for authentication to Google Cloud, you must validate it before
642
+ # providing it to a Google API client library. Providing an unvalidated credential
643
+ # configuration to Google APIs can compromise the security of your systems and data.
644
+ # For more information, refer to [Validate credential configurations from external
645
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
646
+ # @return [::Object]
647
+ # @!attribute [rw] scope
648
+ # The OAuth scopes
649
+ # @return [::Array<::String>]
650
+ # @!attribute [rw] lib_name
651
+ # The library name as recorded in instrumentation and logging
652
+ # @return [::String]
653
+ # @!attribute [rw] lib_version
654
+ # The library version as recorded in instrumentation and logging
655
+ # @return [::String]
656
+ # @!attribute [rw] channel_args
657
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
658
+ # `GRPC::Core::Channel` object is provided as the credential.
659
+ # @return [::Hash]
660
+ # @!attribute [rw] interceptors
661
+ # An array of interceptors that are run before calls are executed.
662
+ # @return [::Array<::GRPC::ClientInterceptor>]
663
+ # @!attribute [rw] timeout
664
+ # The call timeout in seconds.
665
+ # @return [::Numeric]
666
+ # @!attribute [rw] metadata
667
+ # Additional gRPC headers to be sent with the call.
668
+ # @return [::Hash{::Symbol=>::String}]
669
+ # @!attribute [rw] retry_policy
670
+ # The retry policy. The value is a hash with the following keys:
671
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
672
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
673
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
674
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
675
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
676
+ # trigger a retry.
677
+ # @return [::Hash]
678
+ # @!attribute [rw] quota_project
679
+ # A separate project against which to charge quota.
680
+ # @return [::String]
681
+ # @!attribute [rw] universe_domain
682
+ # The universe domain within which to make requests. This determines the
683
+ # default endpoint URL. The default value of nil uses the environment
684
+ # universe (usually the default "googleapis.com" universe).
685
+ # @return [::String,nil]
686
+ # @!attribute [rw] logger
687
+ # A custom logger to use for request/response debug logging, or the value
688
+ # `:default` (the default) to construct a default logger, or `nil` to
689
+ # explicitly disable logging.
690
+ # @return [::Logger,:default,nil]
691
+ #
692
+ class Configuration
693
+ extend ::Gapic::Config
694
+
695
+ # @private
696
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
697
+ DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
698
+
699
+ config_attr :endpoint, nil, ::String, nil
700
+ config_attr :credentials, nil do |value|
701
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
702
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
703
+ allowed.any? { |klass| klass === value }
704
+ end
705
+ config_attr :scope, nil, ::String, ::Array, nil
706
+ config_attr :lib_name, nil, ::String, nil
707
+ config_attr :lib_version, nil, ::String, nil
708
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
709
+ config_attr :interceptors, nil, ::Array, nil
710
+ config_attr :timeout, nil, ::Numeric, nil
711
+ config_attr :metadata, nil, ::Hash, nil
712
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
713
+ config_attr :quota_project, nil, ::String, nil
714
+ config_attr :universe_domain, nil, ::String, nil
715
+ config_attr :logger, :default, ::Logger, nil, :default
716
+
717
+ # @private
718
+ def initialize parent_config = nil
719
+ @parent_config = parent_config unless parent_config.nil?
720
+
721
+ yield self if block_given?
722
+ end
723
+
724
+ ##
725
+ # Configurations for individual RPCs
726
+ # @return [Rpcs]
727
+ #
728
+ def rpcs
729
+ @rpcs ||= begin
730
+ parent_rpcs = nil
731
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
732
+ Rpcs.new parent_rpcs
733
+ end
734
+ end
735
+
736
+ ##
737
+ # Configuration for the channel pool
738
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
739
+ #
740
+ def channel_pool
741
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
742
+ end
743
+
744
+ ##
745
+ # Configuration RPC class for the SqlSslCertsService API.
746
+ #
747
+ # Includes fields providing the configuration for each RPC in this service.
748
+ # Each configuration object is of type `Gapic::Config::Method` and includes
749
+ # the following configuration fields:
750
+ #
751
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
752
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
753
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
754
+ # include the following keys:
755
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
756
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
757
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
758
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
759
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
760
+ # trigger a retry.
761
+ #
762
+ class Rpcs
763
+ ##
764
+ # RPC-specific configuration for `delete`
765
+ # @return [::Gapic::Config::Method]
766
+ #
767
+ attr_reader :delete
768
+ ##
769
+ # RPC-specific configuration for `get`
770
+ # @return [::Gapic::Config::Method]
771
+ #
772
+ attr_reader :get
773
+ ##
774
+ # RPC-specific configuration for `insert`
775
+ # @return [::Gapic::Config::Method]
776
+ #
777
+ attr_reader :insert
778
+ ##
779
+ # RPC-specific configuration for `list`
780
+ # @return [::Gapic::Config::Method]
781
+ #
782
+ attr_reader :list
783
+
784
+ # @private
785
+ def initialize parent_rpcs = nil
786
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
787
+ @delete = ::Gapic::Config::Method.new delete_config
788
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
789
+ @get = ::Gapic::Config::Method.new get_config
790
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
791
+ @insert = ::Gapic::Config::Method.new insert_config
792
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
793
+ @list = ::Gapic::Config::Method.new list_config
794
+
795
+ yield self if block_given?
796
+ end
797
+ end
798
+ end
799
+ end
800
+ end
801
+ end
802
+ end
803
+ end
804
+ end