Debian Codegraph @

oracledatabase/apiv1/oracle_database_client.go

raw
1 // Copyright 2025 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go_gapic. DO NOT EDIT.
16
17 package oracledatabase
18
19 import (
20 "bytes"
21 "context"
22 "fmt"
23 "log/slog"
24 "math"
25 "net/http"
26 "net/url"
27 "time"
28
29 "cloud.google.com/go/longrunning"
30 lroauto "cloud.google.com/go/longrunning/autogen"
31 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
32 oracledatabasepb "cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb"
33 gax "github.com/googleapis/gax-go/v2"
34 "google.golang.org/api/iterator"
35 "google.golang.org/api/option"
36 "google.golang.org/api/option/internaloption"
37 gtransport "google.golang.org/api/transport/grpc"
38 httptransport "google.golang.org/api/transport/http"
39 locationpb "google.golang.org/genproto/googleapis/cloud/location"
40 "google.golang.org/grpc"
41 "google.golang.org/grpc/codes"
42 "google.golang.org/protobuf/encoding/protojson"
43 "google.golang.org/protobuf/proto"
44 )
45
46 var newClientHook clientHook
47
48 // CallOptions contains the retry settings for each method of Client.
49 type CallOptions struct {
50 ListCloudExadataInfrastructures []gax.CallOption
51 GetCloudExadataInfrastructure []gax.CallOption
52 CreateCloudExadataInfrastructure []gax.CallOption
53 DeleteCloudExadataInfrastructure []gax.CallOption
54 ListCloudVmClusters []gax.CallOption
55 GetCloudVmCluster []gax.CallOption
56 CreateCloudVmCluster []gax.CallOption
57 DeleteCloudVmCluster []gax.CallOption
58 ListEntitlements []gax.CallOption
59 ListDbServers []gax.CallOption
60 ListDbNodes []gax.CallOption
61 ListGiVersions []gax.CallOption
62 ListDbSystemShapes []gax.CallOption
63 ListAutonomousDatabases []gax.CallOption
64 GetAutonomousDatabase []gax.CallOption
65 CreateAutonomousDatabase []gax.CallOption
66 DeleteAutonomousDatabase []gax.CallOption
67 RestoreAutonomousDatabase []gax.CallOption
68 GenerateAutonomousDatabaseWallet []gax.CallOption
69 ListAutonomousDbVersions []gax.CallOption
70 ListAutonomousDatabaseCharacterSets []gax.CallOption
71 ListAutonomousDatabaseBackups []gax.CallOption
72 StopAutonomousDatabase []gax.CallOption
73 StartAutonomousDatabase []gax.CallOption
74 RestartAutonomousDatabase []gax.CallOption
75 GetLocation []gax.CallOption
76 ListLocations []gax.CallOption
77 CancelOperation []gax.CallOption
78 DeleteOperation []gax.CallOption
79 GetOperation []gax.CallOption
80 ListOperations []gax.CallOption
81 }
82
83 func defaultGRPCClientOptions() []option.ClientOption {
84 return []option.ClientOption{
85 internaloption.WithDefaultEndpoint("oracledatabase.googleapis.com:443"),
86 internaloption.WithDefaultEndpointTemplate("oracledatabase.UNIVERSE_DOMAIN:443"),
87 internaloption.WithDefaultMTLSEndpoint("oracledatabase.mtls.googleapis.com:443"),
88 internaloption.WithDefaultUniverseDomain("googleapis.com"),
89 internaloption.WithDefaultAudience("https://oracledatabase.googleapis.com/"),
90 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
91 internaloption.EnableJwtWithScope(),
92 internaloption.EnableNewAuthLibrary(),
93 option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
94 grpc.MaxCallRecvMsgSize(math.MaxInt32))),
95 }
96 }
97
98 func defaultCallOptions() *CallOptions {
99 return &CallOptions{
100 ListCloudExadataInfrastructures: []gax.CallOption{
101 gax.WithTimeout(60000 * time.Millisecond),
102 gax.WithRetry(func() gax.Retryer {
103 return gax.OnCodes([]codes.Code{
104 codes.ResourceExhausted,
105 codes.Unavailable,
106 codes.Internal,
107 codes.DeadlineExceeded,
108 }, gax.Backoff{
109 Initial: 1000 * time.Millisecond,
110 Max: 10000 * time.Millisecond,
111 Multiplier: 1.30,
112 })
113 }),
114 },
115 GetCloudExadataInfrastructure: []gax.CallOption{
116 gax.WithTimeout(60000 * time.Millisecond),
117 gax.WithRetry(func() gax.Retryer {
118 return gax.OnCodes([]codes.Code{
119 codes.ResourceExhausted,
120 codes.Unavailable,
121 codes.Internal,
122 codes.DeadlineExceeded,
123 }, gax.Backoff{
124 Initial: 1000 * time.Millisecond,
125 Max: 10000 * time.Millisecond,
126 Multiplier: 1.30,
127 })
128 }),
129 },
130 CreateCloudExadataInfrastructure: []gax.CallOption{
131 gax.WithTimeout(60000 * time.Millisecond),
132 },
133 DeleteCloudExadataInfrastructure: []gax.CallOption{
134 gax.WithTimeout(60000 * time.Millisecond),
135 },
136 ListCloudVmClusters: []gax.CallOption{
137 gax.WithTimeout(60000 * time.Millisecond),
138 gax.WithRetry(func() gax.Retryer {
139 return gax.OnCodes([]codes.Code{
140 codes.ResourceExhausted,
141 codes.Unavailable,
142 codes.Internal,
143 codes.DeadlineExceeded,
144 }, gax.Backoff{
145 Initial: 1000 * time.Millisecond,
146 Max: 10000 * time.Millisecond,
147 Multiplier: 1.30,
148 })
149 }),
150 },
151 GetCloudVmCluster: []gax.CallOption{
152 gax.WithTimeout(60000 * time.Millisecond),
153 gax.WithRetry(func() gax.Retryer {
154 return gax.OnCodes([]codes.Code{
155 codes.ResourceExhausted,
156 codes.Unavailable,
157 codes.Internal,
158 codes.DeadlineExceeded,
159 }, gax.Backoff{
160 Initial: 1000 * time.Millisecond,
161 Max: 10000 * time.Millisecond,
162 Multiplier: 1.30,
163 })
164 }),
165 },
166 CreateCloudVmCluster: []gax.CallOption{
167 gax.WithTimeout(60000 * time.Millisecond),
168 },
169 DeleteCloudVmCluster: []gax.CallOption{
170 gax.WithTimeout(60000 * time.Millisecond),
171 },
172 ListEntitlements: []gax.CallOption{
173 gax.WithTimeout(60000 * time.Millisecond),
174 gax.WithRetry(func() gax.Retryer {
175 return gax.OnCodes([]codes.Code{
176 codes.ResourceExhausted,
177 codes.Unavailable,
178 codes.Internal,
179 codes.DeadlineExceeded,
180 }, gax.Backoff{
181 Initial: 1000 * time.Millisecond,
182 Max: 10000 * time.Millisecond,
183 Multiplier: 1.30,
184 })
185 }),
186 },
187 ListDbServers: []gax.CallOption{
188 gax.WithTimeout(60000 * time.Millisecond),
189 gax.WithRetry(func() gax.Retryer {
190 return gax.OnCodes([]codes.Code{
191 codes.ResourceExhausted,
192 codes.Unavailable,
193 codes.Internal,
194 codes.DeadlineExceeded,
195 }, gax.Backoff{
196 Initial: 1000 * time.Millisecond,
197 Max: 10000 * time.Millisecond,
198 Multiplier: 1.30,
199 })
200 }),
201 },
202 ListDbNodes: []gax.CallOption{
203 gax.WithTimeout(60000 * time.Millisecond),
204 gax.WithRetry(func() gax.Retryer {
205 return gax.OnCodes([]codes.Code{
206 codes.ResourceExhausted,
207 codes.Unavailable,
208 codes.Internal,
209 codes.DeadlineExceeded,
210 }, gax.Backoff{
211 Initial: 1000 * time.Millisecond,
212 Max: 10000 * time.Millisecond,
213 Multiplier: 1.30,
214 })
215 }),
216 },
217 ListGiVersions: []gax.CallOption{
218 gax.WithTimeout(60000 * time.Millisecond),
219 gax.WithRetry(func() gax.Retryer {
220 return gax.OnCodes([]codes.Code{
221 codes.ResourceExhausted,
222 codes.Unavailable,
223 codes.Internal,
224 codes.DeadlineExceeded,
225 }, gax.Backoff{
226 Initial: 1000 * time.Millisecond,
227 Max: 10000 * time.Millisecond,
228 Multiplier: 1.30,
229 })
230 }),
231 },
232 ListDbSystemShapes: []gax.CallOption{
233 gax.WithTimeout(60000 * time.Millisecond),
234 gax.WithRetry(func() gax.Retryer {
235 return gax.OnCodes([]codes.Code{
236 codes.ResourceExhausted,
237 codes.Unavailable,
238 codes.Internal,
239 codes.DeadlineExceeded,
240 }, gax.Backoff{
241 Initial: 1000 * time.Millisecond,
242 Max: 10000 * time.Millisecond,
243 Multiplier: 1.30,
244 })
245 }),
246 },
247 ListAutonomousDatabases: []gax.CallOption{
248 gax.WithTimeout(60000 * time.Millisecond),
249 gax.WithRetry(func() gax.Retryer {
250 return gax.OnCodes([]codes.Code{
251 codes.ResourceExhausted,
252 codes.Unavailable,
253 codes.Internal,
254 codes.DeadlineExceeded,
255 }, gax.Backoff{
256 Initial: 1000 * time.Millisecond,
257 Max: 10000 * time.Millisecond,
258 Multiplier: 1.30,
259 })
260 }),
261 },
262 GetAutonomousDatabase: []gax.CallOption{
263 gax.WithTimeout(60000 * time.Millisecond),
264 gax.WithRetry(func() gax.Retryer {
265 return gax.OnCodes([]codes.Code{
266 codes.ResourceExhausted,
267 codes.Unavailable,
268 codes.Internal,
269 codes.DeadlineExceeded,
270 }, gax.Backoff{
271 Initial: 1000 * time.Millisecond,
272 Max: 10000 * time.Millisecond,
273 Multiplier: 1.30,
274 })
275 }),
276 },
277 CreateAutonomousDatabase: []gax.CallOption{
278 gax.WithTimeout(60000 * time.Millisecond),
279 },
280 DeleteAutonomousDatabase: []gax.CallOption{
281 gax.WithTimeout(60000 * time.Millisecond),
282 },
283 RestoreAutonomousDatabase: []gax.CallOption{
284 gax.WithTimeout(60000 * time.Millisecond),
285 },
286 GenerateAutonomousDatabaseWallet: []gax.CallOption{
287 gax.WithTimeout(60000 * time.Millisecond),
288 },
289 ListAutonomousDbVersions: []gax.CallOption{
290 gax.WithTimeout(60000 * time.Millisecond),
291 gax.WithRetry(func() gax.Retryer {
292 return gax.OnCodes([]codes.Code{
293 codes.ResourceExhausted,
294 codes.Unavailable,
295 codes.Internal,
296 codes.DeadlineExceeded,
297 }, gax.Backoff{
298 Initial: 1000 * time.Millisecond,
299 Max: 10000 * time.Millisecond,
300 Multiplier: 1.30,
301 })
302 }),
303 },
304 ListAutonomousDatabaseCharacterSets: []gax.CallOption{
305 gax.WithTimeout(60000 * time.Millisecond),
306 gax.WithRetry(func() gax.Retryer {
307 return gax.OnCodes([]codes.Code{
308 codes.ResourceExhausted,
309 codes.Unavailable,
310 codes.Internal,
311 codes.DeadlineExceeded,
312 }, gax.Backoff{
313 Initial: 1000 * time.Millisecond,
314 Max: 10000 * time.Millisecond,
315 Multiplier: 1.30,
316 })
317 }),
318 },
319 ListAutonomousDatabaseBackups: []gax.CallOption{
320 gax.WithTimeout(60000 * time.Millisecond),
321 gax.WithRetry(func() gax.Retryer {
322 return gax.OnCodes([]codes.Code{
323 codes.ResourceExhausted,
324 codes.Unavailable,
325 codes.Internal,
326 codes.DeadlineExceeded,
327 }, gax.Backoff{
328 Initial: 1000 * time.Millisecond,
329 Max: 10000 * time.Millisecond,
330 Multiplier: 1.30,
331 })
332 }),
333 },
334 StopAutonomousDatabase: []gax.CallOption{
335 gax.WithTimeout(60000 * time.Millisecond),
336 },
337 StartAutonomousDatabase: []gax.CallOption{
338 gax.WithTimeout(60000 * time.Millisecond),
339 },
340 RestartAutonomousDatabase: []gax.CallOption{
341 gax.WithTimeout(60000 * time.Millisecond),
342 },
343 GetLocation: []gax.CallOption{},
344 ListLocations: []gax.CallOption{},
345 CancelOperation: []gax.CallOption{},
346 DeleteOperation: []gax.CallOption{},
347 GetOperation: []gax.CallOption{},
348 ListOperations: []gax.CallOption{},
349 }
350 }
351
352 func defaultRESTCallOptions() *CallOptions {
353 return &CallOptions{
354 ListCloudExadataInfrastructures: []gax.CallOption{
355 gax.WithTimeout(60000 * time.Millisecond),
356 gax.WithRetry(func() gax.Retryer {
357 return gax.OnHTTPCodes(gax.Backoff{
358 Initial: 1000 * time.Millisecond,
359 Max: 10000 * time.Millisecond,
360 Multiplier: 1.30,
361 },
362 http.StatusTooManyRequests,
363 http.StatusServiceUnavailable,
364 http.StatusInternalServerError,
365 http.StatusGatewayTimeout)
366 }),
367 },
368 GetCloudExadataInfrastructure: []gax.CallOption{
369 gax.WithTimeout(60000 * time.Millisecond),
370 gax.WithRetry(func() gax.Retryer {
371 return gax.OnHTTPCodes(gax.Backoff{
372 Initial: 1000 * time.Millisecond,
373 Max: 10000 * time.Millisecond,
374 Multiplier: 1.30,
375 },
376 http.StatusTooManyRequests,
377 http.StatusServiceUnavailable,
378 http.StatusInternalServerError,
379 http.StatusGatewayTimeout)
380 }),
381 },
382 CreateCloudExadataInfrastructure: []gax.CallOption{
383 gax.WithTimeout(60000 * time.Millisecond),
384 },
385 DeleteCloudExadataInfrastructure: []gax.CallOption{
386 gax.WithTimeout(60000 * time.Millisecond),
387 },
388 ListCloudVmClusters: []gax.CallOption{
389 gax.WithTimeout(60000 * time.Millisecond),
390 gax.WithRetry(func() gax.Retryer {
391 return gax.OnHTTPCodes(gax.Backoff{
392 Initial: 1000 * time.Millisecond,
393 Max: 10000 * time.Millisecond,
394 Multiplier: 1.30,
395 },
396 http.StatusTooManyRequests,
397 http.StatusServiceUnavailable,
398 http.StatusInternalServerError,
399 http.StatusGatewayTimeout)
400 }),
401 },
402 GetCloudVmCluster: []gax.CallOption{
403 gax.WithTimeout(60000 * time.Millisecond),
404 gax.WithRetry(func() gax.Retryer {
405 return gax.OnHTTPCodes(gax.Backoff{
406 Initial: 1000 * time.Millisecond,
407 Max: 10000 * time.Millisecond,
408 Multiplier: 1.30,
409 },
410 http.StatusTooManyRequests,
411 http.StatusServiceUnavailable,
412 http.StatusInternalServerError,
413 http.StatusGatewayTimeout)
414 }),
415 },
416 CreateCloudVmCluster: []gax.CallOption{
417 gax.WithTimeout(60000 * time.Millisecond),
418 },
419 DeleteCloudVmCluster: []gax.CallOption{
420 gax.WithTimeout(60000 * time.Millisecond),
421 },
422 ListEntitlements: []gax.CallOption{
423 gax.WithTimeout(60000 * time.Millisecond),
424 gax.WithRetry(func() gax.Retryer {
425 return gax.OnHTTPCodes(gax.Backoff{
426 Initial: 1000 * time.Millisecond,
427 Max: 10000 * time.Millisecond,
428 Multiplier: 1.30,
429 },
430 http.StatusTooManyRequests,
431 http.StatusServiceUnavailable,
432 http.StatusInternalServerError,
433 http.StatusGatewayTimeout)
434 }),
435 },
436 ListDbServers: []gax.CallOption{
437 gax.WithTimeout(60000 * time.Millisecond),
438 gax.WithRetry(func() gax.Retryer {
439 return gax.OnHTTPCodes(gax.Backoff{
440 Initial: 1000 * time.Millisecond,
441 Max: 10000 * time.Millisecond,
442 Multiplier: 1.30,
443 },
444 http.StatusTooManyRequests,
445 http.StatusServiceUnavailable,
446 http.StatusInternalServerError,
447 http.StatusGatewayTimeout)
448 }),
449 },
450 ListDbNodes: []gax.CallOption{
451 gax.WithTimeout(60000 * time.Millisecond),
452 gax.WithRetry(func() gax.Retryer {
453 return gax.OnHTTPCodes(gax.Backoff{
454 Initial: 1000 * time.Millisecond,
455 Max: 10000 * time.Millisecond,
456 Multiplier: 1.30,
457 },
458 http.StatusTooManyRequests,
459 http.StatusServiceUnavailable,
460 http.StatusInternalServerError,
461 http.StatusGatewayTimeout)
462 }),
463 },
464 ListGiVersions: []gax.CallOption{
465 gax.WithTimeout(60000 * time.Millisecond),
466 gax.WithRetry(func() gax.Retryer {
467 return gax.OnHTTPCodes(gax.Backoff{
468 Initial: 1000 * time.Millisecond,
469 Max: 10000 * time.Millisecond,
470 Multiplier: 1.30,
471 },
472 http.StatusTooManyRequests,
473 http.StatusServiceUnavailable,
474 http.StatusInternalServerError,
475 http.StatusGatewayTimeout)
476 }),
477 },
478 ListDbSystemShapes: []gax.CallOption{
479 gax.WithTimeout(60000 * time.Millisecond),
480 gax.WithRetry(func() gax.Retryer {
481 return gax.OnHTTPCodes(gax.Backoff{
482 Initial: 1000 * time.Millisecond,
483 Max: 10000 * time.Millisecond,
484 Multiplier: 1.30,
485 },
486 http.StatusTooManyRequests,
487 http.StatusServiceUnavailable,
488 http.StatusInternalServerError,
489 http.StatusGatewayTimeout)
490 }),
491 },
492 ListAutonomousDatabases: []gax.CallOption{
493 gax.WithTimeout(60000 * time.Millisecond),
494 gax.WithRetry(func() gax.Retryer {
495 return gax.OnHTTPCodes(gax.Backoff{
496 Initial: 1000 * time.Millisecond,
497 Max: 10000 * time.Millisecond,
498 Multiplier: 1.30,
499 },
500 http.StatusTooManyRequests,
501 http.StatusServiceUnavailable,
502 http.StatusInternalServerError,
503 http.StatusGatewayTimeout)
504 }),
505 },
506 GetAutonomousDatabase: []gax.CallOption{
507 gax.WithTimeout(60000 * time.Millisecond),
508 gax.WithRetry(func() gax.Retryer {
509 return gax.OnHTTPCodes(gax.Backoff{
510 Initial: 1000 * time.Millisecond,
511 Max: 10000 * time.Millisecond,
512 Multiplier: 1.30,
513 },
514 http.StatusTooManyRequests,
515 http.StatusServiceUnavailable,
516 http.StatusInternalServerError,
517 http.StatusGatewayTimeout)
518 }),
519 },
520 CreateAutonomousDatabase: []gax.CallOption{
521 gax.WithTimeout(60000 * time.Millisecond),
522 },
523 DeleteAutonomousDatabase: []gax.CallOption{
524 gax.WithTimeout(60000 * time.Millisecond),
525 },
526 RestoreAutonomousDatabase: []gax.CallOption{
527 gax.WithTimeout(60000 * time.Millisecond),
528 },
529 GenerateAutonomousDatabaseWallet: []gax.CallOption{
530 gax.WithTimeout(60000 * time.Millisecond),
531 },
532 ListAutonomousDbVersions: []gax.CallOption{
533 gax.WithTimeout(60000 * time.Millisecond),
534 gax.WithRetry(func() gax.Retryer {
535 return gax.OnHTTPCodes(gax.Backoff{
536 Initial: 1000 * time.Millisecond,
537 Max: 10000 * time.Millisecond,
538 Multiplier: 1.30,
539 },
540 http.StatusTooManyRequests,
541 http.StatusServiceUnavailable,
542 http.StatusInternalServerError,
543 http.StatusGatewayTimeout)
544 }),
545 },
546 ListAutonomousDatabaseCharacterSets: []gax.CallOption{
547 gax.WithTimeout(60000 * time.Millisecond),
548 gax.WithRetry(func() gax.Retryer {
549 return gax.OnHTTPCodes(gax.Backoff{
550 Initial: 1000 * time.Millisecond,
551 Max: 10000 * time.Millisecond,
552 Multiplier: 1.30,
553 },
554 http.StatusTooManyRequests,
555 http.StatusServiceUnavailable,
556 http.StatusInternalServerError,
557 http.StatusGatewayTimeout)
558 }),
559 },
560 ListAutonomousDatabaseBackups: []gax.CallOption{
561 gax.WithTimeout(60000 * time.Millisecond),
562 gax.WithRetry(func() gax.Retryer {
563 return gax.OnHTTPCodes(gax.Backoff{
564 Initial: 1000 * time.Millisecond,
565 Max: 10000 * time.Millisecond,
566 Multiplier: 1.30,
567 },
568 http.StatusTooManyRequests,
569 http.StatusServiceUnavailable,
570 http.StatusInternalServerError,
571 http.StatusGatewayTimeout)
572 }),
573 },
574 StopAutonomousDatabase: []gax.CallOption{
575 gax.WithTimeout(60000 * time.Millisecond),
576 },
577 StartAutonomousDatabase: []gax.CallOption{
578 gax.WithTimeout(60000 * time.Millisecond),
579 },
580 RestartAutonomousDatabase: []gax.CallOption{
581 gax.WithTimeout(60000 * time.Millisecond),
582 },
583 GetLocation: []gax.CallOption{},
584 ListLocations: []gax.CallOption{},
585 CancelOperation: []gax.CallOption{},
586 DeleteOperation: []gax.CallOption{},
587 GetOperation: []gax.CallOption{},
588 ListOperations: []gax.CallOption{},
589 }
590 }
591
592 // internalClient is an interface that defines the methods available from Oracle Database@Google Cloud API.
593 type internalClient interface {
594 Close() error
595 setGoogleClientInfo(...string)
596 Connection() *grpc.ClientConn
597 ListCloudExadataInfrastructures(context.Context, *oracledatabasepb.ListCloudExadataInfrastructuresRequest, ...gax.CallOption) *CloudExadataInfrastructureIterator
598 GetCloudExadataInfrastructure(context.Context, *oracledatabasepb.GetCloudExadataInfrastructureRequest, ...gax.CallOption) (*oracledatabasepb.CloudExadataInfrastructure, error)
599 CreateCloudExadataInfrastructure(context.Context, *oracledatabasepb.CreateCloudExadataInfrastructureRequest, ...gax.CallOption) (*CreateCloudExadataInfrastructureOperation, error)
600 CreateCloudExadataInfrastructureOperation(name string) *CreateCloudExadataInfrastructureOperation
601 DeleteCloudExadataInfrastructure(context.Context, *oracledatabasepb.DeleteCloudExadataInfrastructureRequest, ...gax.CallOption) (*DeleteCloudExadataInfrastructureOperation, error)
602 DeleteCloudExadataInfrastructureOperation(name string) *DeleteCloudExadataInfrastructureOperation
603 ListCloudVmClusters(context.Context, *oracledatabasepb.ListCloudVmClustersRequest, ...gax.CallOption) *CloudVmClusterIterator
604 GetCloudVmCluster(context.Context, *oracledatabasepb.GetCloudVmClusterRequest, ...gax.CallOption) (*oracledatabasepb.CloudVmCluster, error)
605 CreateCloudVmCluster(context.Context, *oracledatabasepb.CreateCloudVmClusterRequest, ...gax.CallOption) (*CreateCloudVmClusterOperation, error)
606 CreateCloudVmClusterOperation(name string) *CreateCloudVmClusterOperation
607 DeleteCloudVmCluster(context.Context, *oracledatabasepb.DeleteCloudVmClusterRequest, ...gax.CallOption) (*DeleteCloudVmClusterOperation, error)
608 DeleteCloudVmClusterOperation(name string) *DeleteCloudVmClusterOperation
609 ListEntitlements(context.Context, *oracledatabasepb.ListEntitlementsRequest, ...gax.CallOption) *EntitlementIterator
610 ListDbServers(context.Context, *oracledatabasepb.ListDbServersRequest, ...gax.CallOption) *DbServerIterator
611 ListDbNodes(context.Context, *oracledatabasepb.ListDbNodesRequest, ...gax.CallOption) *DbNodeIterator
612 ListGiVersions(context.Context, *oracledatabasepb.ListGiVersionsRequest, ...gax.CallOption) *GiVersionIterator
613 ListDbSystemShapes(context.Context, *oracledatabasepb.ListDbSystemShapesRequest, ...gax.CallOption) *DbSystemShapeIterator
614 ListAutonomousDatabases(context.Context, *oracledatabasepb.ListAutonomousDatabasesRequest, ...gax.CallOption) *AutonomousDatabaseIterator
615 GetAutonomousDatabase(context.Context, *oracledatabasepb.GetAutonomousDatabaseRequest, ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error)
616 CreateAutonomousDatabase(context.Context, *oracledatabasepb.CreateAutonomousDatabaseRequest, ...gax.CallOption) (*CreateAutonomousDatabaseOperation, error)
617 CreateAutonomousDatabaseOperation(name string) *CreateAutonomousDatabaseOperation
618 DeleteAutonomousDatabase(context.Context, *oracledatabasepb.DeleteAutonomousDatabaseRequest, ...gax.CallOption) (*DeleteAutonomousDatabaseOperation, error)
619 DeleteAutonomousDatabaseOperation(name string) *DeleteAutonomousDatabaseOperation
620 RestoreAutonomousDatabase(context.Context, *oracledatabasepb.RestoreAutonomousDatabaseRequest, ...gax.CallOption) (*RestoreAutonomousDatabaseOperation, error)
621 RestoreAutonomousDatabaseOperation(name string) *RestoreAutonomousDatabaseOperation
622 GenerateAutonomousDatabaseWallet(context.Context, *oracledatabasepb.GenerateAutonomousDatabaseWalletRequest, ...gax.CallOption) (*oracledatabasepb.GenerateAutonomousDatabaseWalletResponse, error)
623 ListAutonomousDbVersions(context.Context, *oracledatabasepb.ListAutonomousDbVersionsRequest, ...gax.CallOption) *AutonomousDbVersionIterator
624 ListAutonomousDatabaseCharacterSets(context.Context, *oracledatabasepb.ListAutonomousDatabaseCharacterSetsRequest, ...gax.CallOption) *AutonomousDatabaseCharacterSetIterator
625 ListAutonomousDatabaseBackups(context.Context, *oracledatabasepb.ListAutonomousDatabaseBackupsRequest, ...gax.CallOption) *AutonomousDatabaseBackupIterator
626 StopAutonomousDatabase(context.Context, *oracledatabasepb.StopAutonomousDatabaseRequest, ...gax.CallOption) (*StopAutonomousDatabaseOperation, error)
627 StopAutonomousDatabaseOperation(name string) *StopAutonomousDatabaseOperation
628 StartAutonomousDatabase(context.Context, *oracledatabasepb.StartAutonomousDatabaseRequest, ...gax.CallOption) (*StartAutonomousDatabaseOperation, error)
629 StartAutonomousDatabaseOperation(name string) *StartAutonomousDatabaseOperation
630 RestartAutonomousDatabase(context.Context, *oracledatabasepb.RestartAutonomousDatabaseRequest, ...gax.CallOption) (*RestartAutonomousDatabaseOperation, error)
631 RestartAutonomousDatabaseOperation(name string) *RestartAutonomousDatabaseOperation
632 GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error)
633 ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator
634 CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error
635 DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error
636 GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error)
637 ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator
638 }
639
640 // Client is a client for interacting with Oracle Database@Google Cloud API.
641 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
642 //
643 // Service describing handlers for resources
644 type Client struct {
645 // The internal transport-dependent client.
646 internalClient internalClient
647
648 // The call options for this service.
649 CallOptions *CallOptions
650
651 // LROClient is used internally to handle long-running operations.
652 // It is exposed so that its CallOptions can be modified if required.
653 // Users should not Close this client.
654 LROClient *lroauto.OperationsClient
655 }
656
657 // Wrapper methods routed to the internal client.
658
659 // Close closes the connection to the API service. The user should invoke this when
660 // the client is no longer required.
661 func (c *Client) Close() error {
662 return c.internalClient.Close()
663 }
664
665 // setGoogleClientInfo sets the name and version of the application in
666 // the `x-goog-api-client` header passed on each request. Intended for
667 // use by Google-written clients.
668 func (c *Client) setGoogleClientInfo(keyval ...string) {
669 c.internalClient.setGoogleClientInfo(keyval...)
670 }
671
672 // Connection returns a connection to the API service.
673 //
674 // Deprecated: Connections are now pooled so this method does not always
675 // return the same resource.
676 func (c *Client) Connection() *grpc.ClientConn {
677 return c.internalClient.Connection()
678 }
679
680 // ListCloudExadataInfrastructures lists Exadata Infrastructures in a given project and location.
681 func (c *Client) ListCloudExadataInfrastructures(ctx context.Context, req *oracledatabasepb.ListCloudExadataInfrastructuresRequest, opts ...gax.CallOption) *CloudExadataInfrastructureIterator {
682 return c.internalClient.ListCloudExadataInfrastructures(ctx, req, opts...)
683 }
684
685 // GetCloudExadataInfrastructure gets details of a single Exadata Infrastructure.
686 func (c *Client) GetCloudExadataInfrastructure(ctx context.Context, req *oracledatabasepb.GetCloudExadataInfrastructureRequest, opts ...gax.CallOption) (*oracledatabasepb.CloudExadataInfrastructure, error) {
687 return c.internalClient.GetCloudExadataInfrastructure(ctx, req, opts...)
688 }
689
690 // CreateCloudExadataInfrastructure creates a new Exadata Infrastructure in a given project and location.
691 func (c *Client) CreateCloudExadataInfrastructure(ctx context.Context, req *oracledatabasepb.CreateCloudExadataInfrastructureRequest, opts ...gax.CallOption) (*CreateCloudExadataInfrastructureOperation, error) {
692 return c.internalClient.CreateCloudExadataInfrastructure(ctx, req, opts...)
693 }
694
695 // CreateCloudExadataInfrastructureOperation returns a new CreateCloudExadataInfrastructureOperation from a given name.
696 // The name must be that of a previously created CreateCloudExadataInfrastructureOperation, possibly from a different process.
697 func (c *Client) CreateCloudExadataInfrastructureOperation(name string) *CreateCloudExadataInfrastructureOperation {
698 return c.internalClient.CreateCloudExadataInfrastructureOperation(name)
699 }
700
701 // DeleteCloudExadataInfrastructure deletes a single Exadata Infrastructure.
702 func (c *Client) DeleteCloudExadataInfrastructure(ctx context.Context, req *oracledatabasepb.DeleteCloudExadataInfrastructureRequest, opts ...gax.CallOption) (*DeleteCloudExadataInfrastructureOperation, error) {
703 return c.internalClient.DeleteCloudExadataInfrastructure(ctx, req, opts...)
704 }
705
706 // DeleteCloudExadataInfrastructureOperation returns a new DeleteCloudExadataInfrastructureOperation from a given name.
707 // The name must be that of a previously created DeleteCloudExadataInfrastructureOperation, possibly from a different process.
708 func (c *Client) DeleteCloudExadataInfrastructureOperation(name string) *DeleteCloudExadataInfrastructureOperation {
709 return c.internalClient.DeleteCloudExadataInfrastructureOperation(name)
710 }
711
712 // ListCloudVmClusters lists the VM Clusters in a given project and location.
713 func (c *Client) ListCloudVmClusters(ctx context.Context, req *oracledatabasepb.ListCloudVmClustersRequest, opts ...gax.CallOption) *CloudVmClusterIterator {
714 return c.internalClient.ListCloudVmClusters(ctx, req, opts...)
715 }
716
717 // GetCloudVmCluster gets details of a single VM Cluster.
718 func (c *Client) GetCloudVmCluster(ctx context.Context, req *oracledatabasepb.GetCloudVmClusterRequest, opts ...gax.CallOption) (*oracledatabasepb.CloudVmCluster, error) {
719 return c.internalClient.GetCloudVmCluster(ctx, req, opts...)
720 }
721
722 // CreateCloudVmCluster creates a new VM Cluster in a given project and location.
723 func (c *Client) CreateCloudVmCluster(ctx context.Context, req *oracledatabasepb.CreateCloudVmClusterRequest, opts ...gax.CallOption) (*CreateCloudVmClusterOperation, error) {
724 return c.internalClient.CreateCloudVmCluster(ctx, req, opts...)
725 }
726
727 // CreateCloudVmClusterOperation returns a new CreateCloudVmClusterOperation from a given name.
728 // The name must be that of a previously created CreateCloudVmClusterOperation, possibly from a different process.
729 func (c *Client) CreateCloudVmClusterOperation(name string) *CreateCloudVmClusterOperation {
730 return c.internalClient.CreateCloudVmClusterOperation(name)
731 }
732
733 // DeleteCloudVmCluster deletes a single VM Cluster.
734 func (c *Client) DeleteCloudVmCluster(ctx context.Context, req *oracledatabasepb.DeleteCloudVmClusterRequest, opts ...gax.CallOption) (*DeleteCloudVmClusterOperation, error) {
735 return c.internalClient.DeleteCloudVmCluster(ctx, req, opts...)
736 }
737
738 // DeleteCloudVmClusterOperation returns a new DeleteCloudVmClusterOperation from a given name.
739 // The name must be that of a previously created DeleteCloudVmClusterOperation, possibly from a different process.
740 func (c *Client) DeleteCloudVmClusterOperation(name string) *DeleteCloudVmClusterOperation {
741 return c.internalClient.DeleteCloudVmClusterOperation(name)
742 }
743
744 // ListEntitlements lists the entitlements in a given project.
745 func (c *Client) ListEntitlements(ctx context.Context, req *oracledatabasepb.ListEntitlementsRequest, opts ...gax.CallOption) *EntitlementIterator {
746 return c.internalClient.ListEntitlements(ctx, req, opts...)
747 }
748
749 // ListDbServers lists the database servers of an Exadata Infrastructure instance.
750 func (c *Client) ListDbServers(ctx context.Context, req *oracledatabasepb.ListDbServersRequest, opts ...gax.CallOption) *DbServerIterator {
751 return c.internalClient.ListDbServers(ctx, req, opts...)
752 }
753
754 // ListDbNodes lists the database nodes of a VM Cluster.
755 func (c *Client) ListDbNodes(ctx context.Context, req *oracledatabasepb.ListDbNodesRequest, opts ...gax.CallOption) *DbNodeIterator {
756 return c.internalClient.ListDbNodes(ctx, req, opts...)
757 }
758
759 // ListGiVersions lists all the valid Oracle Grid Infrastructure (GI) versions for the given
760 // project and location.
761 func (c *Client) ListGiVersions(ctx context.Context, req *oracledatabasepb.ListGiVersionsRequest, opts ...gax.CallOption) *GiVersionIterator {
762 return c.internalClient.ListGiVersions(ctx, req, opts...)
763 }
764
765 // ListDbSystemShapes lists the database system shapes available for the project and location.
766 func (c *Client) ListDbSystemShapes(ctx context.Context, req *oracledatabasepb.ListDbSystemShapesRequest, opts ...gax.CallOption) *DbSystemShapeIterator {
767 return c.internalClient.ListDbSystemShapes(ctx, req, opts...)
768 }
769
770 // ListAutonomousDatabases lists the Autonomous Databases in a given project and location.
771 func (c *Client) ListAutonomousDatabases(ctx context.Context, req *oracledatabasepb.ListAutonomousDatabasesRequest, opts ...gax.CallOption) *AutonomousDatabaseIterator {
772 return c.internalClient.ListAutonomousDatabases(ctx, req, opts...)
773 }
774
775 // GetAutonomousDatabase gets the details of a single Autonomous Database.
776 func (c *Client) GetAutonomousDatabase(ctx context.Context, req *oracledatabasepb.GetAutonomousDatabaseRequest, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
777 return c.internalClient.GetAutonomousDatabase(ctx, req, opts...)
778 }
779
780 // CreateAutonomousDatabase creates a new Autonomous Database in a given project and location.
781 func (c *Client) CreateAutonomousDatabase(ctx context.Context, req *oracledatabasepb.CreateAutonomousDatabaseRequest, opts ...gax.CallOption) (*CreateAutonomousDatabaseOperation, error) {
782 return c.internalClient.CreateAutonomousDatabase(ctx, req, opts...)
783 }
784
785 // CreateAutonomousDatabaseOperation returns a new CreateAutonomousDatabaseOperation from a given name.
786 // The name must be that of a previously created CreateAutonomousDatabaseOperation, possibly from a different process.
787 func (c *Client) CreateAutonomousDatabaseOperation(name string) *CreateAutonomousDatabaseOperation {
788 return c.internalClient.CreateAutonomousDatabaseOperation(name)
789 }
790
791 // DeleteAutonomousDatabase deletes a single Autonomous Database.
792 func (c *Client) DeleteAutonomousDatabase(ctx context.Context, req *oracledatabasepb.DeleteAutonomousDatabaseRequest, opts ...gax.CallOption) (*DeleteAutonomousDatabaseOperation, error) {
793 return c.internalClient.DeleteAutonomousDatabase(ctx, req, opts...)
794 }
795
796 // DeleteAutonomousDatabaseOperation returns a new DeleteAutonomousDatabaseOperation from a given name.
797 // The name must be that of a previously created DeleteAutonomousDatabaseOperation, possibly from a different process.
798 func (c *Client) DeleteAutonomousDatabaseOperation(name string) *DeleteAutonomousDatabaseOperation {
799 return c.internalClient.DeleteAutonomousDatabaseOperation(name)
800 }
801
802 // RestoreAutonomousDatabase restores a single Autonomous Database.
803 func (c *Client) RestoreAutonomousDatabase(ctx context.Context, req *oracledatabasepb.RestoreAutonomousDatabaseRequest, opts ...gax.CallOption) (*RestoreAutonomousDatabaseOperation, error) {
804 return c.internalClient.RestoreAutonomousDatabase(ctx, req, opts...)
805 }
806
807 // RestoreAutonomousDatabaseOperation returns a new RestoreAutonomousDatabaseOperation from a given name.
808 // The name must be that of a previously created RestoreAutonomousDatabaseOperation, possibly from a different process.
809 func (c *Client) RestoreAutonomousDatabaseOperation(name string) *RestoreAutonomousDatabaseOperation {
810 return c.internalClient.RestoreAutonomousDatabaseOperation(name)
811 }
812
813 // GenerateAutonomousDatabaseWallet generates a wallet for an Autonomous Database.
814 func (c *Client) GenerateAutonomousDatabaseWallet(ctx context.Context, req *oracledatabasepb.GenerateAutonomousDatabaseWalletRequest, opts ...gax.CallOption) (*oracledatabasepb.GenerateAutonomousDatabaseWalletResponse, error) {
815 return c.internalClient.GenerateAutonomousDatabaseWallet(ctx, req, opts...)
816 }
817
818 // ListAutonomousDbVersions lists all the available Autonomous Database versions for a project and
819 // location.
820 func (c *Client) ListAutonomousDbVersions(ctx context.Context, req *oracledatabasepb.ListAutonomousDbVersionsRequest, opts ...gax.CallOption) *AutonomousDbVersionIterator {
821 return c.internalClient.ListAutonomousDbVersions(ctx, req, opts...)
822 }
823
824 // ListAutonomousDatabaseCharacterSets lists Autonomous Database Character Sets in a given project and location.
825 func (c *Client) ListAutonomousDatabaseCharacterSets(ctx context.Context, req *oracledatabasepb.ListAutonomousDatabaseCharacterSetsRequest, opts ...gax.CallOption) *AutonomousDatabaseCharacterSetIterator {
826 return c.internalClient.ListAutonomousDatabaseCharacterSets(ctx, req, opts...)
827 }
828
829 // ListAutonomousDatabaseBackups lists the long-term and automatic backups of an Autonomous Database.
830 func (c *Client) ListAutonomousDatabaseBackups(ctx context.Context, req *oracledatabasepb.ListAutonomousDatabaseBackupsRequest, opts ...gax.CallOption) *AutonomousDatabaseBackupIterator {
831 return c.internalClient.ListAutonomousDatabaseBackups(ctx, req, opts...)
832 }
833
834 // StopAutonomousDatabase stops an Autonomous Database.
835 func (c *Client) StopAutonomousDatabase(ctx context.Context, req *oracledatabasepb.StopAutonomousDatabaseRequest, opts ...gax.CallOption) (*StopAutonomousDatabaseOperation, error) {
836 return c.internalClient.StopAutonomousDatabase(ctx, req, opts...)
837 }
838
839 // StopAutonomousDatabaseOperation returns a new StopAutonomousDatabaseOperation from a given name.
840 // The name must be that of a previously created StopAutonomousDatabaseOperation, possibly from a different process.
841 func (c *Client) StopAutonomousDatabaseOperation(name string) *StopAutonomousDatabaseOperation {
842 return c.internalClient.StopAutonomousDatabaseOperation(name)
843 }
844
845 // StartAutonomousDatabase starts an Autonomous Database.
846 func (c *Client) StartAutonomousDatabase(ctx context.Context, req *oracledatabasepb.StartAutonomousDatabaseRequest, opts ...gax.CallOption) (*StartAutonomousDatabaseOperation, error) {
847 return c.internalClient.StartAutonomousDatabase(ctx, req, opts...)
848 }
849
850 // StartAutonomousDatabaseOperation returns a new StartAutonomousDatabaseOperation from a given name.
851 // The name must be that of a previously created StartAutonomousDatabaseOperation, possibly from a different process.
852 func (c *Client) StartAutonomousDatabaseOperation(name string) *StartAutonomousDatabaseOperation {
853 return c.internalClient.StartAutonomousDatabaseOperation(name)
854 }
855
856 // RestartAutonomousDatabase restarts an Autonomous Database.
857 func (c *Client) RestartAutonomousDatabase(ctx context.Context, req *oracledatabasepb.RestartAutonomousDatabaseRequest, opts ...gax.CallOption) (*RestartAutonomousDatabaseOperation, error) {
858 return c.internalClient.RestartAutonomousDatabase(ctx, req, opts...)
859 }
860
861 // RestartAutonomousDatabaseOperation returns a new RestartAutonomousDatabaseOperation from a given name.
862 // The name must be that of a previously created RestartAutonomousDatabaseOperation, possibly from a different process.
863 func (c *Client) RestartAutonomousDatabaseOperation(name string) *RestartAutonomousDatabaseOperation {
864 return c.internalClient.RestartAutonomousDatabaseOperation(name)
865 }
866
867 // GetLocation gets information about a location.
868 func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
869 return c.internalClient.GetLocation(ctx, req, opts...)
870 }
871
872 // ListLocations lists information about the supported locations for this service.
873 func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
874 return c.internalClient.ListLocations(ctx, req, opts...)
875 }
876
877 // CancelOperation is a utility method from google.longrunning.Operations.
878 func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
879 return c.internalClient.CancelOperation(ctx, req, opts...)
880 }
881
882 // DeleteOperation is a utility method from google.longrunning.Operations.
883 func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
884 return c.internalClient.DeleteOperation(ctx, req, opts...)
885 }
886
887 // GetOperation is a utility method from google.longrunning.Operations.
888 func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
889 return c.internalClient.GetOperation(ctx, req, opts...)
890 }
891
892 // ListOperations is a utility method from google.longrunning.Operations.
893 func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
894 return c.internalClient.ListOperations(ctx, req, opts...)
895 }
896
897 // gRPCClient is a client for interacting with Oracle Database@Google Cloud API over gRPC transport.
898 //
899 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
900 type gRPCClient struct {
901 // Connection pool of gRPC connections to the service.
902 connPool gtransport.ConnPool
903
904 // Points back to the CallOptions field of the containing Client
905 CallOptions **CallOptions
906
907 // The gRPC API client.
908 client oracledatabasepb.OracleDatabaseClient
909
910 // LROClient is used internally to handle long-running operations.
911 // It is exposed so that its CallOptions can be modified if required.
912 // Users should not Close this client.
913 LROClient **lroauto.OperationsClient
914
915 operationsClient longrunningpb.OperationsClient
916
917 locationsClient locationpb.LocationsClient
918
919 // The x-goog-* metadata to be sent with each request.
920 xGoogHeaders []string
921
922 logger *slog.Logger
923 }
924
925 // NewClient creates a new oracle database client based on gRPC.
926 // The returned client must be Closed when it is done being used to clean up its underlying connections.
927 //
928 // Service describing handlers for resources
929 func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
930 clientOpts := defaultGRPCClientOptions()
931 if newClientHook != nil {
932 hookOpts, err := newClientHook(ctx, clientHookParams{})
933 if err != nil {
934 return nil, err
935 }
936 clientOpts = append(clientOpts, hookOpts...)
937 }
938
939 connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
940 if err != nil {
941 return nil, err
942 }
943 client := Client{CallOptions: defaultCallOptions()}
944
945 c := &gRPCClient{
946 connPool: connPool,
947 client: oracledatabasepb.NewOracleDatabaseClient(connPool),
948 CallOptions: &client.CallOptions,
949 logger: internaloption.GetLogger(opts),
950 operationsClient: longrunningpb.NewOperationsClient(connPool),
951 locationsClient: locationpb.NewLocationsClient(connPool),
952 }
953 c.setGoogleClientInfo()
954
955 client.internalClient = c
956
957 client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
958 if err != nil {
959 // This error "should not happen", since we are just reusing old connection pool
960 // and never actually need to dial.
961 // If this does happen, we could leak connp. However, we cannot close conn:
962 // If the user invoked the constructor with option.WithGRPCConn,
963 // we would close a connection that's still in use.
964 // TODO: investigate error conditions.
965 return nil, err
966 }
967 c.LROClient = &client.LROClient
968 return &client, nil
969 }
970
971 // Connection returns a connection to the API service.
972 //
973 // Deprecated: Connections are now pooled so this method does not always
974 // return the same resource.
975 func (c *gRPCClient) Connection() *grpc.ClientConn {
976 return c.connPool.Conn()
977 }
978
979 // setGoogleClientInfo sets the name and version of the application in
980 // the `x-goog-api-client` header passed on each request. Intended for
981 // use by Google-written clients.
982 func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
983 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
984 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion)
985 c.xGoogHeaders = []string{
986 "x-goog-api-client", gax.XGoogHeader(kv...),
987 }
988 }
989
990 // Close closes the connection to the API service. The user should invoke this when
991 // the client is no longer required.
992 func (c *gRPCClient) Close() error {
993 return c.connPool.Close()
994 }
995
996 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
997 type restClient struct {
998 // The http endpoint to connect to.
999 endpoint string
1000
1001 // The http client.
1002 httpClient *http.Client
1003
1004 // LROClient is used internally to handle long-running operations.
1005 // It is exposed so that its CallOptions can be modified if required.
1006 // Users should not Close this client.
1007 LROClient **lroauto.OperationsClient
1008
1009 // The x-goog-* headers to be sent with each request.
1010 xGoogHeaders []string
1011
1012 // Points back to the CallOptions field of the containing Client
1013 CallOptions **CallOptions
1014
1015 logger *slog.Logger
1016 }
1017
1018 // NewRESTClient creates a new oracle database rest client.
1019 //
1020 // Service describing handlers for resources
1021 func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
1022 clientOpts := append(defaultRESTClientOptions(), opts...)
1023 httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
1024 if err != nil {
1025 return nil, err
1026 }
1027
1028 callOpts := defaultRESTCallOptions()
1029 c := &restClient{
1030 endpoint: endpoint,
1031 httpClient: httpClient,
1032 CallOptions: &callOpts,
1033 logger: internaloption.GetLogger(opts),
1034 }
1035 c.setGoogleClientInfo()
1036
1037 lroOpts := []option.ClientOption{
1038 option.WithHTTPClient(httpClient),
1039 option.WithEndpoint(endpoint),
1040 }
1041 opClient, err := lroauto.NewOperationsRESTClient(ctx, lroOpts...)
1042 if err != nil {
1043 return nil, err
1044 }
1045 c.LROClient = &opClient
1046
1047 return &Client{internalClient: c, CallOptions: callOpts}, nil
1048 }
1049
1050 func defaultRESTClientOptions() []option.ClientOption {
1051 return []option.ClientOption{
1052 internaloption.WithDefaultEndpoint("https://oracledatabase.googleapis.com"),
1053 internaloption.WithDefaultEndpointTemplate("https://oracledatabase.UNIVERSE_DOMAIN"),
1054 internaloption.WithDefaultMTLSEndpoint("https://oracledatabase.mtls.googleapis.com"),
1055 internaloption.WithDefaultUniverseDomain("googleapis.com"),
1056 internaloption.WithDefaultAudience("https://oracledatabase.googleapis.com/"),
1057 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
1058 internaloption.EnableNewAuthLibrary(),
1059 }
1060 }
1061
1062 // setGoogleClientInfo sets the name and version of the application in
1063 // the `x-goog-api-client` header passed on each request. Intended for
1064 // use by Google-written clients.
1065 func (c *restClient) setGoogleClientInfo(keyval ...string) {
1066 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
1067 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN", "pb", protoVersion)
1068 c.xGoogHeaders = []string{
1069 "x-goog-api-client", gax.XGoogHeader(kv...),
1070 }
1071 }
1072
1073 // Close closes the connection to the API service. The user should invoke this when
1074 // the client is no longer required.
1075 func (c *restClient) Close() error {
1076 // Replace httpClient with nil to force cleanup.
1077 c.httpClient = nil
1078 return nil
1079 }
1080
1081 // Connection returns a connection to the API service.
1082 //
1083 // Deprecated: This method always returns nil.
1084 func (c *restClient) Connection() *grpc.ClientConn {
1085 return nil
1086 }
1087 func (c *gRPCClient) ListCloudExadataInfrastructures(ctx context.Context, req *oracledatabasepb.ListCloudExadataInfrastructuresRequest, opts ...gax.CallOption) *CloudExadataInfrastructureIterator {
1088 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1089
1090 hds = append(c.xGoogHeaders, hds...)
1091 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1092 opts = append((*c.CallOptions).ListCloudExadataInfrastructures[0:len((*c.CallOptions).ListCloudExadataInfrastructures):len((*c.CallOptions).ListCloudExadataInfrastructures)], opts...)
1093 it := &CloudExadataInfrastructureIterator{}
1094 req = proto.Clone(req).(*oracledatabasepb.ListCloudExadataInfrastructuresRequest)
1095 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.CloudExadataInfrastructure, string, error) {
1096 resp := &oracledatabasepb.ListCloudExadataInfrastructuresResponse{}
1097 if pageToken != "" {
1098 req.PageToken = pageToken
1099 }
1100 if pageSize > math.MaxInt32 {
1101 req.PageSize = math.MaxInt32
1102 } else if pageSize != 0 {
1103 req.PageSize = int32(pageSize)
1104 }
1105 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1106 var err error
1107 resp, err = executeRPC(ctx, c.client.ListCloudExadataInfrastructures, req, settings.GRPC, c.logger, "ListCloudExadataInfrastructures")
1108 return err
1109 }, opts...)
1110 if err != nil {
1111 return nil, "", err
1112 }
1113
1114 it.Response = resp
1115 return resp.GetCloudExadataInfrastructures(), resp.GetNextPageToken(), nil
1116 }
1117 fetch := func(pageSize int, pageToken string) (string, error) {
1118 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1119 if err != nil {
1120 return "", err
1121 }
1122 it.items = append(it.items, items...)
1123 return nextPageToken, nil
1124 }
1125
1126 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1127 it.pageInfo.MaxSize = int(req.GetPageSize())
1128 it.pageInfo.Token = req.GetPageToken()
1129
1130 return it
1131 }
1132
1133 func (c *gRPCClient) GetCloudExadataInfrastructure(ctx context.Context, req *oracledatabasepb.GetCloudExadataInfrastructureRequest, opts ...gax.CallOption) (*oracledatabasepb.CloudExadataInfrastructure, error) {
1134 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1135
1136 hds = append(c.xGoogHeaders, hds...)
1137 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1138 opts = append((*c.CallOptions).GetCloudExadataInfrastructure[0:len((*c.CallOptions).GetCloudExadataInfrastructure):len((*c.CallOptions).GetCloudExadataInfrastructure)], opts...)
1139 var resp *oracledatabasepb.CloudExadataInfrastructure
1140 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1141 var err error
1142 resp, err = executeRPC(ctx, c.client.GetCloudExadataInfrastructure, req, settings.GRPC, c.logger, "GetCloudExadataInfrastructure")
1143 return err
1144 }, opts...)
1145 if err != nil {
1146 return nil, err
1147 }
1148 return resp, nil
1149 }
1150
1151 func (c *gRPCClient) CreateCloudExadataInfrastructure(ctx context.Context, req *oracledatabasepb.CreateCloudExadataInfrastructureRequest, opts ...gax.CallOption) (*CreateCloudExadataInfrastructureOperation, error) {
1152 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1153
1154 hds = append(c.xGoogHeaders, hds...)
1155 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1156 opts = append((*c.CallOptions).CreateCloudExadataInfrastructure[0:len((*c.CallOptions).CreateCloudExadataInfrastructure):len((*c.CallOptions).CreateCloudExadataInfrastructure)], opts...)
1157 var resp *longrunningpb.Operation
1158 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1159 var err error
1160 resp, err = executeRPC(ctx, c.client.CreateCloudExadataInfrastructure, req, settings.GRPC, c.logger, "CreateCloudExadataInfrastructure")
1161 return err
1162 }, opts...)
1163 if err != nil {
1164 return nil, err
1165 }
1166 return &CreateCloudExadataInfrastructureOperation{
1167 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1168 }, nil
1169 }
1170
1171 func (c *gRPCClient) DeleteCloudExadataInfrastructure(ctx context.Context, req *oracledatabasepb.DeleteCloudExadataInfrastructureRequest, opts ...gax.CallOption) (*DeleteCloudExadataInfrastructureOperation, error) {
1172 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1173
1174 hds = append(c.xGoogHeaders, hds...)
1175 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1176 opts = append((*c.CallOptions).DeleteCloudExadataInfrastructure[0:len((*c.CallOptions).DeleteCloudExadataInfrastructure):len((*c.CallOptions).DeleteCloudExadataInfrastructure)], opts...)
1177 var resp *longrunningpb.Operation
1178 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1179 var err error
1180 resp, err = executeRPC(ctx, c.client.DeleteCloudExadataInfrastructure, req, settings.GRPC, c.logger, "DeleteCloudExadataInfrastructure")
1181 return err
1182 }, opts...)
1183 if err != nil {
1184 return nil, err
1185 }
1186 return &DeleteCloudExadataInfrastructureOperation{
1187 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1188 }, nil
1189 }
1190
1191 func (c *gRPCClient) ListCloudVmClusters(ctx context.Context, req *oracledatabasepb.ListCloudVmClustersRequest, opts ...gax.CallOption) *CloudVmClusterIterator {
1192 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1193
1194 hds = append(c.xGoogHeaders, hds...)
1195 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1196 opts = append((*c.CallOptions).ListCloudVmClusters[0:len((*c.CallOptions).ListCloudVmClusters):len((*c.CallOptions).ListCloudVmClusters)], opts...)
1197 it := &CloudVmClusterIterator{}
1198 req = proto.Clone(req).(*oracledatabasepb.ListCloudVmClustersRequest)
1199 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.CloudVmCluster, string, error) {
1200 resp := &oracledatabasepb.ListCloudVmClustersResponse{}
1201 if pageToken != "" {
1202 req.PageToken = pageToken
1203 }
1204 if pageSize > math.MaxInt32 {
1205 req.PageSize = math.MaxInt32
1206 } else if pageSize != 0 {
1207 req.PageSize = int32(pageSize)
1208 }
1209 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1210 var err error
1211 resp, err = executeRPC(ctx, c.client.ListCloudVmClusters, req, settings.GRPC, c.logger, "ListCloudVmClusters")
1212 return err
1213 }, opts...)
1214 if err != nil {
1215 return nil, "", err
1216 }
1217
1218 it.Response = resp
1219 return resp.GetCloudVmClusters(), resp.GetNextPageToken(), nil
1220 }
1221 fetch := func(pageSize int, pageToken string) (string, error) {
1222 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1223 if err != nil {
1224 return "", err
1225 }
1226 it.items = append(it.items, items...)
1227 return nextPageToken, nil
1228 }
1229
1230 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1231 it.pageInfo.MaxSize = int(req.GetPageSize())
1232 it.pageInfo.Token = req.GetPageToken()
1233
1234 return it
1235 }
1236
1237 func (c *gRPCClient) GetCloudVmCluster(ctx context.Context, req *oracledatabasepb.GetCloudVmClusterRequest, opts ...gax.CallOption) (*oracledatabasepb.CloudVmCluster, error) {
1238 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1239
1240 hds = append(c.xGoogHeaders, hds...)
1241 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1242 opts = append((*c.CallOptions).GetCloudVmCluster[0:len((*c.CallOptions).GetCloudVmCluster):len((*c.CallOptions).GetCloudVmCluster)], opts...)
1243 var resp *oracledatabasepb.CloudVmCluster
1244 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1245 var err error
1246 resp, err = executeRPC(ctx, c.client.GetCloudVmCluster, req, settings.GRPC, c.logger, "GetCloudVmCluster")
1247 return err
1248 }, opts...)
1249 if err != nil {
1250 return nil, err
1251 }
1252 return resp, nil
1253 }
1254
1255 func (c *gRPCClient) CreateCloudVmCluster(ctx context.Context, req *oracledatabasepb.CreateCloudVmClusterRequest, opts ...gax.CallOption) (*CreateCloudVmClusterOperation, error) {
1256 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1257
1258 hds = append(c.xGoogHeaders, hds...)
1259 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1260 opts = append((*c.CallOptions).CreateCloudVmCluster[0:len((*c.CallOptions).CreateCloudVmCluster):len((*c.CallOptions).CreateCloudVmCluster)], opts...)
1261 var resp *longrunningpb.Operation
1262 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1263 var err error
1264 resp, err = executeRPC(ctx, c.client.CreateCloudVmCluster, req, settings.GRPC, c.logger, "CreateCloudVmCluster")
1265 return err
1266 }, opts...)
1267 if err != nil {
1268 return nil, err
1269 }
1270 return &CreateCloudVmClusterOperation{
1271 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1272 }, nil
1273 }
1274
1275 func (c *gRPCClient) DeleteCloudVmCluster(ctx context.Context, req *oracledatabasepb.DeleteCloudVmClusterRequest, opts ...gax.CallOption) (*DeleteCloudVmClusterOperation, error) {
1276 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1277
1278 hds = append(c.xGoogHeaders, hds...)
1279 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1280 opts = append((*c.CallOptions).DeleteCloudVmCluster[0:len((*c.CallOptions).DeleteCloudVmCluster):len((*c.CallOptions).DeleteCloudVmCluster)], opts...)
1281 var resp *longrunningpb.Operation
1282 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1283 var err error
1284 resp, err = executeRPC(ctx, c.client.DeleteCloudVmCluster, req, settings.GRPC, c.logger, "DeleteCloudVmCluster")
1285 return err
1286 }, opts...)
1287 if err != nil {
1288 return nil, err
1289 }
1290 return &DeleteCloudVmClusterOperation{
1291 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1292 }, nil
1293 }
1294
1295 func (c *gRPCClient) ListEntitlements(ctx context.Context, req *oracledatabasepb.ListEntitlementsRequest, opts ...gax.CallOption) *EntitlementIterator {
1296 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1297
1298 hds = append(c.xGoogHeaders, hds...)
1299 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1300 opts = append((*c.CallOptions).ListEntitlements[0:len((*c.CallOptions).ListEntitlements):len((*c.CallOptions).ListEntitlements)], opts...)
1301 it := &EntitlementIterator{}
1302 req = proto.Clone(req).(*oracledatabasepb.ListEntitlementsRequest)
1303 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.Entitlement, string, error) {
1304 resp := &oracledatabasepb.ListEntitlementsResponse{}
1305 if pageToken != "" {
1306 req.PageToken = pageToken
1307 }
1308 if pageSize > math.MaxInt32 {
1309 req.PageSize = math.MaxInt32
1310 } else if pageSize != 0 {
1311 req.PageSize = int32(pageSize)
1312 }
1313 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1314 var err error
1315 resp, err = executeRPC(ctx, c.client.ListEntitlements, req, settings.GRPC, c.logger, "ListEntitlements")
1316 return err
1317 }, opts...)
1318 if err != nil {
1319 return nil, "", err
1320 }
1321
1322 it.Response = resp
1323 return resp.GetEntitlements(), resp.GetNextPageToken(), nil
1324 }
1325 fetch := func(pageSize int, pageToken string) (string, error) {
1326 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1327 if err != nil {
1328 return "", err
1329 }
1330 it.items = append(it.items, items...)
1331 return nextPageToken, nil
1332 }
1333
1334 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1335 it.pageInfo.MaxSize = int(req.GetPageSize())
1336 it.pageInfo.Token = req.GetPageToken()
1337
1338 return it
1339 }
1340
1341 func (c *gRPCClient) ListDbServers(ctx context.Context, req *oracledatabasepb.ListDbServersRequest, opts ...gax.CallOption) *DbServerIterator {
1342 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1343
1344 hds = append(c.xGoogHeaders, hds...)
1345 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1346 opts = append((*c.CallOptions).ListDbServers[0:len((*c.CallOptions).ListDbServers):len((*c.CallOptions).ListDbServers)], opts...)
1347 it := &DbServerIterator{}
1348 req = proto.Clone(req).(*oracledatabasepb.ListDbServersRequest)
1349 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.DbServer, string, error) {
1350 resp := &oracledatabasepb.ListDbServersResponse{}
1351 if pageToken != "" {
1352 req.PageToken = pageToken
1353 }
1354 if pageSize > math.MaxInt32 {
1355 req.PageSize = math.MaxInt32
1356 } else if pageSize != 0 {
1357 req.PageSize = int32(pageSize)
1358 }
1359 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1360 var err error
1361 resp, err = executeRPC(ctx, c.client.ListDbServers, req, settings.GRPC, c.logger, "ListDbServers")
1362 return err
1363 }, opts...)
1364 if err != nil {
1365 return nil, "", err
1366 }
1367
1368 it.Response = resp
1369 return resp.GetDbServers(), resp.GetNextPageToken(), nil
1370 }
1371 fetch := func(pageSize int, pageToken string) (string, error) {
1372 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1373 if err != nil {
1374 return "", err
1375 }
1376 it.items = append(it.items, items...)
1377 return nextPageToken, nil
1378 }
1379
1380 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1381 it.pageInfo.MaxSize = int(req.GetPageSize())
1382 it.pageInfo.Token = req.GetPageToken()
1383
1384 return it
1385 }
1386
1387 func (c *gRPCClient) ListDbNodes(ctx context.Context, req *oracledatabasepb.ListDbNodesRequest, opts ...gax.CallOption) *DbNodeIterator {
1388 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1389
1390 hds = append(c.xGoogHeaders, hds...)
1391 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1392 opts = append((*c.CallOptions).ListDbNodes[0:len((*c.CallOptions).ListDbNodes):len((*c.CallOptions).ListDbNodes)], opts...)
1393 it := &DbNodeIterator{}
1394 req = proto.Clone(req).(*oracledatabasepb.ListDbNodesRequest)
1395 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.DbNode, string, error) {
1396 resp := &oracledatabasepb.ListDbNodesResponse{}
1397 if pageToken != "" {
1398 req.PageToken = pageToken
1399 }
1400 if pageSize > math.MaxInt32 {
1401 req.PageSize = math.MaxInt32
1402 } else if pageSize != 0 {
1403 req.PageSize = int32(pageSize)
1404 }
1405 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1406 var err error
1407 resp, err = executeRPC(ctx, c.client.ListDbNodes, req, settings.GRPC, c.logger, "ListDbNodes")
1408 return err
1409 }, opts...)
1410 if err != nil {
1411 return nil, "", err
1412 }
1413
1414 it.Response = resp
1415 return resp.GetDbNodes(), resp.GetNextPageToken(), nil
1416 }
1417 fetch := func(pageSize int, pageToken string) (string, error) {
1418 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1419 if err != nil {
1420 return "", err
1421 }
1422 it.items = append(it.items, items...)
1423 return nextPageToken, nil
1424 }
1425
1426 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1427 it.pageInfo.MaxSize = int(req.GetPageSize())
1428 it.pageInfo.Token = req.GetPageToken()
1429
1430 return it
1431 }
1432
1433 func (c *gRPCClient) ListGiVersions(ctx context.Context, req *oracledatabasepb.ListGiVersionsRequest, opts ...gax.CallOption) *GiVersionIterator {
1434 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1435
1436 hds = append(c.xGoogHeaders, hds...)
1437 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1438 opts = append((*c.CallOptions).ListGiVersions[0:len((*c.CallOptions).ListGiVersions):len((*c.CallOptions).ListGiVersions)], opts...)
1439 it := &GiVersionIterator{}
1440 req = proto.Clone(req).(*oracledatabasepb.ListGiVersionsRequest)
1441 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.GiVersion, string, error) {
1442 resp := &oracledatabasepb.ListGiVersionsResponse{}
1443 if pageToken != "" {
1444 req.PageToken = pageToken
1445 }
1446 if pageSize > math.MaxInt32 {
1447 req.PageSize = math.MaxInt32
1448 } else if pageSize != 0 {
1449 req.PageSize = int32(pageSize)
1450 }
1451 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1452 var err error
1453 resp, err = executeRPC(ctx, c.client.ListGiVersions, req, settings.GRPC, c.logger, "ListGiVersions")
1454 return err
1455 }, opts...)
1456 if err != nil {
1457 return nil, "", err
1458 }
1459
1460 it.Response = resp
1461 return resp.GetGiVersions(), resp.GetNextPageToken(), nil
1462 }
1463 fetch := func(pageSize int, pageToken string) (string, error) {
1464 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1465 if err != nil {
1466 return "", err
1467 }
1468 it.items = append(it.items, items...)
1469 return nextPageToken, nil
1470 }
1471
1472 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1473 it.pageInfo.MaxSize = int(req.GetPageSize())
1474 it.pageInfo.Token = req.GetPageToken()
1475
1476 return it
1477 }
1478
1479 func (c *gRPCClient) ListDbSystemShapes(ctx context.Context, req *oracledatabasepb.ListDbSystemShapesRequest, opts ...gax.CallOption) *DbSystemShapeIterator {
1480 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1481
1482 hds = append(c.xGoogHeaders, hds...)
1483 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1484 opts = append((*c.CallOptions).ListDbSystemShapes[0:len((*c.CallOptions).ListDbSystemShapes):len((*c.CallOptions).ListDbSystemShapes)], opts...)
1485 it := &DbSystemShapeIterator{}
1486 req = proto.Clone(req).(*oracledatabasepb.ListDbSystemShapesRequest)
1487 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.DbSystemShape, string, error) {
1488 resp := &oracledatabasepb.ListDbSystemShapesResponse{}
1489 if pageToken != "" {
1490 req.PageToken = pageToken
1491 }
1492 if pageSize > math.MaxInt32 {
1493 req.PageSize = math.MaxInt32
1494 } else if pageSize != 0 {
1495 req.PageSize = int32(pageSize)
1496 }
1497 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1498 var err error
1499 resp, err = executeRPC(ctx, c.client.ListDbSystemShapes, req, settings.GRPC, c.logger, "ListDbSystemShapes")
1500 return err
1501 }, opts...)
1502 if err != nil {
1503 return nil, "", err
1504 }
1505
1506 it.Response = resp
1507 return resp.GetDbSystemShapes(), resp.GetNextPageToken(), nil
1508 }
1509 fetch := func(pageSize int, pageToken string) (string, error) {
1510 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1511 if err != nil {
1512 return "", err
1513 }
1514 it.items = append(it.items, items...)
1515 return nextPageToken, nil
1516 }
1517
1518 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1519 it.pageInfo.MaxSize = int(req.GetPageSize())
1520 it.pageInfo.Token = req.GetPageToken()
1521
1522 return it
1523 }
1524
1525 func (c *gRPCClient) ListAutonomousDatabases(ctx context.Context, req *oracledatabasepb.ListAutonomousDatabasesRequest, opts ...gax.CallOption) *AutonomousDatabaseIterator {
1526 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1527
1528 hds = append(c.xGoogHeaders, hds...)
1529 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1530 opts = append((*c.CallOptions).ListAutonomousDatabases[0:len((*c.CallOptions).ListAutonomousDatabases):len((*c.CallOptions).ListAutonomousDatabases)], opts...)
1531 it := &AutonomousDatabaseIterator{}
1532 req = proto.Clone(req).(*oracledatabasepb.ListAutonomousDatabasesRequest)
1533 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.AutonomousDatabase, string, error) {
1534 resp := &oracledatabasepb.ListAutonomousDatabasesResponse{}
1535 if pageToken != "" {
1536 req.PageToken = pageToken
1537 }
1538 if pageSize > math.MaxInt32 {
1539 req.PageSize = math.MaxInt32
1540 } else if pageSize != 0 {
1541 req.PageSize = int32(pageSize)
1542 }
1543 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1544 var err error
1545 resp, err = executeRPC(ctx, c.client.ListAutonomousDatabases, req, settings.GRPC, c.logger, "ListAutonomousDatabases")
1546 return err
1547 }, opts...)
1548 if err != nil {
1549 return nil, "", err
1550 }
1551
1552 it.Response = resp
1553 return resp.GetAutonomousDatabases(), resp.GetNextPageToken(), nil
1554 }
1555 fetch := func(pageSize int, pageToken string) (string, error) {
1556 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1557 if err != nil {
1558 return "", err
1559 }
1560 it.items = append(it.items, items...)
1561 return nextPageToken, nil
1562 }
1563
1564 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1565 it.pageInfo.MaxSize = int(req.GetPageSize())
1566 it.pageInfo.Token = req.GetPageToken()
1567
1568 return it
1569 }
1570
1571 func (c *gRPCClient) GetAutonomousDatabase(ctx context.Context, req *oracledatabasepb.GetAutonomousDatabaseRequest, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
1572 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1573
1574 hds = append(c.xGoogHeaders, hds...)
1575 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1576 opts = append((*c.CallOptions).GetAutonomousDatabase[0:len((*c.CallOptions).GetAutonomousDatabase):len((*c.CallOptions).GetAutonomousDatabase)], opts...)
1577 var resp *oracledatabasepb.AutonomousDatabase
1578 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1579 var err error
1580 resp, err = executeRPC(ctx, c.client.GetAutonomousDatabase, req, settings.GRPC, c.logger, "GetAutonomousDatabase")
1581 return err
1582 }, opts...)
1583 if err != nil {
1584 return nil, err
1585 }
1586 return resp, nil
1587 }
1588
1589 func (c *gRPCClient) CreateAutonomousDatabase(ctx context.Context, req *oracledatabasepb.CreateAutonomousDatabaseRequest, opts ...gax.CallOption) (*CreateAutonomousDatabaseOperation, error) {
1590 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1591
1592 hds = append(c.xGoogHeaders, hds...)
1593 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1594 opts = append((*c.CallOptions).CreateAutonomousDatabase[0:len((*c.CallOptions).CreateAutonomousDatabase):len((*c.CallOptions).CreateAutonomousDatabase)], opts...)
1595 var resp *longrunningpb.Operation
1596 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1597 var err error
1598 resp, err = executeRPC(ctx, c.client.CreateAutonomousDatabase, req, settings.GRPC, c.logger, "CreateAutonomousDatabase")
1599 return err
1600 }, opts...)
1601 if err != nil {
1602 return nil, err
1603 }
1604 return &CreateAutonomousDatabaseOperation{
1605 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1606 }, nil
1607 }
1608
1609 func (c *gRPCClient) DeleteAutonomousDatabase(ctx context.Context, req *oracledatabasepb.DeleteAutonomousDatabaseRequest, opts ...gax.CallOption) (*DeleteAutonomousDatabaseOperation, error) {
1610 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1611
1612 hds = append(c.xGoogHeaders, hds...)
1613 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1614 opts = append((*c.CallOptions).DeleteAutonomousDatabase[0:len((*c.CallOptions).DeleteAutonomousDatabase):len((*c.CallOptions).DeleteAutonomousDatabase)], opts...)
1615 var resp *longrunningpb.Operation
1616 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1617 var err error
1618 resp, err = executeRPC(ctx, c.client.DeleteAutonomousDatabase, req, settings.GRPC, c.logger, "DeleteAutonomousDatabase")
1619 return err
1620 }, opts...)
1621 if err != nil {
1622 return nil, err
1623 }
1624 return &DeleteAutonomousDatabaseOperation{
1625 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1626 }, nil
1627 }
1628
1629 func (c *gRPCClient) RestoreAutonomousDatabase(ctx context.Context, req *oracledatabasepb.RestoreAutonomousDatabaseRequest, opts ...gax.CallOption) (*RestoreAutonomousDatabaseOperation, error) {
1630 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1631
1632 hds = append(c.xGoogHeaders, hds...)
1633 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1634 opts = append((*c.CallOptions).RestoreAutonomousDatabase[0:len((*c.CallOptions).RestoreAutonomousDatabase):len((*c.CallOptions).RestoreAutonomousDatabase)], opts...)
1635 var resp *longrunningpb.Operation
1636 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1637 var err error
1638 resp, err = executeRPC(ctx, c.client.RestoreAutonomousDatabase, req, settings.GRPC, c.logger, "RestoreAutonomousDatabase")
1639 return err
1640 }, opts...)
1641 if err != nil {
1642 return nil, err
1643 }
1644 return &RestoreAutonomousDatabaseOperation{
1645 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1646 }, nil
1647 }
1648
1649 func (c *gRPCClient) GenerateAutonomousDatabaseWallet(ctx context.Context, req *oracledatabasepb.GenerateAutonomousDatabaseWalletRequest, opts ...gax.CallOption) (*oracledatabasepb.GenerateAutonomousDatabaseWalletResponse, error) {
1650 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1651
1652 hds = append(c.xGoogHeaders, hds...)
1653 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1654 opts = append((*c.CallOptions).GenerateAutonomousDatabaseWallet[0:len((*c.CallOptions).GenerateAutonomousDatabaseWallet):len((*c.CallOptions).GenerateAutonomousDatabaseWallet)], opts...)
1655 var resp *oracledatabasepb.GenerateAutonomousDatabaseWalletResponse
1656 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1657 var err error
1658 resp, err = executeRPC(ctx, c.client.GenerateAutonomousDatabaseWallet, req, settings.GRPC, c.logger, "GenerateAutonomousDatabaseWallet")
1659 return err
1660 }, opts...)
1661 if err != nil {
1662 return nil, err
1663 }
1664 return resp, nil
1665 }
1666
1667 func (c *gRPCClient) ListAutonomousDbVersions(ctx context.Context, req *oracledatabasepb.ListAutonomousDbVersionsRequest, opts ...gax.CallOption) *AutonomousDbVersionIterator {
1668 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1669
1670 hds = append(c.xGoogHeaders, hds...)
1671 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1672 opts = append((*c.CallOptions).ListAutonomousDbVersions[0:len((*c.CallOptions).ListAutonomousDbVersions):len((*c.CallOptions).ListAutonomousDbVersions)], opts...)
1673 it := &AutonomousDbVersionIterator{}
1674 req = proto.Clone(req).(*oracledatabasepb.ListAutonomousDbVersionsRequest)
1675 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.AutonomousDbVersion, string, error) {
1676 resp := &oracledatabasepb.ListAutonomousDbVersionsResponse{}
1677 if pageToken != "" {
1678 req.PageToken = pageToken
1679 }
1680 if pageSize > math.MaxInt32 {
1681 req.PageSize = math.MaxInt32
1682 } else if pageSize != 0 {
1683 req.PageSize = int32(pageSize)
1684 }
1685 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1686 var err error
1687 resp, err = executeRPC(ctx, c.client.ListAutonomousDbVersions, req, settings.GRPC, c.logger, "ListAutonomousDbVersions")
1688 return err
1689 }, opts...)
1690 if err != nil {
1691 return nil, "", err
1692 }
1693
1694 it.Response = resp
1695 return resp.GetAutonomousDbVersions(), resp.GetNextPageToken(), nil
1696 }
1697 fetch := func(pageSize int, pageToken string) (string, error) {
1698 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1699 if err != nil {
1700 return "", err
1701 }
1702 it.items = append(it.items, items...)
1703 return nextPageToken, nil
1704 }
1705
1706 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1707 it.pageInfo.MaxSize = int(req.GetPageSize())
1708 it.pageInfo.Token = req.GetPageToken()
1709
1710 return it
1711 }
1712
1713 func (c *gRPCClient) ListAutonomousDatabaseCharacterSets(ctx context.Context, req *oracledatabasepb.ListAutonomousDatabaseCharacterSetsRequest, opts ...gax.CallOption) *AutonomousDatabaseCharacterSetIterator {
1714 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1715
1716 hds = append(c.xGoogHeaders, hds...)
1717 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1718 opts = append((*c.CallOptions).ListAutonomousDatabaseCharacterSets[0:len((*c.CallOptions).ListAutonomousDatabaseCharacterSets):len((*c.CallOptions).ListAutonomousDatabaseCharacterSets)], opts...)
1719 it := &AutonomousDatabaseCharacterSetIterator{}
1720 req = proto.Clone(req).(*oracledatabasepb.ListAutonomousDatabaseCharacterSetsRequest)
1721 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.AutonomousDatabaseCharacterSet, string, error) {
1722 resp := &oracledatabasepb.ListAutonomousDatabaseCharacterSetsResponse{}
1723 if pageToken != "" {
1724 req.PageToken = pageToken
1725 }
1726 if pageSize > math.MaxInt32 {
1727 req.PageSize = math.MaxInt32
1728 } else if pageSize != 0 {
1729 req.PageSize = int32(pageSize)
1730 }
1731 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1732 var err error
1733 resp, err = executeRPC(ctx, c.client.ListAutonomousDatabaseCharacterSets, req, settings.GRPC, c.logger, "ListAutonomousDatabaseCharacterSets")
1734 return err
1735 }, opts...)
1736 if err != nil {
1737 return nil, "", err
1738 }
1739
1740 it.Response = resp
1741 return resp.GetAutonomousDatabaseCharacterSets(), resp.GetNextPageToken(), nil
1742 }
1743 fetch := func(pageSize int, pageToken string) (string, error) {
1744 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1745 if err != nil {
1746 return "", err
1747 }
1748 it.items = append(it.items, items...)
1749 return nextPageToken, nil
1750 }
1751
1752 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1753 it.pageInfo.MaxSize = int(req.GetPageSize())
1754 it.pageInfo.Token = req.GetPageToken()
1755
1756 return it
1757 }
1758
1759 func (c *gRPCClient) ListAutonomousDatabaseBackups(ctx context.Context, req *oracledatabasepb.ListAutonomousDatabaseBackupsRequest, opts ...gax.CallOption) *AutonomousDatabaseBackupIterator {
1760 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1761
1762 hds = append(c.xGoogHeaders, hds...)
1763 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1764 opts = append((*c.CallOptions).ListAutonomousDatabaseBackups[0:len((*c.CallOptions).ListAutonomousDatabaseBackups):len((*c.CallOptions).ListAutonomousDatabaseBackups)], opts...)
1765 it := &AutonomousDatabaseBackupIterator{}
1766 req = proto.Clone(req).(*oracledatabasepb.ListAutonomousDatabaseBackupsRequest)
1767 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.AutonomousDatabaseBackup, string, error) {
1768 resp := &oracledatabasepb.ListAutonomousDatabaseBackupsResponse{}
1769 if pageToken != "" {
1770 req.PageToken = pageToken
1771 }
1772 if pageSize > math.MaxInt32 {
1773 req.PageSize = math.MaxInt32
1774 } else if pageSize != 0 {
1775 req.PageSize = int32(pageSize)
1776 }
1777 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1778 var err error
1779 resp, err = executeRPC(ctx, c.client.ListAutonomousDatabaseBackups, req, settings.GRPC, c.logger, "ListAutonomousDatabaseBackups")
1780 return err
1781 }, opts...)
1782 if err != nil {
1783 return nil, "", err
1784 }
1785
1786 it.Response = resp
1787 return resp.GetAutonomousDatabaseBackups(), resp.GetNextPageToken(), nil
1788 }
1789 fetch := func(pageSize int, pageToken string) (string, error) {
1790 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1791 if err != nil {
1792 return "", err
1793 }
1794 it.items = append(it.items, items...)
1795 return nextPageToken, nil
1796 }
1797
1798 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1799 it.pageInfo.MaxSize = int(req.GetPageSize())
1800 it.pageInfo.Token = req.GetPageToken()
1801
1802 return it
1803 }
1804
1805 func (c *gRPCClient) StopAutonomousDatabase(ctx context.Context, req *oracledatabasepb.StopAutonomousDatabaseRequest, opts ...gax.CallOption) (*StopAutonomousDatabaseOperation, error) {
1806 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1807
1808 hds = append(c.xGoogHeaders, hds...)
1809 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1810 opts = append((*c.CallOptions).StopAutonomousDatabase[0:len((*c.CallOptions).StopAutonomousDatabase):len((*c.CallOptions).StopAutonomousDatabase)], opts...)
1811 var resp *longrunningpb.Operation
1812 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1813 var err error
1814 resp, err = executeRPC(ctx, c.client.StopAutonomousDatabase, req, settings.GRPC, c.logger, "StopAutonomousDatabase")
1815 return err
1816 }, opts...)
1817 if err != nil {
1818 return nil, err
1819 }
1820 return &StopAutonomousDatabaseOperation{
1821 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1822 }, nil
1823 }
1824
1825 func (c *gRPCClient) StartAutonomousDatabase(ctx context.Context, req *oracledatabasepb.StartAutonomousDatabaseRequest, opts ...gax.CallOption) (*StartAutonomousDatabaseOperation, error) {
1826 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1827
1828 hds = append(c.xGoogHeaders, hds...)
1829 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1830 opts = append((*c.CallOptions).StartAutonomousDatabase[0:len((*c.CallOptions).StartAutonomousDatabase):len((*c.CallOptions).StartAutonomousDatabase)], opts...)
1831 var resp *longrunningpb.Operation
1832 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1833 var err error
1834 resp, err = executeRPC(ctx, c.client.StartAutonomousDatabase, req, settings.GRPC, c.logger, "StartAutonomousDatabase")
1835 return err
1836 }, opts...)
1837 if err != nil {
1838 return nil, err
1839 }
1840 return &StartAutonomousDatabaseOperation{
1841 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1842 }, nil
1843 }
1844
1845 func (c *gRPCClient) RestartAutonomousDatabase(ctx context.Context, req *oracledatabasepb.RestartAutonomousDatabaseRequest, opts ...gax.CallOption) (*RestartAutonomousDatabaseOperation, error) {
1846 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1847
1848 hds = append(c.xGoogHeaders, hds...)
1849 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1850 opts = append((*c.CallOptions).RestartAutonomousDatabase[0:len((*c.CallOptions).RestartAutonomousDatabase):len((*c.CallOptions).RestartAutonomousDatabase)], opts...)
1851 var resp *longrunningpb.Operation
1852 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1853 var err error
1854 resp, err = executeRPC(ctx, c.client.RestartAutonomousDatabase, req, settings.GRPC, c.logger, "RestartAutonomousDatabase")
1855 return err
1856 }, opts...)
1857 if err != nil {
1858 return nil, err
1859 }
1860 return &RestartAutonomousDatabaseOperation{
1861 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1862 }, nil
1863 }
1864
1865 func (c *gRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
1866 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1867
1868 hds = append(c.xGoogHeaders, hds...)
1869 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1870 opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...)
1871 var resp *locationpb.Location
1872 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1873 var err error
1874 resp, err = executeRPC(ctx, c.locationsClient.GetLocation, req, settings.GRPC, c.logger, "GetLocation")
1875 return err
1876 }, opts...)
1877 if err != nil {
1878 return nil, err
1879 }
1880 return resp, nil
1881 }
1882
1883 func (c *gRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
1884 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1885
1886 hds = append(c.xGoogHeaders, hds...)
1887 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1888 opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...)
1889 it := &LocationIterator{}
1890 req = proto.Clone(req).(*locationpb.ListLocationsRequest)
1891 it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) {
1892 resp := &locationpb.ListLocationsResponse{}
1893 if pageToken != "" {
1894 req.PageToken = pageToken
1895 }
1896 if pageSize > math.MaxInt32 {
1897 req.PageSize = math.MaxInt32
1898 } else if pageSize != 0 {
1899 req.PageSize = int32(pageSize)
1900 }
1901 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1902 var err error
1903 resp, err = executeRPC(ctx, c.locationsClient.ListLocations, req, settings.GRPC, c.logger, "ListLocations")
1904 return err
1905 }, opts...)
1906 if err != nil {
1907 return nil, "", err
1908 }
1909
1910 it.Response = resp
1911 return resp.GetLocations(), resp.GetNextPageToken(), nil
1912 }
1913 fetch := func(pageSize int, pageToken string) (string, error) {
1914 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1915 if err != nil {
1916 return "", err
1917 }
1918 it.items = append(it.items, items...)
1919 return nextPageToken, nil
1920 }
1921
1922 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1923 it.pageInfo.MaxSize = int(req.GetPageSize())
1924 it.pageInfo.Token = req.GetPageToken()
1925
1926 return it
1927 }
1928
1929 func (c *gRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
1930 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1931
1932 hds = append(c.xGoogHeaders, hds...)
1933 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1934 opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
1935 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1936 var err error
1937 _, err = executeRPC(ctx, c.operationsClient.CancelOperation, req, settings.GRPC, c.logger, "CancelOperation")
1938 return err
1939 }, opts...)
1940 return err
1941 }
1942
1943 func (c *gRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
1944 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1945
1946 hds = append(c.xGoogHeaders, hds...)
1947 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1948 opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...)
1949 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1950 var err error
1951 _, err = executeRPC(ctx, c.operationsClient.DeleteOperation, req, settings.GRPC, c.logger, "DeleteOperation")
1952 return err
1953 }, opts...)
1954 return err
1955 }
1956
1957 func (c *gRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
1958 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1959
1960 hds = append(c.xGoogHeaders, hds...)
1961 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1962 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
1963 var resp *longrunningpb.Operation
1964 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1965 var err error
1966 resp, err = executeRPC(ctx, c.operationsClient.GetOperation, req, settings.GRPC, c.logger, "GetOperation")
1967 return err
1968 }, opts...)
1969 if err != nil {
1970 return nil, err
1971 }
1972 return resp, nil
1973 }
1974
1975 func (c *gRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
1976 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1977
1978 hds = append(c.xGoogHeaders, hds...)
1979 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1980 opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
1981 it := &OperationIterator{}
1982 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
1983 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
1984 resp := &longrunningpb.ListOperationsResponse{}
1985 if pageToken != "" {
1986 req.PageToken = pageToken
1987 }
1988 if pageSize > math.MaxInt32 {
1989 req.PageSize = math.MaxInt32
1990 } else if pageSize != 0 {
1991 req.PageSize = int32(pageSize)
1992 }
1993 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1994 var err error
1995 resp, err = executeRPC(ctx, c.operationsClient.ListOperations, req, settings.GRPC, c.logger, "ListOperations")
1996 return err
1997 }, opts...)
1998 if err != nil {
1999 return nil, "", err
2000 }
2001
2002 it.Response = resp
2003 return resp.GetOperations(), resp.GetNextPageToken(), nil
2004 }
2005 fetch := func(pageSize int, pageToken string) (string, error) {
2006 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2007 if err != nil {
2008 return "", err
2009 }
2010 it.items = append(it.items, items...)
2011 return nextPageToken, nil
2012 }
2013
2014 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2015 it.pageInfo.MaxSize = int(req.GetPageSize())
2016 it.pageInfo.Token = req.GetPageToken()
2017
2018 return it
2019 }
2020
2021 // ListCloudExadataInfrastructures lists Exadata Infrastructures in a given project and location.
2022 func (c *restClient) ListCloudExadataInfrastructures(ctx context.Context, req *oracledatabasepb.ListCloudExadataInfrastructuresRequest, opts ...gax.CallOption) *CloudExadataInfrastructureIterator {
2023 it := &CloudExadataInfrastructureIterator{}
2024 req = proto.Clone(req).(*oracledatabasepb.ListCloudExadataInfrastructuresRequest)
2025 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2026 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.CloudExadataInfrastructure, string, error) {
2027 resp := &oracledatabasepb.ListCloudExadataInfrastructuresResponse{}
2028 if pageToken != "" {
2029 req.PageToken = pageToken
2030 }
2031 if pageSize > math.MaxInt32 {
2032 req.PageSize = math.MaxInt32
2033 } else if pageSize != 0 {
2034 req.PageSize = int32(pageSize)
2035 }
2036 baseUrl, err := url.Parse(c.endpoint)
2037 if err != nil {
2038 return nil, "", err
2039 }
2040 baseUrl.Path += fmt.Sprintf("/v1/%v/cloudExadataInfrastructures", req.GetParent())
2041
2042 params := url.Values{}
2043 params.Add("$alt", "json;enum-encoding=int")
2044 if req.GetPageSize() != 0 {
2045 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2046 }
2047 if req.GetPageToken() != "" {
2048 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2049 }
2050
2051 baseUrl.RawQuery = params.Encode()
2052
2053 // Build HTTP headers from client and context metadata.
2054 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2055 headers := gax.BuildHeaders(ctx, hds...)
2056 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2057 if settings.Path != "" {
2058 baseUrl.Path = settings.Path
2059 }
2060 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2061 if err != nil {
2062 return err
2063 }
2064 httpReq.Header = headers
2065
2066 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListCloudExadataInfrastructures")
2067 if err != nil {
2068 return err
2069 }
2070 if err := unm.Unmarshal(buf, resp); err != nil {
2071 return err
2072 }
2073
2074 return nil
2075 }, opts...)
2076 if e != nil {
2077 return nil, "", e
2078 }
2079 it.Response = resp
2080 return resp.GetCloudExadataInfrastructures(), resp.GetNextPageToken(), nil
2081 }
2082
2083 fetch := func(pageSize int, pageToken string) (string, error) {
2084 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2085 if err != nil {
2086 return "", err
2087 }
2088 it.items = append(it.items, items...)
2089 return nextPageToken, nil
2090 }
2091
2092 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2093 it.pageInfo.MaxSize = int(req.GetPageSize())
2094 it.pageInfo.Token = req.GetPageToken()
2095
2096 return it
2097 }
2098
2099 // GetCloudExadataInfrastructure gets details of a single Exadata Infrastructure.
2100 func (c *restClient) GetCloudExadataInfrastructure(ctx context.Context, req *oracledatabasepb.GetCloudExadataInfrastructureRequest, opts ...gax.CallOption) (*oracledatabasepb.CloudExadataInfrastructure, error) {
2101 baseUrl, err := url.Parse(c.endpoint)
2102 if err != nil {
2103 return nil, err
2104 }
2105 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
2106
2107 params := url.Values{}
2108 params.Add("$alt", "json;enum-encoding=int")
2109
2110 baseUrl.RawQuery = params.Encode()
2111
2112 // Build HTTP headers from client and context metadata.
2113 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2114
2115 hds = append(c.xGoogHeaders, hds...)
2116 hds = append(hds, "Content-Type", "application/json")
2117 headers := gax.BuildHeaders(ctx, hds...)
2118 opts = append((*c.CallOptions).GetCloudExadataInfrastructure[0:len((*c.CallOptions).GetCloudExadataInfrastructure):len((*c.CallOptions).GetCloudExadataInfrastructure)], opts...)
2119 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2120 resp := &oracledatabasepb.CloudExadataInfrastructure{}
2121 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2122 if settings.Path != "" {
2123 baseUrl.Path = settings.Path
2124 }
2125 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2126 if err != nil {
2127 return err
2128 }
2129 httpReq = httpReq.WithContext(ctx)
2130 httpReq.Header = headers
2131
2132 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetCloudExadataInfrastructure")
2133 if err != nil {
2134 return err
2135 }
2136
2137 if err := unm.Unmarshal(buf, resp); err != nil {
2138 return err
2139 }
2140
2141 return nil
2142 }, opts...)
2143 if e != nil {
2144 return nil, e
2145 }
2146 return resp, nil
2147 }
2148
2149 // CreateCloudExadataInfrastructure creates a new Exadata Infrastructure in a given project and location.
2150 func (c *restClient) CreateCloudExadataInfrastructure(ctx context.Context, req *oracledatabasepb.CreateCloudExadataInfrastructureRequest, opts ...gax.CallOption) (*CreateCloudExadataInfrastructureOperation, error) {
2151 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
2152 body := req.GetCloudExadataInfrastructure()
2153 jsonReq, err := m.Marshal(body)
2154 if err != nil {
2155 return nil, err
2156 }
2157
2158 baseUrl, err := url.Parse(c.endpoint)
2159 if err != nil {
2160 return nil, err
2161 }
2162 baseUrl.Path += fmt.Sprintf("/v1/%v/cloudExadataInfrastructures", req.GetParent())
2163
2164 params := url.Values{}
2165 params.Add("$alt", "json;enum-encoding=int")
2166 params.Add("cloudExadataInfrastructureId", fmt.Sprintf("%v", req.GetCloudExadataInfrastructureId()))
2167 if req.GetRequestId() != "" {
2168 params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
2169 }
2170
2171 baseUrl.RawQuery = params.Encode()
2172
2173 // Build HTTP headers from client and context metadata.
2174 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2175
2176 hds = append(c.xGoogHeaders, hds...)
2177 hds = append(hds, "Content-Type", "application/json")
2178 headers := gax.BuildHeaders(ctx, hds...)
2179 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2180 resp := &longrunningpb.Operation{}
2181 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2182 if settings.Path != "" {
2183 baseUrl.Path = settings.Path
2184 }
2185 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
2186 if err != nil {
2187 return err
2188 }
2189 httpReq = httpReq.WithContext(ctx)
2190 httpReq.Header = headers
2191
2192 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateCloudExadataInfrastructure")
2193 if err != nil {
2194 return err
2195 }
2196 if err := unm.Unmarshal(buf, resp); err != nil {
2197 return err
2198 }
2199
2200 return nil
2201 }, opts...)
2202 if e != nil {
2203 return nil, e
2204 }
2205
2206 override := fmt.Sprintf("/v1/%s", resp.GetName())
2207 return &CreateCloudExadataInfrastructureOperation{
2208 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2209 pollPath: override,
2210 }, nil
2211 }
2212
2213 // DeleteCloudExadataInfrastructure deletes a single Exadata Infrastructure.
2214 func (c *restClient) DeleteCloudExadataInfrastructure(ctx context.Context, req *oracledatabasepb.DeleteCloudExadataInfrastructureRequest, opts ...gax.CallOption) (*DeleteCloudExadataInfrastructureOperation, error) {
2215 baseUrl, err := url.Parse(c.endpoint)
2216 if err != nil {
2217 return nil, err
2218 }
2219 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
2220
2221 params := url.Values{}
2222 params.Add("$alt", "json;enum-encoding=int")
2223 if req.GetForce() {
2224 params.Add("force", fmt.Sprintf("%v", req.GetForce()))
2225 }
2226 if req.GetRequestId() != "" {
2227 params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
2228 }
2229
2230 baseUrl.RawQuery = params.Encode()
2231
2232 // Build HTTP headers from client and context metadata.
2233 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2234
2235 hds = append(c.xGoogHeaders, hds...)
2236 hds = append(hds, "Content-Type", "application/json")
2237 headers := gax.BuildHeaders(ctx, hds...)
2238 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2239 resp := &longrunningpb.Operation{}
2240 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2241 if settings.Path != "" {
2242 baseUrl.Path = settings.Path
2243 }
2244 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
2245 if err != nil {
2246 return err
2247 }
2248 httpReq = httpReq.WithContext(ctx)
2249 httpReq.Header = headers
2250
2251 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteCloudExadataInfrastructure")
2252 if err != nil {
2253 return err
2254 }
2255 if err := unm.Unmarshal(buf, resp); err != nil {
2256 return err
2257 }
2258
2259 return nil
2260 }, opts...)
2261 if e != nil {
2262 return nil, e
2263 }
2264
2265 override := fmt.Sprintf("/v1/%s", resp.GetName())
2266 return &DeleteCloudExadataInfrastructureOperation{
2267 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2268 pollPath: override,
2269 }, nil
2270 }
2271
2272 // ListCloudVmClusters lists the VM Clusters in a given project and location.
2273 func (c *restClient) ListCloudVmClusters(ctx context.Context, req *oracledatabasepb.ListCloudVmClustersRequest, opts ...gax.CallOption) *CloudVmClusterIterator {
2274 it := &CloudVmClusterIterator{}
2275 req = proto.Clone(req).(*oracledatabasepb.ListCloudVmClustersRequest)
2276 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2277 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.CloudVmCluster, string, error) {
2278 resp := &oracledatabasepb.ListCloudVmClustersResponse{}
2279 if pageToken != "" {
2280 req.PageToken = pageToken
2281 }
2282 if pageSize > math.MaxInt32 {
2283 req.PageSize = math.MaxInt32
2284 } else if pageSize != 0 {
2285 req.PageSize = int32(pageSize)
2286 }
2287 baseUrl, err := url.Parse(c.endpoint)
2288 if err != nil {
2289 return nil, "", err
2290 }
2291 baseUrl.Path += fmt.Sprintf("/v1/%v/cloudVmClusters", req.GetParent())
2292
2293 params := url.Values{}
2294 params.Add("$alt", "json;enum-encoding=int")
2295 if req.GetFilter() != "" {
2296 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
2297 }
2298 if req.GetPageSize() != 0 {
2299 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2300 }
2301 if req.GetPageToken() != "" {
2302 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2303 }
2304
2305 baseUrl.RawQuery = params.Encode()
2306
2307 // Build HTTP headers from client and context metadata.
2308 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2309 headers := gax.BuildHeaders(ctx, hds...)
2310 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2311 if settings.Path != "" {
2312 baseUrl.Path = settings.Path
2313 }
2314 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2315 if err != nil {
2316 return err
2317 }
2318 httpReq.Header = headers
2319
2320 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListCloudVmClusters")
2321 if err != nil {
2322 return err
2323 }
2324 if err := unm.Unmarshal(buf, resp); err != nil {
2325 return err
2326 }
2327
2328 return nil
2329 }, opts...)
2330 if e != nil {
2331 return nil, "", e
2332 }
2333 it.Response = resp
2334 return resp.GetCloudVmClusters(), resp.GetNextPageToken(), nil
2335 }
2336
2337 fetch := func(pageSize int, pageToken string) (string, error) {
2338 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2339 if err != nil {
2340 return "", err
2341 }
2342 it.items = append(it.items, items...)
2343 return nextPageToken, nil
2344 }
2345
2346 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2347 it.pageInfo.MaxSize = int(req.GetPageSize())
2348 it.pageInfo.Token = req.GetPageToken()
2349
2350 return it
2351 }
2352
2353 // GetCloudVmCluster gets details of a single VM Cluster.
2354 func (c *restClient) GetCloudVmCluster(ctx context.Context, req *oracledatabasepb.GetCloudVmClusterRequest, opts ...gax.CallOption) (*oracledatabasepb.CloudVmCluster, error) {
2355 baseUrl, err := url.Parse(c.endpoint)
2356 if err != nil {
2357 return nil, err
2358 }
2359 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
2360
2361 params := url.Values{}
2362 params.Add("$alt", "json;enum-encoding=int")
2363
2364 baseUrl.RawQuery = params.Encode()
2365
2366 // Build HTTP headers from client and context metadata.
2367 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2368
2369 hds = append(c.xGoogHeaders, hds...)
2370 hds = append(hds, "Content-Type", "application/json")
2371 headers := gax.BuildHeaders(ctx, hds...)
2372 opts = append((*c.CallOptions).GetCloudVmCluster[0:len((*c.CallOptions).GetCloudVmCluster):len((*c.CallOptions).GetCloudVmCluster)], opts...)
2373 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2374 resp := &oracledatabasepb.CloudVmCluster{}
2375 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2376 if settings.Path != "" {
2377 baseUrl.Path = settings.Path
2378 }
2379 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2380 if err != nil {
2381 return err
2382 }
2383 httpReq = httpReq.WithContext(ctx)
2384 httpReq.Header = headers
2385
2386 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetCloudVmCluster")
2387 if err != nil {
2388 return err
2389 }
2390
2391 if err := unm.Unmarshal(buf, resp); err != nil {
2392 return err
2393 }
2394
2395 return nil
2396 }, opts...)
2397 if e != nil {
2398 return nil, e
2399 }
2400 return resp, nil
2401 }
2402
2403 // CreateCloudVmCluster creates a new VM Cluster in a given project and location.
2404 func (c *restClient) CreateCloudVmCluster(ctx context.Context, req *oracledatabasepb.CreateCloudVmClusterRequest, opts ...gax.CallOption) (*CreateCloudVmClusterOperation, error) {
2405 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
2406 body := req.GetCloudVmCluster()
2407 jsonReq, err := m.Marshal(body)
2408 if err != nil {
2409 return nil, err
2410 }
2411
2412 baseUrl, err := url.Parse(c.endpoint)
2413 if err != nil {
2414 return nil, err
2415 }
2416 baseUrl.Path += fmt.Sprintf("/v1/%v/cloudVmClusters", req.GetParent())
2417
2418 params := url.Values{}
2419 params.Add("$alt", "json;enum-encoding=int")
2420 params.Add("cloudVmClusterId", fmt.Sprintf("%v", req.GetCloudVmClusterId()))
2421 if req.GetRequestId() != "" {
2422 params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
2423 }
2424
2425 baseUrl.RawQuery = params.Encode()
2426
2427 // Build HTTP headers from client and context metadata.
2428 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
2429
2430 hds = append(c.xGoogHeaders, hds...)
2431 hds = append(hds, "Content-Type", "application/json")
2432 headers := gax.BuildHeaders(ctx, hds...)
2433 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2434 resp := &longrunningpb.Operation{}
2435 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2436 if settings.Path != "" {
2437 baseUrl.Path = settings.Path
2438 }
2439 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
2440 if err != nil {
2441 return err
2442 }
2443 httpReq = httpReq.WithContext(ctx)
2444 httpReq.Header = headers
2445
2446 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateCloudVmCluster")
2447 if err != nil {
2448 return err
2449 }
2450 if err := unm.Unmarshal(buf, resp); err != nil {
2451 return err
2452 }
2453
2454 return nil
2455 }, opts...)
2456 if e != nil {
2457 return nil, e
2458 }
2459
2460 override := fmt.Sprintf("/v1/%s", resp.GetName())
2461 return &CreateCloudVmClusterOperation{
2462 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2463 pollPath: override,
2464 }, nil
2465 }
2466
2467 // DeleteCloudVmCluster deletes a single VM Cluster.
2468 func (c *restClient) DeleteCloudVmCluster(ctx context.Context, req *oracledatabasepb.DeleteCloudVmClusterRequest, opts ...gax.CallOption) (*DeleteCloudVmClusterOperation, error) {
2469 baseUrl, err := url.Parse(c.endpoint)
2470 if err != nil {
2471 return nil, err
2472 }
2473 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
2474
2475 params := url.Values{}
2476 params.Add("$alt", "json;enum-encoding=int")
2477 if req.GetForce() {
2478 params.Add("force", fmt.Sprintf("%v", req.GetForce()))
2479 }
2480 if req.GetRequestId() != "" {
2481 params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
2482 }
2483
2484 baseUrl.RawQuery = params.Encode()
2485
2486 // Build HTTP headers from client and context metadata.
2487 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2488
2489 hds = append(c.xGoogHeaders, hds...)
2490 hds = append(hds, "Content-Type", "application/json")
2491 headers := gax.BuildHeaders(ctx, hds...)
2492 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2493 resp := &longrunningpb.Operation{}
2494 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2495 if settings.Path != "" {
2496 baseUrl.Path = settings.Path
2497 }
2498 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
2499 if err != nil {
2500 return err
2501 }
2502 httpReq = httpReq.WithContext(ctx)
2503 httpReq.Header = headers
2504
2505 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteCloudVmCluster")
2506 if err != nil {
2507 return err
2508 }
2509 if err := unm.Unmarshal(buf, resp); err != nil {
2510 return err
2511 }
2512
2513 return nil
2514 }, opts...)
2515 if e != nil {
2516 return nil, e
2517 }
2518
2519 override := fmt.Sprintf("/v1/%s", resp.GetName())
2520 return &DeleteCloudVmClusterOperation{
2521 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
2522 pollPath: override,
2523 }, nil
2524 }
2525
2526 // ListEntitlements lists the entitlements in a given project.
2527 func (c *restClient) ListEntitlements(ctx context.Context, req *oracledatabasepb.ListEntitlementsRequest, opts ...gax.CallOption) *EntitlementIterator {
2528 it := &EntitlementIterator{}
2529 req = proto.Clone(req).(*oracledatabasepb.ListEntitlementsRequest)
2530 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2531 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.Entitlement, string, error) {
2532 resp := &oracledatabasepb.ListEntitlementsResponse{}
2533 if pageToken != "" {
2534 req.PageToken = pageToken
2535 }
2536 if pageSize > math.MaxInt32 {
2537 req.PageSize = math.MaxInt32
2538 } else if pageSize != 0 {
2539 req.PageSize = int32(pageSize)
2540 }
2541 baseUrl, err := url.Parse(c.endpoint)
2542 if err != nil {
2543 return nil, "", err
2544 }
2545 baseUrl.Path += fmt.Sprintf("/v1/%v/entitlements", req.GetParent())
2546
2547 params := url.Values{}
2548 params.Add("$alt", "json;enum-encoding=int")
2549 if req.GetPageSize() != 0 {
2550 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2551 }
2552 if req.GetPageToken() != "" {
2553 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2554 }
2555
2556 baseUrl.RawQuery = params.Encode()
2557
2558 // Build HTTP headers from client and context metadata.
2559 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2560 headers := gax.BuildHeaders(ctx, hds...)
2561 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2562 if settings.Path != "" {
2563 baseUrl.Path = settings.Path
2564 }
2565 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2566 if err != nil {
2567 return err
2568 }
2569 httpReq.Header = headers
2570
2571 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListEntitlements")
2572 if err != nil {
2573 return err
2574 }
2575 if err := unm.Unmarshal(buf, resp); err != nil {
2576 return err
2577 }
2578
2579 return nil
2580 }, opts...)
2581 if e != nil {
2582 return nil, "", e
2583 }
2584 it.Response = resp
2585 return resp.GetEntitlements(), resp.GetNextPageToken(), nil
2586 }
2587
2588 fetch := func(pageSize int, pageToken string) (string, error) {
2589 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2590 if err != nil {
2591 return "", err
2592 }
2593 it.items = append(it.items, items...)
2594 return nextPageToken, nil
2595 }
2596
2597 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2598 it.pageInfo.MaxSize = int(req.GetPageSize())
2599 it.pageInfo.Token = req.GetPageToken()
2600
2601 return it
2602 }
2603
2604 // ListDbServers lists the database servers of an Exadata Infrastructure instance.
2605 func (c *restClient) ListDbServers(ctx context.Context, req *oracledatabasepb.ListDbServersRequest, opts ...gax.CallOption) *DbServerIterator {
2606 it := &DbServerIterator{}
2607 req = proto.Clone(req).(*oracledatabasepb.ListDbServersRequest)
2608 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2609 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.DbServer, string, error) {
2610 resp := &oracledatabasepb.ListDbServersResponse{}
2611 if pageToken != "" {
2612 req.PageToken = pageToken
2613 }
2614 if pageSize > math.MaxInt32 {
2615 req.PageSize = math.MaxInt32
2616 } else if pageSize != 0 {
2617 req.PageSize = int32(pageSize)
2618 }
2619 baseUrl, err := url.Parse(c.endpoint)
2620 if err != nil {
2621 return nil, "", err
2622 }
2623 baseUrl.Path += fmt.Sprintf("/v1/%v/dbServers", req.GetParent())
2624
2625 params := url.Values{}
2626 params.Add("$alt", "json;enum-encoding=int")
2627 if req.GetPageSize() != 0 {
2628 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2629 }
2630 if req.GetPageToken() != "" {
2631 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2632 }
2633
2634 baseUrl.RawQuery = params.Encode()
2635
2636 // Build HTTP headers from client and context metadata.
2637 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2638 headers := gax.BuildHeaders(ctx, hds...)
2639 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2640 if settings.Path != "" {
2641 baseUrl.Path = settings.Path
2642 }
2643 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2644 if err != nil {
2645 return err
2646 }
2647 httpReq.Header = headers
2648
2649 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListDbServers")
2650 if err != nil {
2651 return err
2652 }
2653 if err := unm.Unmarshal(buf, resp); err != nil {
2654 return err
2655 }
2656
2657 return nil
2658 }, opts...)
2659 if e != nil {
2660 return nil, "", e
2661 }
2662 it.Response = resp
2663 return resp.GetDbServers(), resp.GetNextPageToken(), nil
2664 }
2665
2666 fetch := func(pageSize int, pageToken string) (string, error) {
2667 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2668 if err != nil {
2669 return "", err
2670 }
2671 it.items = append(it.items, items...)
2672 return nextPageToken, nil
2673 }
2674
2675 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2676 it.pageInfo.MaxSize = int(req.GetPageSize())
2677 it.pageInfo.Token = req.GetPageToken()
2678
2679 return it
2680 }
2681
2682 // ListDbNodes lists the database nodes of a VM Cluster.
2683 func (c *restClient) ListDbNodes(ctx context.Context, req *oracledatabasepb.ListDbNodesRequest, opts ...gax.CallOption) *DbNodeIterator {
2684 it := &DbNodeIterator{}
2685 req = proto.Clone(req).(*oracledatabasepb.ListDbNodesRequest)
2686 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2687 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.DbNode, string, error) {
2688 resp := &oracledatabasepb.ListDbNodesResponse{}
2689 if pageToken != "" {
2690 req.PageToken = pageToken
2691 }
2692 if pageSize > math.MaxInt32 {
2693 req.PageSize = math.MaxInt32
2694 } else if pageSize != 0 {
2695 req.PageSize = int32(pageSize)
2696 }
2697 baseUrl, err := url.Parse(c.endpoint)
2698 if err != nil {
2699 return nil, "", err
2700 }
2701 baseUrl.Path += fmt.Sprintf("/v1/%v/dbNodes", req.GetParent())
2702
2703 params := url.Values{}
2704 params.Add("$alt", "json;enum-encoding=int")
2705 if req.GetPageSize() != 0 {
2706 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2707 }
2708 if req.GetPageToken() != "" {
2709 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2710 }
2711
2712 baseUrl.RawQuery = params.Encode()
2713
2714 // Build HTTP headers from client and context metadata.
2715 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2716 headers := gax.BuildHeaders(ctx, hds...)
2717 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2718 if settings.Path != "" {
2719 baseUrl.Path = settings.Path
2720 }
2721 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2722 if err != nil {
2723 return err
2724 }
2725 httpReq.Header = headers
2726
2727 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListDbNodes")
2728 if err != nil {
2729 return err
2730 }
2731 if err := unm.Unmarshal(buf, resp); err != nil {
2732 return err
2733 }
2734
2735 return nil
2736 }, opts...)
2737 if e != nil {
2738 return nil, "", e
2739 }
2740 it.Response = resp
2741 return resp.GetDbNodes(), resp.GetNextPageToken(), nil
2742 }
2743
2744 fetch := func(pageSize int, pageToken string) (string, error) {
2745 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2746 if err != nil {
2747 return "", err
2748 }
2749 it.items = append(it.items, items...)
2750 return nextPageToken, nil
2751 }
2752
2753 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2754 it.pageInfo.MaxSize = int(req.GetPageSize())
2755 it.pageInfo.Token = req.GetPageToken()
2756
2757 return it
2758 }
2759
2760 // ListGiVersions lists all the valid Oracle Grid Infrastructure (GI) versions for the given
2761 // project and location.
2762 func (c *restClient) ListGiVersions(ctx context.Context, req *oracledatabasepb.ListGiVersionsRequest, opts ...gax.CallOption) *GiVersionIterator {
2763 it := &GiVersionIterator{}
2764 req = proto.Clone(req).(*oracledatabasepb.ListGiVersionsRequest)
2765 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2766 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.GiVersion, string, error) {
2767 resp := &oracledatabasepb.ListGiVersionsResponse{}
2768 if pageToken != "" {
2769 req.PageToken = pageToken
2770 }
2771 if pageSize > math.MaxInt32 {
2772 req.PageSize = math.MaxInt32
2773 } else if pageSize != 0 {
2774 req.PageSize = int32(pageSize)
2775 }
2776 baseUrl, err := url.Parse(c.endpoint)
2777 if err != nil {
2778 return nil, "", err
2779 }
2780 baseUrl.Path += fmt.Sprintf("/v1/%v/giVersions", req.GetParent())
2781
2782 params := url.Values{}
2783 params.Add("$alt", "json;enum-encoding=int")
2784 if req.GetPageSize() != 0 {
2785 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2786 }
2787 if req.GetPageToken() != "" {
2788 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2789 }
2790
2791 baseUrl.RawQuery = params.Encode()
2792
2793 // Build HTTP headers from client and context metadata.
2794 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2795 headers := gax.BuildHeaders(ctx, hds...)
2796 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2797 if settings.Path != "" {
2798 baseUrl.Path = settings.Path
2799 }
2800 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2801 if err != nil {
2802 return err
2803 }
2804 httpReq.Header = headers
2805
2806 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListGiVersions")
2807 if err != nil {
2808 return err
2809 }
2810 if err := unm.Unmarshal(buf, resp); err != nil {
2811 return err
2812 }
2813
2814 return nil
2815 }, opts...)
2816 if e != nil {
2817 return nil, "", e
2818 }
2819 it.Response = resp
2820 return resp.GetGiVersions(), resp.GetNextPageToken(), nil
2821 }
2822
2823 fetch := func(pageSize int, pageToken string) (string, error) {
2824 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2825 if err != nil {
2826 return "", err
2827 }
2828 it.items = append(it.items, items...)
2829 return nextPageToken, nil
2830 }
2831
2832 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2833 it.pageInfo.MaxSize = int(req.GetPageSize())
2834 it.pageInfo.Token = req.GetPageToken()
2835
2836 return it
2837 }
2838
2839 // ListDbSystemShapes lists the database system shapes available for the project and location.
2840 func (c *restClient) ListDbSystemShapes(ctx context.Context, req *oracledatabasepb.ListDbSystemShapesRequest, opts ...gax.CallOption) *DbSystemShapeIterator {
2841 it := &DbSystemShapeIterator{}
2842 req = proto.Clone(req).(*oracledatabasepb.ListDbSystemShapesRequest)
2843 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2844 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.DbSystemShape, string, error) {
2845 resp := &oracledatabasepb.ListDbSystemShapesResponse{}
2846 if pageToken != "" {
2847 req.PageToken = pageToken
2848 }
2849 if pageSize > math.MaxInt32 {
2850 req.PageSize = math.MaxInt32
2851 } else if pageSize != 0 {
2852 req.PageSize = int32(pageSize)
2853 }
2854 baseUrl, err := url.Parse(c.endpoint)
2855 if err != nil {
2856 return nil, "", err
2857 }
2858 baseUrl.Path += fmt.Sprintf("/v1/%v/dbSystemShapes", req.GetParent())
2859
2860 params := url.Values{}
2861 params.Add("$alt", "json;enum-encoding=int")
2862 if req.GetPageSize() != 0 {
2863 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2864 }
2865 if req.GetPageToken() != "" {
2866 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2867 }
2868
2869 baseUrl.RawQuery = params.Encode()
2870
2871 // Build HTTP headers from client and context metadata.
2872 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2873 headers := gax.BuildHeaders(ctx, hds...)
2874 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2875 if settings.Path != "" {
2876 baseUrl.Path = settings.Path
2877 }
2878 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2879 if err != nil {
2880 return err
2881 }
2882 httpReq.Header = headers
2883
2884 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListDbSystemShapes")
2885 if err != nil {
2886 return err
2887 }
2888 if err := unm.Unmarshal(buf, resp); err != nil {
2889 return err
2890 }
2891
2892 return nil
2893 }, opts...)
2894 if e != nil {
2895 return nil, "", e
2896 }
2897 it.Response = resp
2898 return resp.GetDbSystemShapes(), resp.GetNextPageToken(), nil
2899 }
2900
2901 fetch := func(pageSize int, pageToken string) (string, error) {
2902 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2903 if err != nil {
2904 return "", err
2905 }
2906 it.items = append(it.items, items...)
2907 return nextPageToken, nil
2908 }
2909
2910 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2911 it.pageInfo.MaxSize = int(req.GetPageSize())
2912 it.pageInfo.Token = req.GetPageToken()
2913
2914 return it
2915 }
2916
2917 // ListAutonomousDatabases lists the Autonomous Databases in a given project and location.
2918 func (c *restClient) ListAutonomousDatabases(ctx context.Context, req *oracledatabasepb.ListAutonomousDatabasesRequest, opts ...gax.CallOption) *AutonomousDatabaseIterator {
2919 it := &AutonomousDatabaseIterator{}
2920 req = proto.Clone(req).(*oracledatabasepb.ListAutonomousDatabasesRequest)
2921 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
2922 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.AutonomousDatabase, string, error) {
2923 resp := &oracledatabasepb.ListAutonomousDatabasesResponse{}
2924 if pageToken != "" {
2925 req.PageToken = pageToken
2926 }
2927 if pageSize > math.MaxInt32 {
2928 req.PageSize = math.MaxInt32
2929 } else if pageSize != 0 {
2930 req.PageSize = int32(pageSize)
2931 }
2932 baseUrl, err := url.Parse(c.endpoint)
2933 if err != nil {
2934 return nil, "", err
2935 }
2936 baseUrl.Path += fmt.Sprintf("/v1/%v/autonomousDatabases", req.GetParent())
2937
2938 params := url.Values{}
2939 params.Add("$alt", "json;enum-encoding=int")
2940 if req.GetFilter() != "" {
2941 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
2942 }
2943 if req.GetOrderBy() != "" {
2944 params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
2945 }
2946 if req.GetPageSize() != 0 {
2947 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
2948 }
2949 if req.GetPageToken() != "" {
2950 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
2951 }
2952
2953 baseUrl.RawQuery = params.Encode()
2954
2955 // Build HTTP headers from client and context metadata.
2956 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
2957 headers := gax.BuildHeaders(ctx, hds...)
2958 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2959 if settings.Path != "" {
2960 baseUrl.Path = settings.Path
2961 }
2962 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
2963 if err != nil {
2964 return err
2965 }
2966 httpReq.Header = headers
2967
2968 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAutonomousDatabases")
2969 if err != nil {
2970 return err
2971 }
2972 if err := unm.Unmarshal(buf, resp); err != nil {
2973 return err
2974 }
2975
2976 return nil
2977 }, opts...)
2978 if e != nil {
2979 return nil, "", e
2980 }
2981 it.Response = resp
2982 return resp.GetAutonomousDatabases(), resp.GetNextPageToken(), nil
2983 }
2984
2985 fetch := func(pageSize int, pageToken string) (string, error) {
2986 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2987 if err != nil {
2988 return "", err
2989 }
2990 it.items = append(it.items, items...)
2991 return nextPageToken, nil
2992 }
2993
2994 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2995 it.pageInfo.MaxSize = int(req.GetPageSize())
2996 it.pageInfo.Token = req.GetPageToken()
2997
2998 return it
2999 }
3000
3001 // GetAutonomousDatabase gets the details of a single Autonomous Database.
3002 func (c *restClient) GetAutonomousDatabase(ctx context.Context, req *oracledatabasepb.GetAutonomousDatabaseRequest, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
3003 baseUrl, err := url.Parse(c.endpoint)
3004 if err != nil {
3005 return nil, err
3006 }
3007 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3008
3009 params := url.Values{}
3010 params.Add("$alt", "json;enum-encoding=int")
3011
3012 baseUrl.RawQuery = params.Encode()
3013
3014 // Build HTTP headers from client and context metadata.
3015 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3016
3017 hds = append(c.xGoogHeaders, hds...)
3018 hds = append(hds, "Content-Type", "application/json")
3019 headers := gax.BuildHeaders(ctx, hds...)
3020 opts = append((*c.CallOptions).GetAutonomousDatabase[0:len((*c.CallOptions).GetAutonomousDatabase):len((*c.CallOptions).GetAutonomousDatabase)], opts...)
3021 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3022 resp := &oracledatabasepb.AutonomousDatabase{}
3023 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3024 if settings.Path != "" {
3025 baseUrl.Path = settings.Path
3026 }
3027 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3028 if err != nil {
3029 return err
3030 }
3031 httpReq = httpReq.WithContext(ctx)
3032 httpReq.Header = headers
3033
3034 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetAutonomousDatabase")
3035 if err != nil {
3036 return err
3037 }
3038
3039 if err := unm.Unmarshal(buf, resp); err != nil {
3040 return err
3041 }
3042
3043 return nil
3044 }, opts...)
3045 if e != nil {
3046 return nil, e
3047 }
3048 return resp, nil
3049 }
3050
3051 // CreateAutonomousDatabase creates a new Autonomous Database in a given project and location.
3052 func (c *restClient) CreateAutonomousDatabase(ctx context.Context, req *oracledatabasepb.CreateAutonomousDatabaseRequest, opts ...gax.CallOption) (*CreateAutonomousDatabaseOperation, error) {
3053 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3054 body := req.GetAutonomousDatabase()
3055 jsonReq, err := m.Marshal(body)
3056 if err != nil {
3057 return nil, err
3058 }
3059
3060 baseUrl, err := url.Parse(c.endpoint)
3061 if err != nil {
3062 return nil, err
3063 }
3064 baseUrl.Path += fmt.Sprintf("/v1/%v/autonomousDatabases", req.GetParent())
3065
3066 params := url.Values{}
3067 params.Add("$alt", "json;enum-encoding=int")
3068 params.Add("autonomousDatabaseId", fmt.Sprintf("%v", req.GetAutonomousDatabaseId()))
3069 if req.GetRequestId() != "" {
3070 params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
3071 }
3072
3073 baseUrl.RawQuery = params.Encode()
3074
3075 // Build HTTP headers from client and context metadata.
3076 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
3077
3078 hds = append(c.xGoogHeaders, hds...)
3079 hds = append(hds, "Content-Type", "application/json")
3080 headers := gax.BuildHeaders(ctx, hds...)
3081 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3082 resp := &longrunningpb.Operation{}
3083 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3084 if settings.Path != "" {
3085 baseUrl.Path = settings.Path
3086 }
3087 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3088 if err != nil {
3089 return err
3090 }
3091 httpReq = httpReq.WithContext(ctx)
3092 httpReq.Header = headers
3093
3094 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateAutonomousDatabase")
3095 if err != nil {
3096 return err
3097 }
3098 if err := unm.Unmarshal(buf, resp); err != nil {
3099 return err
3100 }
3101
3102 return nil
3103 }, opts...)
3104 if e != nil {
3105 return nil, e
3106 }
3107
3108 override := fmt.Sprintf("/v1/%s", resp.GetName())
3109 return &CreateAutonomousDatabaseOperation{
3110 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3111 pollPath: override,
3112 }, nil
3113 }
3114
3115 // DeleteAutonomousDatabase deletes a single Autonomous Database.
3116 func (c *restClient) DeleteAutonomousDatabase(ctx context.Context, req *oracledatabasepb.DeleteAutonomousDatabaseRequest, opts ...gax.CallOption) (*DeleteAutonomousDatabaseOperation, error) {
3117 baseUrl, err := url.Parse(c.endpoint)
3118 if err != nil {
3119 return nil, err
3120 }
3121 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3122
3123 params := url.Values{}
3124 params.Add("$alt", "json;enum-encoding=int")
3125 if req.GetRequestId() != "" {
3126 params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
3127 }
3128
3129 baseUrl.RawQuery = params.Encode()
3130
3131 // Build HTTP headers from client and context metadata.
3132 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3133
3134 hds = append(c.xGoogHeaders, hds...)
3135 hds = append(hds, "Content-Type", "application/json")
3136 headers := gax.BuildHeaders(ctx, hds...)
3137 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3138 resp := &longrunningpb.Operation{}
3139 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3140 if settings.Path != "" {
3141 baseUrl.Path = settings.Path
3142 }
3143 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
3144 if err != nil {
3145 return err
3146 }
3147 httpReq = httpReq.WithContext(ctx)
3148 httpReq.Header = headers
3149
3150 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteAutonomousDatabase")
3151 if err != nil {
3152 return err
3153 }
3154 if err := unm.Unmarshal(buf, resp); err != nil {
3155 return err
3156 }
3157
3158 return nil
3159 }, opts...)
3160 if e != nil {
3161 return nil, e
3162 }
3163
3164 override := fmt.Sprintf("/v1/%s", resp.GetName())
3165 return &DeleteAutonomousDatabaseOperation{
3166 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3167 pollPath: override,
3168 }, nil
3169 }
3170
3171 // RestoreAutonomousDatabase restores a single Autonomous Database.
3172 func (c *restClient) RestoreAutonomousDatabase(ctx context.Context, req *oracledatabasepb.RestoreAutonomousDatabaseRequest, opts ...gax.CallOption) (*RestoreAutonomousDatabaseOperation, error) {
3173 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3174 jsonReq, err := m.Marshal(req)
3175 if err != nil {
3176 return nil, err
3177 }
3178
3179 baseUrl, err := url.Parse(c.endpoint)
3180 if err != nil {
3181 return nil, err
3182 }
3183 baseUrl.Path += fmt.Sprintf("/v1/%v:restore", req.GetName())
3184
3185 params := url.Values{}
3186 params.Add("$alt", "json;enum-encoding=int")
3187
3188 baseUrl.RawQuery = params.Encode()
3189
3190 // Build HTTP headers from client and context metadata.
3191 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3192
3193 hds = append(c.xGoogHeaders, hds...)
3194 hds = append(hds, "Content-Type", "application/json")
3195 headers := gax.BuildHeaders(ctx, hds...)
3196 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3197 resp := &longrunningpb.Operation{}
3198 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3199 if settings.Path != "" {
3200 baseUrl.Path = settings.Path
3201 }
3202 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3203 if err != nil {
3204 return err
3205 }
3206 httpReq = httpReq.WithContext(ctx)
3207 httpReq.Header = headers
3208
3209 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "RestoreAutonomousDatabase")
3210 if err != nil {
3211 return err
3212 }
3213 if err := unm.Unmarshal(buf, resp); err != nil {
3214 return err
3215 }
3216
3217 return nil
3218 }, opts...)
3219 if e != nil {
3220 return nil, e
3221 }
3222
3223 override := fmt.Sprintf("/v1/%s", resp.GetName())
3224 return &RestoreAutonomousDatabaseOperation{
3225 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3226 pollPath: override,
3227 }, nil
3228 }
3229
3230 // GenerateAutonomousDatabaseWallet generates a wallet for an Autonomous Database.
3231 func (c *restClient) GenerateAutonomousDatabaseWallet(ctx context.Context, req *oracledatabasepb.GenerateAutonomousDatabaseWalletRequest, opts ...gax.CallOption) (*oracledatabasepb.GenerateAutonomousDatabaseWalletResponse, error) {
3232 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3233 jsonReq, err := m.Marshal(req)
3234 if err != nil {
3235 return nil, err
3236 }
3237
3238 baseUrl, err := url.Parse(c.endpoint)
3239 if err != nil {
3240 return nil, err
3241 }
3242 baseUrl.Path += fmt.Sprintf("/v1/%v:generateWallet", req.GetName())
3243
3244 params := url.Values{}
3245 params.Add("$alt", "json;enum-encoding=int")
3246
3247 baseUrl.RawQuery = params.Encode()
3248
3249 // Build HTTP headers from client and context metadata.
3250 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3251
3252 hds = append(c.xGoogHeaders, hds...)
3253 hds = append(hds, "Content-Type", "application/json")
3254 headers := gax.BuildHeaders(ctx, hds...)
3255 opts = append((*c.CallOptions).GenerateAutonomousDatabaseWallet[0:len((*c.CallOptions).GenerateAutonomousDatabaseWallet):len((*c.CallOptions).GenerateAutonomousDatabaseWallet)], opts...)
3256 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3257 resp := &oracledatabasepb.GenerateAutonomousDatabaseWalletResponse{}
3258 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3259 if settings.Path != "" {
3260 baseUrl.Path = settings.Path
3261 }
3262 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3263 if err != nil {
3264 return err
3265 }
3266 httpReq = httpReq.WithContext(ctx)
3267 httpReq.Header = headers
3268
3269 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "GenerateAutonomousDatabaseWallet")
3270 if err != nil {
3271 return err
3272 }
3273
3274 if err := unm.Unmarshal(buf, resp); err != nil {
3275 return err
3276 }
3277
3278 return nil
3279 }, opts...)
3280 if e != nil {
3281 return nil, e
3282 }
3283 return resp, nil
3284 }
3285
3286 // ListAutonomousDbVersions lists all the available Autonomous Database versions for a project and
3287 // location.
3288 func (c *restClient) ListAutonomousDbVersions(ctx context.Context, req *oracledatabasepb.ListAutonomousDbVersionsRequest, opts ...gax.CallOption) *AutonomousDbVersionIterator {
3289 it := &AutonomousDbVersionIterator{}
3290 req = proto.Clone(req).(*oracledatabasepb.ListAutonomousDbVersionsRequest)
3291 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3292 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.AutonomousDbVersion, string, error) {
3293 resp := &oracledatabasepb.ListAutonomousDbVersionsResponse{}
3294 if pageToken != "" {
3295 req.PageToken = pageToken
3296 }
3297 if pageSize > math.MaxInt32 {
3298 req.PageSize = math.MaxInt32
3299 } else if pageSize != 0 {
3300 req.PageSize = int32(pageSize)
3301 }
3302 baseUrl, err := url.Parse(c.endpoint)
3303 if err != nil {
3304 return nil, "", err
3305 }
3306 baseUrl.Path += fmt.Sprintf("/v1/%v/autonomousDbVersions", req.GetParent())
3307
3308 params := url.Values{}
3309 params.Add("$alt", "json;enum-encoding=int")
3310 if req.GetPageSize() != 0 {
3311 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3312 }
3313 if req.GetPageToken() != "" {
3314 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3315 }
3316
3317 baseUrl.RawQuery = params.Encode()
3318
3319 // Build HTTP headers from client and context metadata.
3320 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3321 headers := gax.BuildHeaders(ctx, hds...)
3322 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3323 if settings.Path != "" {
3324 baseUrl.Path = settings.Path
3325 }
3326 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3327 if err != nil {
3328 return err
3329 }
3330 httpReq.Header = headers
3331
3332 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAutonomousDbVersions")
3333 if err != nil {
3334 return err
3335 }
3336 if err := unm.Unmarshal(buf, resp); err != nil {
3337 return err
3338 }
3339
3340 return nil
3341 }, opts...)
3342 if e != nil {
3343 return nil, "", e
3344 }
3345 it.Response = resp
3346 return resp.GetAutonomousDbVersions(), resp.GetNextPageToken(), nil
3347 }
3348
3349 fetch := func(pageSize int, pageToken string) (string, error) {
3350 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3351 if err != nil {
3352 return "", err
3353 }
3354 it.items = append(it.items, items...)
3355 return nextPageToken, nil
3356 }
3357
3358 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3359 it.pageInfo.MaxSize = int(req.GetPageSize())
3360 it.pageInfo.Token = req.GetPageToken()
3361
3362 return it
3363 }
3364
3365 // ListAutonomousDatabaseCharacterSets lists Autonomous Database Character Sets in a given project and location.
3366 func (c *restClient) ListAutonomousDatabaseCharacterSets(ctx context.Context, req *oracledatabasepb.ListAutonomousDatabaseCharacterSetsRequest, opts ...gax.CallOption) *AutonomousDatabaseCharacterSetIterator {
3367 it := &AutonomousDatabaseCharacterSetIterator{}
3368 req = proto.Clone(req).(*oracledatabasepb.ListAutonomousDatabaseCharacterSetsRequest)
3369 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3370 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.AutonomousDatabaseCharacterSet, string, error) {
3371 resp := &oracledatabasepb.ListAutonomousDatabaseCharacterSetsResponse{}
3372 if pageToken != "" {
3373 req.PageToken = pageToken
3374 }
3375 if pageSize > math.MaxInt32 {
3376 req.PageSize = math.MaxInt32
3377 } else if pageSize != 0 {
3378 req.PageSize = int32(pageSize)
3379 }
3380 baseUrl, err := url.Parse(c.endpoint)
3381 if err != nil {
3382 return nil, "", err
3383 }
3384 baseUrl.Path += fmt.Sprintf("/v1/%v/autonomousDatabaseCharacterSets", req.GetParent())
3385
3386 params := url.Values{}
3387 params.Add("$alt", "json;enum-encoding=int")
3388 if req.GetFilter() != "" {
3389 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
3390 }
3391 if req.GetPageSize() != 0 {
3392 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3393 }
3394 if req.GetPageToken() != "" {
3395 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3396 }
3397
3398 baseUrl.RawQuery = params.Encode()
3399
3400 // Build HTTP headers from client and context metadata.
3401 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3402 headers := gax.BuildHeaders(ctx, hds...)
3403 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3404 if settings.Path != "" {
3405 baseUrl.Path = settings.Path
3406 }
3407 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3408 if err != nil {
3409 return err
3410 }
3411 httpReq.Header = headers
3412
3413 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAutonomousDatabaseCharacterSets")
3414 if err != nil {
3415 return err
3416 }
3417 if err := unm.Unmarshal(buf, resp); err != nil {
3418 return err
3419 }
3420
3421 return nil
3422 }, opts...)
3423 if e != nil {
3424 return nil, "", e
3425 }
3426 it.Response = resp
3427 return resp.GetAutonomousDatabaseCharacterSets(), resp.GetNextPageToken(), nil
3428 }
3429
3430 fetch := func(pageSize int, pageToken string) (string, error) {
3431 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3432 if err != nil {
3433 return "", err
3434 }
3435 it.items = append(it.items, items...)
3436 return nextPageToken, nil
3437 }
3438
3439 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3440 it.pageInfo.MaxSize = int(req.GetPageSize())
3441 it.pageInfo.Token = req.GetPageToken()
3442
3443 return it
3444 }
3445
3446 // ListAutonomousDatabaseBackups lists the long-term and automatic backups of an Autonomous Database.
3447 func (c *restClient) ListAutonomousDatabaseBackups(ctx context.Context, req *oracledatabasepb.ListAutonomousDatabaseBackupsRequest, opts ...gax.CallOption) *AutonomousDatabaseBackupIterator {
3448 it := &AutonomousDatabaseBackupIterator{}
3449 req = proto.Clone(req).(*oracledatabasepb.ListAutonomousDatabaseBackupsRequest)
3450 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3451 it.InternalFetch = func(pageSize int, pageToken string) ([]*oracledatabasepb.AutonomousDatabaseBackup, string, error) {
3452 resp := &oracledatabasepb.ListAutonomousDatabaseBackupsResponse{}
3453 if pageToken != "" {
3454 req.PageToken = pageToken
3455 }
3456 if pageSize > math.MaxInt32 {
3457 req.PageSize = math.MaxInt32
3458 } else if pageSize != 0 {
3459 req.PageSize = int32(pageSize)
3460 }
3461 baseUrl, err := url.Parse(c.endpoint)
3462 if err != nil {
3463 return nil, "", err
3464 }
3465 baseUrl.Path += fmt.Sprintf("/v1/%v/autonomousDatabaseBackups", req.GetParent())
3466
3467 params := url.Values{}
3468 params.Add("$alt", "json;enum-encoding=int")
3469 if req.GetFilter() != "" {
3470 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
3471 }
3472 if req.GetPageSize() != 0 {
3473 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3474 }
3475 if req.GetPageToken() != "" {
3476 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3477 }
3478
3479 baseUrl.RawQuery = params.Encode()
3480
3481 // Build HTTP headers from client and context metadata.
3482 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3483 headers := gax.BuildHeaders(ctx, hds...)
3484 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3485 if settings.Path != "" {
3486 baseUrl.Path = settings.Path
3487 }
3488 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3489 if err != nil {
3490 return err
3491 }
3492 httpReq.Header = headers
3493
3494 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListAutonomousDatabaseBackups")
3495 if err != nil {
3496 return err
3497 }
3498 if err := unm.Unmarshal(buf, resp); err != nil {
3499 return err
3500 }
3501
3502 return nil
3503 }, opts...)
3504 if e != nil {
3505 return nil, "", e
3506 }
3507 it.Response = resp
3508 return resp.GetAutonomousDatabaseBackups(), resp.GetNextPageToken(), nil
3509 }
3510
3511 fetch := func(pageSize int, pageToken string) (string, error) {
3512 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3513 if err != nil {
3514 return "", err
3515 }
3516 it.items = append(it.items, items...)
3517 return nextPageToken, nil
3518 }
3519
3520 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3521 it.pageInfo.MaxSize = int(req.GetPageSize())
3522 it.pageInfo.Token = req.GetPageToken()
3523
3524 return it
3525 }
3526
3527 // StopAutonomousDatabase stops an Autonomous Database.
3528 func (c *restClient) StopAutonomousDatabase(ctx context.Context, req *oracledatabasepb.StopAutonomousDatabaseRequest, opts ...gax.CallOption) (*StopAutonomousDatabaseOperation, error) {
3529 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3530 jsonReq, err := m.Marshal(req)
3531 if err != nil {
3532 return nil, err
3533 }
3534
3535 baseUrl, err := url.Parse(c.endpoint)
3536 if err != nil {
3537 return nil, err
3538 }
3539 baseUrl.Path += fmt.Sprintf("/v1/%v:stop", req.GetName())
3540
3541 params := url.Values{}
3542 params.Add("$alt", "json;enum-encoding=int")
3543
3544 baseUrl.RawQuery = params.Encode()
3545
3546 // Build HTTP headers from client and context metadata.
3547 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3548
3549 hds = append(c.xGoogHeaders, hds...)
3550 hds = append(hds, "Content-Type", "application/json")
3551 headers := gax.BuildHeaders(ctx, hds...)
3552 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3553 resp := &longrunningpb.Operation{}
3554 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3555 if settings.Path != "" {
3556 baseUrl.Path = settings.Path
3557 }
3558 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3559 if err != nil {
3560 return err
3561 }
3562 httpReq = httpReq.WithContext(ctx)
3563 httpReq.Header = headers
3564
3565 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "StopAutonomousDatabase")
3566 if err != nil {
3567 return err
3568 }
3569 if err := unm.Unmarshal(buf, resp); err != nil {
3570 return err
3571 }
3572
3573 return nil
3574 }, opts...)
3575 if e != nil {
3576 return nil, e
3577 }
3578
3579 override := fmt.Sprintf("/v1/%s", resp.GetName())
3580 return &StopAutonomousDatabaseOperation{
3581 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3582 pollPath: override,
3583 }, nil
3584 }
3585
3586 // StartAutonomousDatabase starts an Autonomous Database.
3587 func (c *restClient) StartAutonomousDatabase(ctx context.Context, req *oracledatabasepb.StartAutonomousDatabaseRequest, opts ...gax.CallOption) (*StartAutonomousDatabaseOperation, error) {
3588 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3589 jsonReq, err := m.Marshal(req)
3590 if err != nil {
3591 return nil, err
3592 }
3593
3594 baseUrl, err := url.Parse(c.endpoint)
3595 if err != nil {
3596 return nil, err
3597 }
3598 baseUrl.Path += fmt.Sprintf("/v1/%v:start", req.GetName())
3599
3600 params := url.Values{}
3601 params.Add("$alt", "json;enum-encoding=int")
3602
3603 baseUrl.RawQuery = params.Encode()
3604
3605 // Build HTTP headers from client and context metadata.
3606 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3607
3608 hds = append(c.xGoogHeaders, hds...)
3609 hds = append(hds, "Content-Type", "application/json")
3610 headers := gax.BuildHeaders(ctx, hds...)
3611 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3612 resp := &longrunningpb.Operation{}
3613 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3614 if settings.Path != "" {
3615 baseUrl.Path = settings.Path
3616 }
3617 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3618 if err != nil {
3619 return err
3620 }
3621 httpReq = httpReq.WithContext(ctx)
3622 httpReq.Header = headers
3623
3624 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "StartAutonomousDatabase")
3625 if err != nil {
3626 return err
3627 }
3628 if err := unm.Unmarshal(buf, resp); err != nil {
3629 return err
3630 }
3631
3632 return nil
3633 }, opts...)
3634 if e != nil {
3635 return nil, e
3636 }
3637
3638 override := fmt.Sprintf("/v1/%s", resp.GetName())
3639 return &StartAutonomousDatabaseOperation{
3640 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3641 pollPath: override,
3642 }, nil
3643 }
3644
3645 // RestartAutonomousDatabase restarts an Autonomous Database.
3646 func (c *restClient) RestartAutonomousDatabase(ctx context.Context, req *oracledatabasepb.RestartAutonomousDatabaseRequest, opts ...gax.CallOption) (*RestartAutonomousDatabaseOperation, error) {
3647 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3648 jsonReq, err := m.Marshal(req)
3649 if err != nil {
3650 return nil, err
3651 }
3652
3653 baseUrl, err := url.Parse(c.endpoint)
3654 if err != nil {
3655 return nil, err
3656 }
3657 baseUrl.Path += fmt.Sprintf("/v1/%v:restart", req.GetName())
3658
3659 params := url.Values{}
3660 params.Add("$alt", "json;enum-encoding=int")
3661
3662 baseUrl.RawQuery = params.Encode()
3663
3664 // Build HTTP headers from client and context metadata.
3665 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3666
3667 hds = append(c.xGoogHeaders, hds...)
3668 hds = append(hds, "Content-Type", "application/json")
3669 headers := gax.BuildHeaders(ctx, hds...)
3670 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3671 resp := &longrunningpb.Operation{}
3672 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3673 if settings.Path != "" {
3674 baseUrl.Path = settings.Path
3675 }
3676 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3677 if err != nil {
3678 return err
3679 }
3680 httpReq = httpReq.WithContext(ctx)
3681 httpReq.Header = headers
3682
3683 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "RestartAutonomousDatabase")
3684 if err != nil {
3685 return err
3686 }
3687 if err := unm.Unmarshal(buf, resp); err != nil {
3688 return err
3689 }
3690
3691 return nil
3692 }, opts...)
3693 if e != nil {
3694 return nil, e
3695 }
3696
3697 override := fmt.Sprintf("/v1/%s", resp.GetName())
3698 return &RestartAutonomousDatabaseOperation{
3699 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
3700 pollPath: override,
3701 }, nil
3702 }
3703
3704 // GetLocation gets information about a location.
3705 func (c *restClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
3706 baseUrl, err := url.Parse(c.endpoint)
3707 if err != nil {
3708 return nil, err
3709 }
3710 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3711
3712 params := url.Values{}
3713 params.Add("$alt", "json;enum-encoding=int")
3714
3715 baseUrl.RawQuery = params.Encode()
3716
3717 // Build HTTP headers from client and context metadata.
3718 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3719
3720 hds = append(c.xGoogHeaders, hds...)
3721 hds = append(hds, "Content-Type", "application/json")
3722 headers := gax.BuildHeaders(ctx, hds...)
3723 opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...)
3724 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3725 resp := &locationpb.Location{}
3726 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3727 if settings.Path != "" {
3728 baseUrl.Path = settings.Path
3729 }
3730 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3731 if err != nil {
3732 return err
3733 }
3734 httpReq = httpReq.WithContext(ctx)
3735 httpReq.Header = headers
3736
3737 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetLocation")
3738 if err != nil {
3739 return err
3740 }
3741
3742 if err := unm.Unmarshal(buf, resp); err != nil {
3743 return err
3744 }
3745
3746 return nil
3747 }, opts...)
3748 if e != nil {
3749 return nil, e
3750 }
3751 return resp, nil
3752 }
3753
3754 // ListLocations lists information about the supported locations for this service.
3755 func (c *restClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
3756 it := &LocationIterator{}
3757 req = proto.Clone(req).(*locationpb.ListLocationsRequest)
3758 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3759 it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) {
3760 resp := &locationpb.ListLocationsResponse{}
3761 if pageToken != "" {
3762 req.PageToken = pageToken
3763 }
3764 if pageSize > math.MaxInt32 {
3765 req.PageSize = math.MaxInt32
3766 } else if pageSize != 0 {
3767 req.PageSize = int32(pageSize)
3768 }
3769 baseUrl, err := url.Parse(c.endpoint)
3770 if err != nil {
3771 return nil, "", err
3772 }
3773 baseUrl.Path += fmt.Sprintf("/v1/%v/locations", req.GetName())
3774
3775 params := url.Values{}
3776 params.Add("$alt", "json;enum-encoding=int")
3777 if req.GetFilter() != "" {
3778 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
3779 }
3780 if req.GetPageSize() != 0 {
3781 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3782 }
3783 if req.GetPageToken() != "" {
3784 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3785 }
3786
3787 baseUrl.RawQuery = params.Encode()
3788
3789 // Build HTTP headers from client and context metadata.
3790 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3791 headers := gax.BuildHeaders(ctx, hds...)
3792 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3793 if settings.Path != "" {
3794 baseUrl.Path = settings.Path
3795 }
3796 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3797 if err != nil {
3798 return err
3799 }
3800 httpReq.Header = headers
3801
3802 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListLocations")
3803 if err != nil {
3804 return err
3805 }
3806 if err := unm.Unmarshal(buf, resp); err != nil {
3807 return err
3808 }
3809
3810 return nil
3811 }, opts...)
3812 if e != nil {
3813 return nil, "", e
3814 }
3815 it.Response = resp
3816 return resp.GetLocations(), resp.GetNextPageToken(), nil
3817 }
3818
3819 fetch := func(pageSize int, pageToken string) (string, error) {
3820 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
3821 if err != nil {
3822 return "", err
3823 }
3824 it.items = append(it.items, items...)
3825 return nextPageToken, nil
3826 }
3827
3828 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
3829 it.pageInfo.MaxSize = int(req.GetPageSize())
3830 it.pageInfo.Token = req.GetPageToken()
3831
3832 return it
3833 }
3834
3835 // CancelOperation is a utility method from google.longrunning.Operations.
3836 func (c *restClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
3837 m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
3838 jsonReq, err := m.Marshal(req)
3839 if err != nil {
3840 return err
3841 }
3842
3843 baseUrl, err := url.Parse(c.endpoint)
3844 if err != nil {
3845 return err
3846 }
3847 baseUrl.Path += fmt.Sprintf("/v1/%v:cancel", req.GetName())
3848
3849 params := url.Values{}
3850 params.Add("$alt", "json;enum-encoding=int")
3851
3852 baseUrl.RawQuery = params.Encode()
3853
3854 // Build HTTP headers from client and context metadata.
3855 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3856
3857 hds = append(c.xGoogHeaders, hds...)
3858 hds = append(hds, "Content-Type", "application/json")
3859 headers := gax.BuildHeaders(ctx, hds...)
3860 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3861 if settings.Path != "" {
3862 baseUrl.Path = settings.Path
3863 }
3864 httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
3865 if err != nil {
3866 return err
3867 }
3868 httpReq = httpReq.WithContext(ctx)
3869 httpReq.Header = headers
3870
3871 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CancelOperation")
3872 return err
3873 }, opts...)
3874 }
3875
3876 // DeleteOperation is a utility method from google.longrunning.Operations.
3877 func (c *restClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
3878 baseUrl, err := url.Parse(c.endpoint)
3879 if err != nil {
3880 return err
3881 }
3882 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3883
3884 params := url.Values{}
3885 params.Add("$alt", "json;enum-encoding=int")
3886
3887 baseUrl.RawQuery = params.Encode()
3888
3889 // Build HTTP headers from client and context metadata.
3890 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3891
3892 hds = append(c.xGoogHeaders, hds...)
3893 hds = append(hds, "Content-Type", "application/json")
3894 headers := gax.BuildHeaders(ctx, hds...)
3895 return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3896 if settings.Path != "" {
3897 baseUrl.Path = settings.Path
3898 }
3899 httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
3900 if err != nil {
3901 return err
3902 }
3903 httpReq = httpReq.WithContext(ctx)
3904 httpReq.Header = headers
3905
3906 _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteOperation")
3907 return err
3908 }, opts...)
3909 }
3910
3911 // GetOperation is a utility method from google.longrunning.Operations.
3912 func (c *restClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
3913 baseUrl, err := url.Parse(c.endpoint)
3914 if err != nil {
3915 return nil, err
3916 }
3917 baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName())
3918
3919 params := url.Values{}
3920 params.Add("$alt", "json;enum-encoding=int")
3921
3922 baseUrl.RawQuery = params.Encode()
3923
3924 // Build HTTP headers from client and context metadata.
3925 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
3926
3927 hds = append(c.xGoogHeaders, hds...)
3928 hds = append(hds, "Content-Type", "application/json")
3929 headers := gax.BuildHeaders(ctx, hds...)
3930 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
3931 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3932 resp := &longrunningpb.Operation{}
3933 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
3934 if settings.Path != "" {
3935 baseUrl.Path = settings.Path
3936 }
3937 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
3938 if err != nil {
3939 return err
3940 }
3941 httpReq = httpReq.WithContext(ctx)
3942 httpReq.Header = headers
3943
3944 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetOperation")
3945 if err != nil {
3946 return err
3947 }
3948
3949 if err := unm.Unmarshal(buf, resp); err != nil {
3950 return err
3951 }
3952
3953 return nil
3954 }, opts...)
3955 if e != nil {
3956 return nil, e
3957 }
3958 return resp, nil
3959 }
3960
3961 // ListOperations is a utility method from google.longrunning.Operations.
3962 func (c *restClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
3963 it := &OperationIterator{}
3964 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
3965 unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
3966 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
3967 resp := &longrunningpb.ListOperationsResponse{}
3968 if pageToken != "" {
3969 req.PageToken = pageToken
3970 }
3971 if pageSize > math.MaxInt32 {
3972 req.PageSize = math.MaxInt32
3973 } else if pageSize != 0 {
3974 req.PageSize = int32(pageSize)
3975 }
3976 baseUrl, err := url.Parse(c.endpoint)
3977 if err != nil {
3978 return nil, "", err
3979 }
3980 baseUrl.Path += fmt.Sprintf("/v1/%v/operations", req.GetName())
3981
3982 params := url.Values{}
3983 params.Add("$alt", "json;enum-encoding=int")
3984 if req.GetFilter() != "" {
3985 params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
3986 }
3987 if req.GetPageSize() != 0 {
3988 params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
3989 }
3990 if req.GetPageToken() != "" {
3991 params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
3992 }
3993
3994 baseUrl.RawQuery = params.Encode()
3995
3996 // Build HTTP headers from client and context metadata.
3997 hds := append(c.xGoogHeaders, "Content-Type", "application/json")
3998 headers := gax.BuildHeaders(ctx, hds...)
3999 e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
4000 if settings.Path != "" {
4001 baseUrl.Path = settings.Path
4002 }
4003 httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
4004 if err != nil {
4005 return err
4006 }
4007 httpReq.Header = headers
4008
4009 buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListOperations")
4010 if err != nil {
4011 return err
4012 }
4013 if err := unm.Unmarshal(buf, resp); err != nil {
4014 return err
4015 }
4016
4017 return nil
4018 }, opts...)
4019 if e != nil {
4020 return nil, "", e
4021 }
4022 it.Response = resp
4023 return resp.GetOperations(), resp.GetNextPageToken(), nil
4024 }
4025
4026 fetch := func(pageSize int, pageToken string) (string, error) {
4027 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
4028 if err != nil {
4029 return "", err
4030 }
4031 it.items = append(it.items, items...)
4032 return nextPageToken, nil
4033 }
4034
4035 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
4036 it.pageInfo.MaxSize = int(req.GetPageSize())
4037 it.pageInfo.Token = req.GetPageToken()
4038
4039 return it
4040 }
4041
4042 // CreateAutonomousDatabaseOperation returns a new CreateAutonomousDatabaseOperation from a given name.
4043 // The name must be that of a previously created CreateAutonomousDatabaseOperation, possibly from a different process.
4044 func (c *gRPCClient) CreateAutonomousDatabaseOperation(name string) *CreateAutonomousDatabaseOperation {
4045 return &CreateAutonomousDatabaseOperation{
4046 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4047 }
4048 }
4049
4050 // CreateAutonomousDatabaseOperation returns a new CreateAutonomousDatabaseOperation from a given name.
4051 // The name must be that of a previously created CreateAutonomousDatabaseOperation, possibly from a different process.
4052 func (c *restClient) CreateAutonomousDatabaseOperation(name string) *CreateAutonomousDatabaseOperation {
4053 override := fmt.Sprintf("/v1/%s", name)
4054 return &CreateAutonomousDatabaseOperation{
4055 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4056 pollPath: override,
4057 }
4058 }
4059
4060 // CreateCloudExadataInfrastructureOperation returns a new CreateCloudExadataInfrastructureOperation from a given name.
4061 // The name must be that of a previously created CreateCloudExadataInfrastructureOperation, possibly from a different process.
4062 func (c *gRPCClient) CreateCloudExadataInfrastructureOperation(name string) *CreateCloudExadataInfrastructureOperation {
4063 return &CreateCloudExadataInfrastructureOperation{
4064 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4065 }
4066 }
4067
4068 // CreateCloudExadataInfrastructureOperation returns a new CreateCloudExadataInfrastructureOperation from a given name.
4069 // The name must be that of a previously created CreateCloudExadataInfrastructureOperation, possibly from a different process.
4070 func (c *restClient) CreateCloudExadataInfrastructureOperation(name string) *CreateCloudExadataInfrastructureOperation {
4071 override := fmt.Sprintf("/v1/%s", name)
4072 return &CreateCloudExadataInfrastructureOperation{
4073 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4074 pollPath: override,
4075 }
4076 }
4077
4078 // CreateCloudVmClusterOperation returns a new CreateCloudVmClusterOperation from a given name.
4079 // The name must be that of a previously created CreateCloudVmClusterOperation, possibly from a different process.
4080 func (c *gRPCClient) CreateCloudVmClusterOperation(name string) *CreateCloudVmClusterOperation {
4081 return &CreateCloudVmClusterOperation{
4082 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4083 }
4084 }
4085
4086 // CreateCloudVmClusterOperation returns a new CreateCloudVmClusterOperation from a given name.
4087 // The name must be that of a previously created CreateCloudVmClusterOperation, possibly from a different process.
4088 func (c *restClient) CreateCloudVmClusterOperation(name string) *CreateCloudVmClusterOperation {
4089 override := fmt.Sprintf("/v1/%s", name)
4090 return &CreateCloudVmClusterOperation{
4091 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4092 pollPath: override,
4093 }
4094 }
4095
4096 // DeleteAutonomousDatabaseOperation returns a new DeleteAutonomousDatabaseOperation from a given name.
4097 // The name must be that of a previously created DeleteAutonomousDatabaseOperation, possibly from a different process.
4098 func (c *gRPCClient) DeleteAutonomousDatabaseOperation(name string) *DeleteAutonomousDatabaseOperation {
4099 return &DeleteAutonomousDatabaseOperation{
4100 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4101 }
4102 }
4103
4104 // DeleteAutonomousDatabaseOperation returns a new DeleteAutonomousDatabaseOperation from a given name.
4105 // The name must be that of a previously created DeleteAutonomousDatabaseOperation, possibly from a different process.
4106 func (c *restClient) DeleteAutonomousDatabaseOperation(name string) *DeleteAutonomousDatabaseOperation {
4107 override := fmt.Sprintf("/v1/%s", name)
4108 return &DeleteAutonomousDatabaseOperation{
4109 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4110 pollPath: override,
4111 }
4112 }
4113
4114 // DeleteCloudExadataInfrastructureOperation returns a new DeleteCloudExadataInfrastructureOperation from a given name.
4115 // The name must be that of a previously created DeleteCloudExadataInfrastructureOperation, possibly from a different process.
4116 func (c *gRPCClient) DeleteCloudExadataInfrastructureOperation(name string) *DeleteCloudExadataInfrastructureOperation {
4117 return &DeleteCloudExadataInfrastructureOperation{
4118 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4119 }
4120 }
4121
4122 // DeleteCloudExadataInfrastructureOperation returns a new DeleteCloudExadataInfrastructureOperation from a given name.
4123 // The name must be that of a previously created DeleteCloudExadataInfrastructureOperation, possibly from a different process.
4124 func (c *restClient) DeleteCloudExadataInfrastructureOperation(name string) *DeleteCloudExadataInfrastructureOperation {
4125 override := fmt.Sprintf("/v1/%s", name)
4126 return &DeleteCloudExadataInfrastructureOperation{
4127 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4128 pollPath: override,
4129 }
4130 }
4131
4132 // DeleteCloudVmClusterOperation returns a new DeleteCloudVmClusterOperation from a given name.
4133 // The name must be that of a previously created DeleteCloudVmClusterOperation, possibly from a different process.
4134 func (c *gRPCClient) DeleteCloudVmClusterOperation(name string) *DeleteCloudVmClusterOperation {
4135 return &DeleteCloudVmClusterOperation{
4136 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4137 }
4138 }
4139
4140 // DeleteCloudVmClusterOperation returns a new DeleteCloudVmClusterOperation from a given name.
4141 // The name must be that of a previously created DeleteCloudVmClusterOperation, possibly from a different process.
4142 func (c *restClient) DeleteCloudVmClusterOperation(name string) *DeleteCloudVmClusterOperation {
4143 override := fmt.Sprintf("/v1/%s", name)
4144 return &DeleteCloudVmClusterOperation{
4145 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4146 pollPath: override,
4147 }
4148 }
4149
4150 // RestartAutonomousDatabaseOperation returns a new RestartAutonomousDatabaseOperation from a given name.
4151 // The name must be that of a previously created RestartAutonomousDatabaseOperation, possibly from a different process.
4152 func (c *gRPCClient) RestartAutonomousDatabaseOperation(name string) *RestartAutonomousDatabaseOperation {
4153 return &RestartAutonomousDatabaseOperation{
4154 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4155 }
4156 }
4157
4158 // RestartAutonomousDatabaseOperation returns a new RestartAutonomousDatabaseOperation from a given name.
4159 // The name must be that of a previously created RestartAutonomousDatabaseOperation, possibly from a different process.
4160 func (c *restClient) RestartAutonomousDatabaseOperation(name string) *RestartAutonomousDatabaseOperation {
4161 override := fmt.Sprintf("/v1/%s", name)
4162 return &RestartAutonomousDatabaseOperation{
4163 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4164 pollPath: override,
4165 }
4166 }
4167
4168 // RestoreAutonomousDatabaseOperation returns a new RestoreAutonomousDatabaseOperation from a given name.
4169 // The name must be that of a previously created RestoreAutonomousDatabaseOperation, possibly from a different process.
4170 func (c *gRPCClient) RestoreAutonomousDatabaseOperation(name string) *RestoreAutonomousDatabaseOperation {
4171 return &RestoreAutonomousDatabaseOperation{
4172 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4173 }
4174 }
4175
4176 // RestoreAutonomousDatabaseOperation returns a new RestoreAutonomousDatabaseOperation from a given name.
4177 // The name must be that of a previously created RestoreAutonomousDatabaseOperation, possibly from a different process.
4178 func (c *restClient) RestoreAutonomousDatabaseOperation(name string) *RestoreAutonomousDatabaseOperation {
4179 override := fmt.Sprintf("/v1/%s", name)
4180 return &RestoreAutonomousDatabaseOperation{
4181 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4182 pollPath: override,
4183 }
4184 }
4185
4186 // StartAutonomousDatabaseOperation returns a new StartAutonomousDatabaseOperation from a given name.
4187 // The name must be that of a previously created StartAutonomousDatabaseOperation, possibly from a different process.
4188 func (c *gRPCClient) StartAutonomousDatabaseOperation(name string) *StartAutonomousDatabaseOperation {
4189 return &StartAutonomousDatabaseOperation{
4190 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4191 }
4192 }
4193
4194 // StartAutonomousDatabaseOperation returns a new StartAutonomousDatabaseOperation from a given name.
4195 // The name must be that of a previously created StartAutonomousDatabaseOperation, possibly from a different process.
4196 func (c *restClient) StartAutonomousDatabaseOperation(name string) *StartAutonomousDatabaseOperation {
4197 override := fmt.Sprintf("/v1/%s", name)
4198 return &StartAutonomousDatabaseOperation{
4199 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4200 pollPath: override,
4201 }
4202 }
4203
4204 // StopAutonomousDatabaseOperation returns a new StopAutonomousDatabaseOperation from a given name.
4205 // The name must be that of a previously created StopAutonomousDatabaseOperation, possibly from a different process.
4206 func (c *gRPCClient) StopAutonomousDatabaseOperation(name string) *StopAutonomousDatabaseOperation {
4207 return &StopAutonomousDatabaseOperation{
4208 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4209 }
4210 }
4211
4212 // StopAutonomousDatabaseOperation returns a new StopAutonomousDatabaseOperation from a given name.
4213 // The name must be that of a previously created StopAutonomousDatabaseOperation, possibly from a different process.
4214 func (c *restClient) StopAutonomousDatabaseOperation(name string) *StopAutonomousDatabaseOperation {
4215 override := fmt.Sprintf("/v1/%s", name)
4216 return &StopAutonomousDatabaseOperation{
4217 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
4218 pollPath: override,
4219 }
4220 }