Debian Codegraph @

clouddms/apiv1/data_migration_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 clouddms
18
19 import (
20 "context"
21 "fmt"
22 "log/slog"
23 "math"
24 "net/url"
25 "time"
26
27 clouddmspb "cloud.google.com/go/clouddms/apiv1/clouddmspb"
28 iampb "cloud.google.com/go/iam/apiv1/iampb"
29 "cloud.google.com/go/longrunning"
30 lroauto "cloud.google.com/go/longrunning/autogen"
31 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
32 gax "github.com/googleapis/gax-go/v2"
33 "google.golang.org/api/iterator"
34 "google.golang.org/api/option"
35 "google.golang.org/api/option/internaloption"
36 gtransport "google.golang.org/api/transport/grpc"
37 locationpb "google.golang.org/genproto/googleapis/cloud/location"
38 "google.golang.org/grpc"
39 "google.golang.org/grpc/codes"
40 "google.golang.org/protobuf/proto"
41 )
42
43 var newDataMigrationClientHook clientHook
44
45 // DataMigrationCallOptions contains the retry settings for each method of DataMigrationClient.
46 type DataMigrationCallOptions struct {
47 ListMigrationJobs []gax.CallOption
48 GetMigrationJob []gax.CallOption
49 CreateMigrationJob []gax.CallOption
50 UpdateMigrationJob []gax.CallOption
51 DeleteMigrationJob []gax.CallOption
52 StartMigrationJob []gax.CallOption
53 StopMigrationJob []gax.CallOption
54 ResumeMigrationJob []gax.CallOption
55 PromoteMigrationJob []gax.CallOption
56 VerifyMigrationJob []gax.CallOption
57 RestartMigrationJob []gax.CallOption
58 GenerateSshScript []gax.CallOption
59 GenerateTcpProxyScript []gax.CallOption
60 ListConnectionProfiles []gax.CallOption
61 GetConnectionProfile []gax.CallOption
62 CreateConnectionProfile []gax.CallOption
63 UpdateConnectionProfile []gax.CallOption
64 DeleteConnectionProfile []gax.CallOption
65 CreatePrivateConnection []gax.CallOption
66 GetPrivateConnection []gax.CallOption
67 ListPrivateConnections []gax.CallOption
68 DeletePrivateConnection []gax.CallOption
69 GetConversionWorkspace []gax.CallOption
70 ListConversionWorkspaces []gax.CallOption
71 CreateConversionWorkspace []gax.CallOption
72 UpdateConversionWorkspace []gax.CallOption
73 DeleteConversionWorkspace []gax.CallOption
74 CreateMappingRule []gax.CallOption
75 DeleteMappingRule []gax.CallOption
76 ListMappingRules []gax.CallOption
77 GetMappingRule []gax.CallOption
78 SeedConversionWorkspace []gax.CallOption
79 ImportMappingRules []gax.CallOption
80 ConvertConversionWorkspace []gax.CallOption
81 CommitConversionWorkspace []gax.CallOption
82 RollbackConversionWorkspace []gax.CallOption
83 ApplyConversionWorkspace []gax.CallOption
84 DescribeDatabaseEntities []gax.CallOption
85 SearchBackgroundJobs []gax.CallOption
86 DescribeConversionWorkspaceRevisions []gax.CallOption
87 FetchStaticIps []gax.CallOption
88 GetLocation []gax.CallOption
89 ListLocations []gax.CallOption
90 GetIamPolicy []gax.CallOption
91 SetIamPolicy []gax.CallOption
92 TestIamPermissions []gax.CallOption
93 CancelOperation []gax.CallOption
94 DeleteOperation []gax.CallOption
95 GetOperation []gax.CallOption
96 ListOperations []gax.CallOption
97 }
98
99 func defaultDataMigrationGRPCClientOptions() []option.ClientOption {
100 return []option.ClientOption{
101 internaloption.WithDefaultEndpoint("datamigration.googleapis.com:443"),
102 internaloption.WithDefaultEndpointTemplate("datamigration.UNIVERSE_DOMAIN:443"),
103 internaloption.WithDefaultMTLSEndpoint("datamigration.mtls.googleapis.com:443"),
104 internaloption.WithDefaultUniverseDomain("googleapis.com"),
105 internaloption.WithDefaultAudience("https://datamigration.googleapis.com/"),
106 internaloption.WithDefaultScopes(DefaultAuthScopes()...),
107 internaloption.EnableJwtWithScope(),
108 internaloption.EnableNewAuthLibrary(),
109 option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
110 grpc.MaxCallRecvMsgSize(math.MaxInt32))),
111 }
112 }
113
114 func defaultDataMigrationCallOptions() *DataMigrationCallOptions {
115 return &DataMigrationCallOptions{
116 ListMigrationJobs: []gax.CallOption{
117 gax.WithTimeout(60000 * time.Millisecond),
118 },
119 GetMigrationJob: []gax.CallOption{
120 gax.WithTimeout(60000 * time.Millisecond),
121 },
122 CreateMigrationJob: []gax.CallOption{
123 gax.WithTimeout(60000 * time.Millisecond),
124 },
125 UpdateMigrationJob: []gax.CallOption{
126 gax.WithTimeout(60000 * time.Millisecond),
127 },
128 DeleteMigrationJob: []gax.CallOption{
129 gax.WithTimeout(60000 * time.Millisecond),
130 },
131 StartMigrationJob: []gax.CallOption{
132 gax.WithTimeout(60000 * time.Millisecond),
133 },
134 StopMigrationJob: []gax.CallOption{
135 gax.WithTimeout(60000 * time.Millisecond),
136 },
137 ResumeMigrationJob: []gax.CallOption{
138 gax.WithTimeout(60000 * time.Millisecond),
139 },
140 PromoteMigrationJob: []gax.CallOption{
141 gax.WithTimeout(60000 * time.Millisecond),
142 },
143 VerifyMigrationJob: []gax.CallOption{
144 gax.WithTimeout(60000 * time.Millisecond),
145 },
146 RestartMigrationJob: []gax.CallOption{
147 gax.WithTimeout(60000 * time.Millisecond),
148 },
149 GenerateSshScript: []gax.CallOption{
150 gax.WithTimeout(60000 * time.Millisecond),
151 },
152 GenerateTcpProxyScript: []gax.CallOption{
153 gax.WithTimeout(60000 * time.Millisecond),
154 gax.WithRetry(func() gax.Retryer {
155 return gax.OnCodes([]codes.Code{
156 codes.Unavailable,
157 }, gax.Backoff{
158 Initial: 1000 * time.Millisecond,
159 Max: 10000 * time.Millisecond,
160 Multiplier: 1.30,
161 })
162 }),
163 },
164 ListConnectionProfiles: []gax.CallOption{
165 gax.WithTimeout(60000 * time.Millisecond),
166 },
167 GetConnectionProfile: []gax.CallOption{
168 gax.WithTimeout(60000 * time.Millisecond),
169 },
170 CreateConnectionProfile: []gax.CallOption{
171 gax.WithTimeout(60000 * time.Millisecond),
172 },
173 UpdateConnectionProfile: []gax.CallOption{
174 gax.WithTimeout(60000 * time.Millisecond),
175 },
176 DeleteConnectionProfile: []gax.CallOption{
177 gax.WithTimeout(60000 * time.Millisecond),
178 },
179 CreatePrivateConnection: []gax.CallOption{
180 gax.WithTimeout(60000 * time.Millisecond),
181 },
182 GetPrivateConnection: []gax.CallOption{
183 gax.WithTimeout(60000 * time.Millisecond),
184 },
185 ListPrivateConnections: []gax.CallOption{
186 gax.WithTimeout(60000 * time.Millisecond),
187 },
188 DeletePrivateConnection: []gax.CallOption{
189 gax.WithTimeout(60000 * time.Millisecond),
190 },
191 GetConversionWorkspace: []gax.CallOption{
192 gax.WithTimeout(60000 * time.Millisecond),
193 },
194 ListConversionWorkspaces: []gax.CallOption{
195 gax.WithTimeout(60000 * time.Millisecond),
196 },
197 CreateConversionWorkspace: []gax.CallOption{
198 gax.WithTimeout(60000 * time.Millisecond),
199 },
200 UpdateConversionWorkspace: []gax.CallOption{
201 gax.WithTimeout(60000 * time.Millisecond),
202 },
203 DeleteConversionWorkspace: []gax.CallOption{
204 gax.WithTimeout(60000 * time.Millisecond),
205 },
206 CreateMappingRule: []gax.CallOption{
207 gax.WithTimeout(60000 * time.Millisecond),
208 gax.WithRetry(func() gax.Retryer {
209 return gax.OnCodes([]codes.Code{
210 codes.Unavailable,
211 }, gax.Backoff{
212 Initial: 1000 * time.Millisecond,
213 Max: 10000 * time.Millisecond,
214 Multiplier: 1.30,
215 })
216 }),
217 },
218 DeleteMappingRule: []gax.CallOption{
219 gax.WithTimeout(60000 * time.Millisecond),
220 gax.WithRetry(func() gax.Retryer {
221 return gax.OnCodes([]codes.Code{
222 codes.Unavailable,
223 }, gax.Backoff{
224 Initial: 1000 * time.Millisecond,
225 Max: 10000 * time.Millisecond,
226 Multiplier: 1.30,
227 })
228 }),
229 },
230 ListMappingRules: []gax.CallOption{
231 gax.WithTimeout(60000 * time.Millisecond),
232 gax.WithRetry(func() gax.Retryer {
233 return gax.OnCodes([]codes.Code{
234 codes.Unavailable,
235 }, gax.Backoff{
236 Initial: 1000 * time.Millisecond,
237 Max: 10000 * time.Millisecond,
238 Multiplier: 1.30,
239 })
240 }),
241 },
242 GetMappingRule: []gax.CallOption{
243 gax.WithTimeout(60000 * time.Millisecond),
244 gax.WithRetry(func() gax.Retryer {
245 return gax.OnCodes([]codes.Code{
246 codes.Unavailable,
247 }, gax.Backoff{
248 Initial: 1000 * time.Millisecond,
249 Max: 10000 * time.Millisecond,
250 Multiplier: 1.30,
251 })
252 }),
253 },
254 SeedConversionWorkspace: []gax.CallOption{
255 gax.WithTimeout(60000 * time.Millisecond),
256 },
257 ImportMappingRules: []gax.CallOption{
258 gax.WithTimeout(60000 * time.Millisecond),
259 },
260 ConvertConversionWorkspace: []gax.CallOption{
261 gax.WithTimeout(60000 * time.Millisecond),
262 },
263 CommitConversionWorkspace: []gax.CallOption{
264 gax.WithTimeout(60000 * time.Millisecond),
265 },
266 RollbackConversionWorkspace: []gax.CallOption{
267 gax.WithTimeout(60000 * time.Millisecond),
268 },
269 ApplyConversionWorkspace: []gax.CallOption{
270 gax.WithTimeout(60000 * time.Millisecond),
271 },
272 DescribeDatabaseEntities: []gax.CallOption{
273 gax.WithTimeout(60000 * time.Millisecond),
274 },
275 SearchBackgroundJobs: []gax.CallOption{
276 gax.WithTimeout(60000 * time.Millisecond),
277 },
278 DescribeConversionWorkspaceRevisions: []gax.CallOption{
279 gax.WithTimeout(60000 * time.Millisecond),
280 },
281 FetchStaticIps: []gax.CallOption{
282 gax.WithTimeout(60000 * time.Millisecond),
283 },
284 GetLocation: []gax.CallOption{},
285 ListLocations: []gax.CallOption{},
286 GetIamPolicy: []gax.CallOption{},
287 SetIamPolicy: []gax.CallOption{},
288 TestIamPermissions: []gax.CallOption{},
289 CancelOperation: []gax.CallOption{},
290 DeleteOperation: []gax.CallOption{},
291 GetOperation: []gax.CallOption{},
292 ListOperations: []gax.CallOption{},
293 }
294 }
295
296 // internalDataMigrationClient is an interface that defines the methods available from Database Migration API.
297 type internalDataMigrationClient interface {
298 Close() error
299 setGoogleClientInfo(...string)
300 Connection() *grpc.ClientConn
301 ListMigrationJobs(context.Context, *clouddmspb.ListMigrationJobsRequest, ...gax.CallOption) *MigrationJobIterator
302 GetMigrationJob(context.Context, *clouddmspb.GetMigrationJobRequest, ...gax.CallOption) (*clouddmspb.MigrationJob, error)
303 CreateMigrationJob(context.Context, *clouddmspb.CreateMigrationJobRequest, ...gax.CallOption) (*CreateMigrationJobOperation, error)
304 CreateMigrationJobOperation(name string) *CreateMigrationJobOperation
305 UpdateMigrationJob(context.Context, *clouddmspb.UpdateMigrationJobRequest, ...gax.CallOption) (*UpdateMigrationJobOperation, error)
306 UpdateMigrationJobOperation(name string) *UpdateMigrationJobOperation
307 DeleteMigrationJob(context.Context, *clouddmspb.DeleteMigrationJobRequest, ...gax.CallOption) (*DeleteMigrationJobOperation, error)
308 DeleteMigrationJobOperation(name string) *DeleteMigrationJobOperation
309 StartMigrationJob(context.Context, *clouddmspb.StartMigrationJobRequest, ...gax.CallOption) (*StartMigrationJobOperation, error)
310 StartMigrationJobOperation(name string) *StartMigrationJobOperation
311 StopMigrationJob(context.Context, *clouddmspb.StopMigrationJobRequest, ...gax.CallOption) (*StopMigrationJobOperation, error)
312 StopMigrationJobOperation(name string) *StopMigrationJobOperation
313 ResumeMigrationJob(context.Context, *clouddmspb.ResumeMigrationJobRequest, ...gax.CallOption) (*ResumeMigrationJobOperation, error)
314 ResumeMigrationJobOperation(name string) *ResumeMigrationJobOperation
315 PromoteMigrationJob(context.Context, *clouddmspb.PromoteMigrationJobRequest, ...gax.CallOption) (*PromoteMigrationJobOperation, error)
316 PromoteMigrationJobOperation(name string) *PromoteMigrationJobOperation
317 VerifyMigrationJob(context.Context, *clouddmspb.VerifyMigrationJobRequest, ...gax.CallOption) (*VerifyMigrationJobOperation, error)
318 VerifyMigrationJobOperation(name string) *VerifyMigrationJobOperation
319 RestartMigrationJob(context.Context, *clouddmspb.RestartMigrationJobRequest, ...gax.CallOption) (*RestartMigrationJobOperation, error)
320 RestartMigrationJobOperation(name string) *RestartMigrationJobOperation
321 GenerateSshScript(context.Context, *clouddmspb.GenerateSshScriptRequest, ...gax.CallOption) (*clouddmspb.SshScript, error)
322 GenerateTcpProxyScript(context.Context, *clouddmspb.GenerateTcpProxyScriptRequest, ...gax.CallOption) (*clouddmspb.TcpProxyScript, error)
323 ListConnectionProfiles(context.Context, *clouddmspb.ListConnectionProfilesRequest, ...gax.CallOption) *ConnectionProfileIterator
324 GetConnectionProfile(context.Context, *clouddmspb.GetConnectionProfileRequest, ...gax.CallOption) (*clouddmspb.ConnectionProfile, error)
325 CreateConnectionProfile(context.Context, *clouddmspb.CreateConnectionProfileRequest, ...gax.CallOption) (*CreateConnectionProfileOperation, error)
326 CreateConnectionProfileOperation(name string) *CreateConnectionProfileOperation
327 UpdateConnectionProfile(context.Context, *clouddmspb.UpdateConnectionProfileRequest, ...gax.CallOption) (*UpdateConnectionProfileOperation, error)
328 UpdateConnectionProfileOperation(name string) *UpdateConnectionProfileOperation
329 DeleteConnectionProfile(context.Context, *clouddmspb.DeleteConnectionProfileRequest, ...gax.CallOption) (*DeleteConnectionProfileOperation, error)
330 DeleteConnectionProfileOperation(name string) *DeleteConnectionProfileOperation
331 CreatePrivateConnection(context.Context, *clouddmspb.CreatePrivateConnectionRequest, ...gax.CallOption) (*CreatePrivateConnectionOperation, error)
332 CreatePrivateConnectionOperation(name string) *CreatePrivateConnectionOperation
333 GetPrivateConnection(context.Context, *clouddmspb.GetPrivateConnectionRequest, ...gax.CallOption) (*clouddmspb.PrivateConnection, error)
334 ListPrivateConnections(context.Context, *clouddmspb.ListPrivateConnectionsRequest, ...gax.CallOption) *PrivateConnectionIterator
335 DeletePrivateConnection(context.Context, *clouddmspb.DeletePrivateConnectionRequest, ...gax.CallOption) (*DeletePrivateConnectionOperation, error)
336 DeletePrivateConnectionOperation(name string) *DeletePrivateConnectionOperation
337 GetConversionWorkspace(context.Context, *clouddmspb.GetConversionWorkspaceRequest, ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error)
338 ListConversionWorkspaces(context.Context, *clouddmspb.ListConversionWorkspacesRequest, ...gax.CallOption) *ConversionWorkspaceIterator
339 CreateConversionWorkspace(context.Context, *clouddmspb.CreateConversionWorkspaceRequest, ...gax.CallOption) (*CreateConversionWorkspaceOperation, error)
340 CreateConversionWorkspaceOperation(name string) *CreateConversionWorkspaceOperation
341 UpdateConversionWorkspace(context.Context, *clouddmspb.UpdateConversionWorkspaceRequest, ...gax.CallOption) (*UpdateConversionWorkspaceOperation, error)
342 UpdateConversionWorkspaceOperation(name string) *UpdateConversionWorkspaceOperation
343 DeleteConversionWorkspace(context.Context, *clouddmspb.DeleteConversionWorkspaceRequest, ...gax.CallOption) (*DeleteConversionWorkspaceOperation, error)
344 DeleteConversionWorkspaceOperation(name string) *DeleteConversionWorkspaceOperation
345 CreateMappingRule(context.Context, *clouddmspb.CreateMappingRuleRequest, ...gax.CallOption) (*clouddmspb.MappingRule, error)
346 DeleteMappingRule(context.Context, *clouddmspb.DeleteMappingRuleRequest, ...gax.CallOption) error
347 ListMappingRules(context.Context, *clouddmspb.ListMappingRulesRequest, ...gax.CallOption) *MappingRuleIterator
348 GetMappingRule(context.Context, *clouddmspb.GetMappingRuleRequest, ...gax.CallOption) (*clouddmspb.MappingRule, error)
349 SeedConversionWorkspace(context.Context, *clouddmspb.SeedConversionWorkspaceRequest, ...gax.CallOption) (*SeedConversionWorkspaceOperation, error)
350 SeedConversionWorkspaceOperation(name string) *SeedConversionWorkspaceOperation
351 ImportMappingRules(context.Context, *clouddmspb.ImportMappingRulesRequest, ...gax.CallOption) (*ImportMappingRulesOperation, error)
352 ImportMappingRulesOperation(name string) *ImportMappingRulesOperation
353 ConvertConversionWorkspace(context.Context, *clouddmspb.ConvertConversionWorkspaceRequest, ...gax.CallOption) (*ConvertConversionWorkspaceOperation, error)
354 ConvertConversionWorkspaceOperation(name string) *ConvertConversionWorkspaceOperation
355 CommitConversionWorkspace(context.Context, *clouddmspb.CommitConversionWorkspaceRequest, ...gax.CallOption) (*CommitConversionWorkspaceOperation, error)
356 CommitConversionWorkspaceOperation(name string) *CommitConversionWorkspaceOperation
357 RollbackConversionWorkspace(context.Context, *clouddmspb.RollbackConversionWorkspaceRequest, ...gax.CallOption) (*RollbackConversionWorkspaceOperation, error)
358 RollbackConversionWorkspaceOperation(name string) *RollbackConversionWorkspaceOperation
359 ApplyConversionWorkspace(context.Context, *clouddmspb.ApplyConversionWorkspaceRequest, ...gax.CallOption) (*ApplyConversionWorkspaceOperation, error)
360 ApplyConversionWorkspaceOperation(name string) *ApplyConversionWorkspaceOperation
361 DescribeDatabaseEntities(context.Context, *clouddmspb.DescribeDatabaseEntitiesRequest, ...gax.CallOption) *DatabaseEntityIterator
362 SearchBackgroundJobs(context.Context, *clouddmspb.SearchBackgroundJobsRequest, ...gax.CallOption) (*clouddmspb.SearchBackgroundJobsResponse, error)
363 DescribeConversionWorkspaceRevisions(context.Context, *clouddmspb.DescribeConversionWorkspaceRevisionsRequest, ...gax.CallOption) (*clouddmspb.DescribeConversionWorkspaceRevisionsResponse, error)
364 FetchStaticIps(context.Context, *clouddmspb.FetchStaticIpsRequest, ...gax.CallOption) *StringIterator
365 GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error)
366 ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator
367 GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
368 SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
369 TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
370 CancelOperation(context.Context, *longrunningpb.CancelOperationRequest, ...gax.CallOption) error
371 DeleteOperation(context.Context, *longrunningpb.DeleteOperationRequest, ...gax.CallOption) error
372 GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error)
373 ListOperations(context.Context, *longrunningpb.ListOperationsRequest, ...gax.CallOption) *OperationIterator
374 }
375
376 // DataMigrationClient is a client for interacting with Database Migration API.
377 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
378 //
379 // Database Migration service
380 type DataMigrationClient struct {
381 // The internal transport-dependent client.
382 internalClient internalDataMigrationClient
383
384 // The call options for this service.
385 CallOptions *DataMigrationCallOptions
386
387 // LROClient is used internally to handle long-running operations.
388 // It is exposed so that its CallOptions can be modified if required.
389 // Users should not Close this client.
390 LROClient *lroauto.OperationsClient
391 }
392
393 // Wrapper methods routed to the internal client.
394
395 // Close closes the connection to the API service. The user should invoke this when
396 // the client is no longer required.
397 func (c *DataMigrationClient) Close() error {
398 return c.internalClient.Close()
399 }
400
401 // setGoogleClientInfo sets the name and version of the application in
402 // the `x-goog-api-client` header passed on each request. Intended for
403 // use by Google-written clients.
404 func (c *DataMigrationClient) setGoogleClientInfo(keyval ...string) {
405 c.internalClient.setGoogleClientInfo(keyval...)
406 }
407
408 // Connection returns a connection to the API service.
409 //
410 // Deprecated: Connections are now pooled so this method does not always
411 // return the same resource.
412 func (c *DataMigrationClient) Connection() *grpc.ClientConn {
413 return c.internalClient.Connection()
414 }
415
416 // ListMigrationJobs lists migration jobs in a given project and location.
417 func (c *DataMigrationClient) ListMigrationJobs(ctx context.Context, req *clouddmspb.ListMigrationJobsRequest, opts ...gax.CallOption) *MigrationJobIterator {
418 return c.internalClient.ListMigrationJobs(ctx, req, opts...)
419 }
420
421 // GetMigrationJob gets details of a single migration job.
422 func (c *DataMigrationClient) GetMigrationJob(ctx context.Context, req *clouddmspb.GetMigrationJobRequest, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
423 return c.internalClient.GetMigrationJob(ctx, req, opts...)
424 }
425
426 // CreateMigrationJob creates a new migration job in a given project and location.
427 func (c *DataMigrationClient) CreateMigrationJob(ctx context.Context, req *clouddmspb.CreateMigrationJobRequest, opts ...gax.CallOption) (*CreateMigrationJobOperation, error) {
428 return c.internalClient.CreateMigrationJob(ctx, req, opts...)
429 }
430
431 // CreateMigrationJobOperation returns a new CreateMigrationJobOperation from a given name.
432 // The name must be that of a previously created CreateMigrationJobOperation, possibly from a different process.
433 func (c *DataMigrationClient) CreateMigrationJobOperation(name string) *CreateMigrationJobOperation {
434 return c.internalClient.CreateMigrationJobOperation(name)
435 }
436
437 // UpdateMigrationJob updates the parameters of a single migration job.
438 func (c *DataMigrationClient) UpdateMigrationJob(ctx context.Context, req *clouddmspb.UpdateMigrationJobRequest, opts ...gax.CallOption) (*UpdateMigrationJobOperation, error) {
439 return c.internalClient.UpdateMigrationJob(ctx, req, opts...)
440 }
441
442 // UpdateMigrationJobOperation returns a new UpdateMigrationJobOperation from a given name.
443 // The name must be that of a previously created UpdateMigrationJobOperation, possibly from a different process.
444 func (c *DataMigrationClient) UpdateMigrationJobOperation(name string) *UpdateMigrationJobOperation {
445 return c.internalClient.UpdateMigrationJobOperation(name)
446 }
447
448 // DeleteMigrationJob deletes a single migration job.
449 func (c *DataMigrationClient) DeleteMigrationJob(ctx context.Context, req *clouddmspb.DeleteMigrationJobRequest, opts ...gax.CallOption) (*DeleteMigrationJobOperation, error) {
450 return c.internalClient.DeleteMigrationJob(ctx, req, opts...)
451 }
452
453 // DeleteMigrationJobOperation returns a new DeleteMigrationJobOperation from a given name.
454 // The name must be that of a previously created DeleteMigrationJobOperation, possibly from a different process.
455 func (c *DataMigrationClient) DeleteMigrationJobOperation(name string) *DeleteMigrationJobOperation {
456 return c.internalClient.DeleteMigrationJobOperation(name)
457 }
458
459 // StartMigrationJob start an already created migration job.
460 func (c *DataMigrationClient) StartMigrationJob(ctx context.Context, req *clouddmspb.StartMigrationJobRequest, opts ...gax.CallOption) (*StartMigrationJobOperation, error) {
461 return c.internalClient.StartMigrationJob(ctx, req, opts...)
462 }
463
464 // StartMigrationJobOperation returns a new StartMigrationJobOperation from a given name.
465 // The name must be that of a previously created StartMigrationJobOperation, possibly from a different process.
466 func (c *DataMigrationClient) StartMigrationJobOperation(name string) *StartMigrationJobOperation {
467 return c.internalClient.StartMigrationJobOperation(name)
468 }
469
470 // StopMigrationJob stops a running migration job.
471 func (c *DataMigrationClient) StopMigrationJob(ctx context.Context, req *clouddmspb.StopMigrationJobRequest, opts ...gax.CallOption) (*StopMigrationJobOperation, error) {
472 return c.internalClient.StopMigrationJob(ctx, req, opts...)
473 }
474
475 // StopMigrationJobOperation returns a new StopMigrationJobOperation from a given name.
476 // The name must be that of a previously created StopMigrationJobOperation, possibly from a different process.
477 func (c *DataMigrationClient) StopMigrationJobOperation(name string) *StopMigrationJobOperation {
478 return c.internalClient.StopMigrationJobOperation(name)
479 }
480
481 // ResumeMigrationJob resume a migration job that is currently stopped and is resumable (was
482 // stopped during CDC phase).
483 func (c *DataMigrationClient) ResumeMigrationJob(ctx context.Context, req *clouddmspb.ResumeMigrationJobRequest, opts ...gax.CallOption) (*ResumeMigrationJobOperation, error) {
484 return c.internalClient.ResumeMigrationJob(ctx, req, opts...)
485 }
486
487 // ResumeMigrationJobOperation returns a new ResumeMigrationJobOperation from a given name.
488 // The name must be that of a previously created ResumeMigrationJobOperation, possibly from a different process.
489 func (c *DataMigrationClient) ResumeMigrationJobOperation(name string) *ResumeMigrationJobOperation {
490 return c.internalClient.ResumeMigrationJobOperation(name)
491 }
492
493 // PromoteMigrationJob promote a migration job, stopping replication to the destination and
494 // promoting the destination to be a standalone database.
495 func (c *DataMigrationClient) PromoteMigrationJob(ctx context.Context, req *clouddmspb.PromoteMigrationJobRequest, opts ...gax.CallOption) (*PromoteMigrationJobOperation, error) {
496 return c.internalClient.PromoteMigrationJob(ctx, req, opts...)
497 }
498
499 // PromoteMigrationJobOperation returns a new PromoteMigrationJobOperation from a given name.
500 // The name must be that of a previously created PromoteMigrationJobOperation, possibly from a different process.
501 func (c *DataMigrationClient) PromoteMigrationJobOperation(name string) *PromoteMigrationJobOperation {
502 return c.internalClient.PromoteMigrationJobOperation(name)
503 }
504
505 // VerifyMigrationJob verify a migration job, making sure the destination can reach the source
506 // and that all configuration and prerequisites are met.
507 func (c *DataMigrationClient) VerifyMigrationJob(ctx context.Context, req *clouddmspb.VerifyMigrationJobRequest, opts ...gax.CallOption) (*VerifyMigrationJobOperation, error) {
508 return c.internalClient.VerifyMigrationJob(ctx, req, opts...)
509 }
510
511 // VerifyMigrationJobOperation returns a new VerifyMigrationJobOperation from a given name.
512 // The name must be that of a previously created VerifyMigrationJobOperation, possibly from a different process.
513 func (c *DataMigrationClient) VerifyMigrationJobOperation(name string) *VerifyMigrationJobOperation {
514 return c.internalClient.VerifyMigrationJobOperation(name)
515 }
516
517 // RestartMigrationJob restart a stopped or failed migration job, resetting the destination
518 // instance to its original state and starting the migration process from
519 // scratch.
520 func (c *DataMigrationClient) RestartMigrationJob(ctx context.Context, req *clouddmspb.RestartMigrationJobRequest, opts ...gax.CallOption) (*RestartMigrationJobOperation, error) {
521 return c.internalClient.RestartMigrationJob(ctx, req, opts...)
522 }
523
524 // RestartMigrationJobOperation returns a new RestartMigrationJobOperation from a given name.
525 // The name must be that of a previously created RestartMigrationJobOperation, possibly from a different process.
526 func (c *DataMigrationClient) RestartMigrationJobOperation(name string) *RestartMigrationJobOperation {
527 return c.internalClient.RestartMigrationJobOperation(name)
528 }
529
530 // GenerateSshScript generate a SSH configuration script to configure the reverse SSH
531 // connectivity.
532 func (c *DataMigrationClient) GenerateSshScript(ctx context.Context, req *clouddmspb.GenerateSshScriptRequest, opts ...gax.CallOption) (*clouddmspb.SshScript, error) {
533 return c.internalClient.GenerateSshScript(ctx, req, opts...)
534 }
535
536 // GenerateTcpProxyScript generate a TCP Proxy configuration script to configure a cloud-hosted VM
537 // running a TCP Proxy.
538 func (c *DataMigrationClient) GenerateTcpProxyScript(ctx context.Context, req *clouddmspb.GenerateTcpProxyScriptRequest, opts ...gax.CallOption) (*clouddmspb.TcpProxyScript, error) {
539 return c.internalClient.GenerateTcpProxyScript(ctx, req, opts...)
540 }
541
542 // ListConnectionProfiles retrieves a list of all connection profiles in a given project and
543 // location.
544 func (c *DataMigrationClient) ListConnectionProfiles(ctx context.Context, req *clouddmspb.ListConnectionProfilesRequest, opts ...gax.CallOption) *ConnectionProfileIterator {
545 return c.internalClient.ListConnectionProfiles(ctx, req, opts...)
546 }
547
548 // GetConnectionProfile gets details of a single connection profile.
549 func (c *DataMigrationClient) GetConnectionProfile(ctx context.Context, req *clouddmspb.GetConnectionProfileRequest, opts ...gax.CallOption) (*clouddmspb.ConnectionProfile, error) {
550 return c.internalClient.GetConnectionProfile(ctx, req, opts...)
551 }
552
553 // CreateConnectionProfile creates a new connection profile in a given project and location.
554 func (c *DataMigrationClient) CreateConnectionProfile(ctx context.Context, req *clouddmspb.CreateConnectionProfileRequest, opts ...gax.CallOption) (*CreateConnectionProfileOperation, error) {
555 return c.internalClient.CreateConnectionProfile(ctx, req, opts...)
556 }
557
558 // CreateConnectionProfileOperation returns a new CreateConnectionProfileOperation from a given name.
559 // The name must be that of a previously created CreateConnectionProfileOperation, possibly from a different process.
560 func (c *DataMigrationClient) CreateConnectionProfileOperation(name string) *CreateConnectionProfileOperation {
561 return c.internalClient.CreateConnectionProfileOperation(name)
562 }
563
564 // UpdateConnectionProfile update the configuration of a single connection profile.
565 func (c *DataMigrationClient) UpdateConnectionProfile(ctx context.Context, req *clouddmspb.UpdateConnectionProfileRequest, opts ...gax.CallOption) (*UpdateConnectionProfileOperation, error) {
566 return c.internalClient.UpdateConnectionProfile(ctx, req, opts...)
567 }
568
569 // UpdateConnectionProfileOperation returns a new UpdateConnectionProfileOperation from a given name.
570 // The name must be that of a previously created UpdateConnectionProfileOperation, possibly from a different process.
571 func (c *DataMigrationClient) UpdateConnectionProfileOperation(name string) *UpdateConnectionProfileOperation {
572 return c.internalClient.UpdateConnectionProfileOperation(name)
573 }
574
575 // DeleteConnectionProfile deletes a single Database Migration Service connection profile.
576 // A connection profile can only be deleted if it is not in use by any
577 // active migration jobs.
578 func (c *DataMigrationClient) DeleteConnectionProfile(ctx context.Context, req *clouddmspb.DeleteConnectionProfileRequest, opts ...gax.CallOption) (*DeleteConnectionProfileOperation, error) {
579 return c.internalClient.DeleteConnectionProfile(ctx, req, opts...)
580 }
581
582 // DeleteConnectionProfileOperation returns a new DeleteConnectionProfileOperation from a given name.
583 // The name must be that of a previously created DeleteConnectionProfileOperation, possibly from a different process.
584 func (c *DataMigrationClient) DeleteConnectionProfileOperation(name string) *DeleteConnectionProfileOperation {
585 return c.internalClient.DeleteConnectionProfileOperation(name)
586 }
587
588 // CreatePrivateConnection creates a new private connection in a given project and location.
589 func (c *DataMigrationClient) CreatePrivateConnection(ctx context.Context, req *clouddmspb.CreatePrivateConnectionRequest, opts ...gax.CallOption) (*CreatePrivateConnectionOperation, error) {
590 return c.internalClient.CreatePrivateConnection(ctx, req, opts...)
591 }
592
593 // CreatePrivateConnectionOperation returns a new CreatePrivateConnectionOperation from a given name.
594 // The name must be that of a previously created CreatePrivateConnectionOperation, possibly from a different process.
595 func (c *DataMigrationClient) CreatePrivateConnectionOperation(name string) *CreatePrivateConnectionOperation {
596 return c.internalClient.CreatePrivateConnectionOperation(name)
597 }
598
599 // GetPrivateConnection gets details of a single private connection.
600 func (c *DataMigrationClient) GetPrivateConnection(ctx context.Context, req *clouddmspb.GetPrivateConnectionRequest, opts ...gax.CallOption) (*clouddmspb.PrivateConnection, error) {
601 return c.internalClient.GetPrivateConnection(ctx, req, opts...)
602 }
603
604 // ListPrivateConnections retrieves a list of private connections in a given project and location.
605 func (c *DataMigrationClient) ListPrivateConnections(ctx context.Context, req *clouddmspb.ListPrivateConnectionsRequest, opts ...gax.CallOption) *PrivateConnectionIterator {
606 return c.internalClient.ListPrivateConnections(ctx, req, opts...)
607 }
608
609 // DeletePrivateConnection deletes a single Database Migration Service private connection.
610 func (c *DataMigrationClient) DeletePrivateConnection(ctx context.Context, req *clouddmspb.DeletePrivateConnectionRequest, opts ...gax.CallOption) (*DeletePrivateConnectionOperation, error) {
611 return c.internalClient.DeletePrivateConnection(ctx, req, opts...)
612 }
613
614 // DeletePrivateConnectionOperation returns a new DeletePrivateConnectionOperation from a given name.
615 // The name must be that of a previously created DeletePrivateConnectionOperation, possibly from a different process.
616 func (c *DataMigrationClient) DeletePrivateConnectionOperation(name string) *DeletePrivateConnectionOperation {
617 return c.internalClient.DeletePrivateConnectionOperation(name)
618 }
619
620 // GetConversionWorkspace gets details of a single conversion workspace.
621 func (c *DataMigrationClient) GetConversionWorkspace(ctx context.Context, req *clouddmspb.GetConversionWorkspaceRequest, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
622 return c.internalClient.GetConversionWorkspace(ctx, req, opts...)
623 }
624
625 // ListConversionWorkspaces lists conversion workspaces in a given project and location.
626 func (c *DataMigrationClient) ListConversionWorkspaces(ctx context.Context, req *clouddmspb.ListConversionWorkspacesRequest, opts ...gax.CallOption) *ConversionWorkspaceIterator {
627 return c.internalClient.ListConversionWorkspaces(ctx, req, opts...)
628 }
629
630 // CreateConversionWorkspace creates a new conversion workspace in a given project and location.
631 func (c *DataMigrationClient) CreateConversionWorkspace(ctx context.Context, req *clouddmspb.CreateConversionWorkspaceRequest, opts ...gax.CallOption) (*CreateConversionWorkspaceOperation, error) {
632 return c.internalClient.CreateConversionWorkspace(ctx, req, opts...)
633 }
634
635 // CreateConversionWorkspaceOperation returns a new CreateConversionWorkspaceOperation from a given name.
636 // The name must be that of a previously created CreateConversionWorkspaceOperation, possibly from a different process.
637 func (c *DataMigrationClient) CreateConversionWorkspaceOperation(name string) *CreateConversionWorkspaceOperation {
638 return c.internalClient.CreateConversionWorkspaceOperation(name)
639 }
640
641 // UpdateConversionWorkspace updates the parameters of a single conversion workspace.
642 func (c *DataMigrationClient) UpdateConversionWorkspace(ctx context.Context, req *clouddmspb.UpdateConversionWorkspaceRequest, opts ...gax.CallOption) (*UpdateConversionWorkspaceOperation, error) {
643 return c.internalClient.UpdateConversionWorkspace(ctx, req, opts...)
644 }
645
646 // UpdateConversionWorkspaceOperation returns a new UpdateConversionWorkspaceOperation from a given name.
647 // The name must be that of a previously created UpdateConversionWorkspaceOperation, possibly from a different process.
648 func (c *DataMigrationClient) UpdateConversionWorkspaceOperation(name string) *UpdateConversionWorkspaceOperation {
649 return c.internalClient.UpdateConversionWorkspaceOperation(name)
650 }
651
652 // DeleteConversionWorkspace deletes a single conversion workspace.
653 func (c *DataMigrationClient) DeleteConversionWorkspace(ctx context.Context, req *clouddmspb.DeleteConversionWorkspaceRequest, opts ...gax.CallOption) (*DeleteConversionWorkspaceOperation, error) {
654 return c.internalClient.DeleteConversionWorkspace(ctx, req, opts...)
655 }
656
657 // DeleteConversionWorkspaceOperation returns a new DeleteConversionWorkspaceOperation from a given name.
658 // The name must be that of a previously created DeleteConversionWorkspaceOperation, possibly from a different process.
659 func (c *DataMigrationClient) DeleteConversionWorkspaceOperation(name string) *DeleteConversionWorkspaceOperation {
660 return c.internalClient.DeleteConversionWorkspaceOperation(name)
661 }
662
663 // CreateMappingRule creates a new mapping rule for a given conversion workspace.
664 func (c *DataMigrationClient) CreateMappingRule(ctx context.Context, req *clouddmspb.CreateMappingRuleRequest, opts ...gax.CallOption) (*clouddmspb.MappingRule, error) {
665 return c.internalClient.CreateMappingRule(ctx, req, opts...)
666 }
667
668 // DeleteMappingRule deletes a single mapping rule.
669 func (c *DataMigrationClient) DeleteMappingRule(ctx context.Context, req *clouddmspb.DeleteMappingRuleRequest, opts ...gax.CallOption) error {
670 return c.internalClient.DeleteMappingRule(ctx, req, opts...)
671 }
672
673 // ListMappingRules lists the mapping rules for a specific conversion workspace.
674 func (c *DataMigrationClient) ListMappingRules(ctx context.Context, req *clouddmspb.ListMappingRulesRequest, opts ...gax.CallOption) *MappingRuleIterator {
675 return c.internalClient.ListMappingRules(ctx, req, opts...)
676 }
677
678 // GetMappingRule gets the details of a mapping rule.
679 func (c *DataMigrationClient) GetMappingRule(ctx context.Context, req *clouddmspb.GetMappingRuleRequest, opts ...gax.CallOption) (*clouddmspb.MappingRule, error) {
680 return c.internalClient.GetMappingRule(ctx, req, opts...)
681 }
682
683 // SeedConversionWorkspace imports a snapshot of the source database into the
684 // conversion workspace.
685 func (c *DataMigrationClient) SeedConversionWorkspace(ctx context.Context, req *clouddmspb.SeedConversionWorkspaceRequest, opts ...gax.CallOption) (*SeedConversionWorkspaceOperation, error) {
686 return c.internalClient.SeedConversionWorkspace(ctx, req, opts...)
687 }
688
689 // SeedConversionWorkspaceOperation returns a new SeedConversionWorkspaceOperation from a given name.
690 // The name must be that of a previously created SeedConversionWorkspaceOperation, possibly from a different process.
691 func (c *DataMigrationClient) SeedConversionWorkspaceOperation(name string) *SeedConversionWorkspaceOperation {
692 return c.internalClient.SeedConversionWorkspaceOperation(name)
693 }
694
695 // ImportMappingRules imports the mapping rules for a given conversion workspace.
696 // Supports various formats of external rules files.
697 func (c *DataMigrationClient) ImportMappingRules(ctx context.Context, req *clouddmspb.ImportMappingRulesRequest, opts ...gax.CallOption) (*ImportMappingRulesOperation, error) {
698 return c.internalClient.ImportMappingRules(ctx, req, opts...)
699 }
700
701 // ImportMappingRulesOperation returns a new ImportMappingRulesOperation from a given name.
702 // The name must be that of a previously created ImportMappingRulesOperation, possibly from a different process.
703 func (c *DataMigrationClient) ImportMappingRulesOperation(name string) *ImportMappingRulesOperation {
704 return c.internalClient.ImportMappingRulesOperation(name)
705 }
706
707 // ConvertConversionWorkspace creates a draft tree schema for the destination database.
708 func (c *DataMigrationClient) ConvertConversionWorkspace(ctx context.Context, req *clouddmspb.ConvertConversionWorkspaceRequest, opts ...gax.CallOption) (*ConvertConversionWorkspaceOperation, error) {
709 return c.internalClient.ConvertConversionWorkspace(ctx, req, opts...)
710 }
711
712 // ConvertConversionWorkspaceOperation returns a new ConvertConversionWorkspaceOperation from a given name.
713 // The name must be that of a previously created ConvertConversionWorkspaceOperation, possibly from a different process.
714 func (c *DataMigrationClient) ConvertConversionWorkspaceOperation(name string) *ConvertConversionWorkspaceOperation {
715 return c.internalClient.ConvertConversionWorkspaceOperation(name)
716 }
717
718 // CommitConversionWorkspace marks all the data in the conversion workspace as committed.
719 func (c *DataMigrationClient) CommitConversionWorkspace(ctx context.Context, req *clouddmspb.CommitConversionWorkspaceRequest, opts ...gax.CallOption) (*CommitConversionWorkspaceOperation, error) {
720 return c.internalClient.CommitConversionWorkspace(ctx, req, opts...)
721 }
722
723 // CommitConversionWorkspaceOperation returns a new CommitConversionWorkspaceOperation from a given name.
724 // The name must be that of a previously created CommitConversionWorkspaceOperation, possibly from a different process.
725 func (c *DataMigrationClient) CommitConversionWorkspaceOperation(name string) *CommitConversionWorkspaceOperation {
726 return c.internalClient.CommitConversionWorkspaceOperation(name)
727 }
728
729 // RollbackConversionWorkspace rolls back a conversion workspace to the last committed snapshot.
730 func (c *DataMigrationClient) RollbackConversionWorkspace(ctx context.Context, req *clouddmspb.RollbackConversionWorkspaceRequest, opts ...gax.CallOption) (*RollbackConversionWorkspaceOperation, error) {
731 return c.internalClient.RollbackConversionWorkspace(ctx, req, opts...)
732 }
733
734 // RollbackConversionWorkspaceOperation returns a new RollbackConversionWorkspaceOperation from a given name.
735 // The name must be that of a previously created RollbackConversionWorkspaceOperation, possibly from a different process.
736 func (c *DataMigrationClient) RollbackConversionWorkspaceOperation(name string) *RollbackConversionWorkspaceOperation {
737 return c.internalClient.RollbackConversionWorkspaceOperation(name)
738 }
739
740 // ApplyConversionWorkspace applies draft tree onto a specific destination database.
741 func (c *DataMigrationClient) ApplyConversionWorkspace(ctx context.Context, req *clouddmspb.ApplyConversionWorkspaceRequest, opts ...gax.CallOption) (*ApplyConversionWorkspaceOperation, error) {
742 return c.internalClient.ApplyConversionWorkspace(ctx, req, opts...)
743 }
744
745 // ApplyConversionWorkspaceOperation returns a new ApplyConversionWorkspaceOperation from a given name.
746 // The name must be that of a previously created ApplyConversionWorkspaceOperation, possibly from a different process.
747 func (c *DataMigrationClient) ApplyConversionWorkspaceOperation(name string) *ApplyConversionWorkspaceOperation {
748 return c.internalClient.ApplyConversionWorkspaceOperation(name)
749 }
750
751 // DescribeDatabaseEntities describes the database entities tree for a specific conversion workspace
752 // and a specific tree type.
753 //
754 // Database entities are not resources like conversion workspaces or mapping
755 // rules, and they can’t be created, updated or deleted. Instead, they are
756 // simple data objects describing the structure of the client database.
757 func (c *DataMigrationClient) DescribeDatabaseEntities(ctx context.Context, req *clouddmspb.DescribeDatabaseEntitiesRequest, opts ...gax.CallOption) *DatabaseEntityIterator {
758 return c.internalClient.DescribeDatabaseEntities(ctx, req, opts...)
759 }
760
761 // SearchBackgroundJobs searches/lists the background jobs for a specific
762 // conversion workspace.
763 //
764 // The background jobs are not resources like conversion workspaces or
765 // mapping rules, and they can’t be created, updated or deleted.
766 // Instead, they are a way to expose the data plane jobs log.
767 func (c *DataMigrationClient) SearchBackgroundJobs(ctx context.Context, req *clouddmspb.SearchBackgroundJobsRequest, opts ...gax.CallOption) (*clouddmspb.SearchBackgroundJobsResponse, error) {
768 return c.internalClient.SearchBackgroundJobs(ctx, req, opts...)
769 }
770
771 // DescribeConversionWorkspaceRevisions retrieves a list of committed revisions of a specific conversion
772 // workspace.
773 func (c *DataMigrationClient) DescribeConversionWorkspaceRevisions(ctx context.Context, req *clouddmspb.DescribeConversionWorkspaceRevisionsRequest, opts ...gax.CallOption) (*clouddmspb.DescribeConversionWorkspaceRevisionsResponse, error) {
774 return c.internalClient.DescribeConversionWorkspaceRevisions(ctx, req, opts...)
775 }
776
777 // FetchStaticIps fetches a set of static IP addresses that need to be allowlisted by the
778 // customer when using the static-IP connectivity method.
779 func (c *DataMigrationClient) FetchStaticIps(ctx context.Context, req *clouddmspb.FetchStaticIpsRequest, opts ...gax.CallOption) *StringIterator {
780 return c.internalClient.FetchStaticIps(ctx, req, opts...)
781 }
782
783 // GetLocation gets information about a location.
784 func (c *DataMigrationClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
785 return c.internalClient.GetLocation(ctx, req, opts...)
786 }
787
788 // ListLocations lists information about the supported locations for this service.
789 func (c *DataMigrationClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
790 return c.internalClient.ListLocations(ctx, req, opts...)
791 }
792
793 // GetIamPolicy gets the access control policy for a resource. Returns an empty policy
794 // if the resource exists and does not have a policy set.
795 func (c *DataMigrationClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
796 return c.internalClient.GetIamPolicy(ctx, req, opts...)
797 }
798
799 // SetIamPolicy sets the access control policy on the specified resource. Replaces
800 // any existing policy.
801 //
802 // Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
803 // errors.
804 func (c *DataMigrationClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
805 return c.internalClient.SetIamPolicy(ctx, req, opts...)
806 }
807
808 // TestIamPermissions returns permissions that a caller has on the specified resource. If the
809 // resource does not exist, this will return an empty set of
810 // permissions, not a NOT_FOUND error.
811 //
812 // Note: This operation is designed to be used for building
813 // permission-aware UIs and command-line tools, not for authorization
814 // checking. This operation may “fail open” without warning.
815 func (c *DataMigrationClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
816 return c.internalClient.TestIamPermissions(ctx, req, opts...)
817 }
818
819 // CancelOperation is a utility method from google.longrunning.Operations.
820 func (c *DataMigrationClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
821 return c.internalClient.CancelOperation(ctx, req, opts...)
822 }
823
824 // DeleteOperation is a utility method from google.longrunning.Operations.
825 func (c *DataMigrationClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
826 return c.internalClient.DeleteOperation(ctx, req, opts...)
827 }
828
829 // GetOperation is a utility method from google.longrunning.Operations.
830 func (c *DataMigrationClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
831 return c.internalClient.GetOperation(ctx, req, opts...)
832 }
833
834 // ListOperations is a utility method from google.longrunning.Operations.
835 func (c *DataMigrationClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
836 return c.internalClient.ListOperations(ctx, req, opts...)
837 }
838
839 // dataMigrationGRPCClient is a client for interacting with Database Migration API over gRPC transport.
840 //
841 // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
842 type dataMigrationGRPCClient struct {
843 // Connection pool of gRPC connections to the service.
844 connPool gtransport.ConnPool
845
846 // Points back to the CallOptions field of the containing DataMigrationClient
847 CallOptions **DataMigrationCallOptions
848
849 // The gRPC API client.
850 dataMigrationClient clouddmspb.DataMigrationServiceClient
851
852 // LROClient is used internally to handle long-running operations.
853 // It is exposed so that its CallOptions can be modified if required.
854 // Users should not Close this client.
855 LROClient **lroauto.OperationsClient
856
857 operationsClient longrunningpb.OperationsClient
858
859 iamPolicyClient iampb.IAMPolicyClient
860
861 locationsClient locationpb.LocationsClient
862
863 // The x-goog-* metadata to be sent with each request.
864 xGoogHeaders []string
865
866 logger *slog.Logger
867 }
868
869 // NewDataMigrationClient creates a new data migration service client based on gRPC.
870 // The returned client must be Closed when it is done being used to clean up its underlying connections.
871 //
872 // Database Migration service
873 func NewDataMigrationClient(ctx context.Context, opts ...option.ClientOption) (*DataMigrationClient, error) {
874 clientOpts := defaultDataMigrationGRPCClientOptions()
875 if newDataMigrationClientHook != nil {
876 hookOpts, err := newDataMigrationClientHook(ctx, clientHookParams{})
877 if err != nil {
878 return nil, err
879 }
880 clientOpts = append(clientOpts, hookOpts...)
881 }
882
883 connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
884 if err != nil {
885 return nil, err
886 }
887 client := DataMigrationClient{CallOptions: defaultDataMigrationCallOptions()}
888
889 c := &dataMigrationGRPCClient{
890 connPool: connPool,
891 dataMigrationClient: clouddmspb.NewDataMigrationServiceClient(connPool),
892 CallOptions: &client.CallOptions,
893 logger: internaloption.GetLogger(opts),
894 operationsClient: longrunningpb.NewOperationsClient(connPool),
895 iamPolicyClient: iampb.NewIAMPolicyClient(connPool),
896 locationsClient: locationpb.NewLocationsClient(connPool),
897 }
898 c.setGoogleClientInfo()
899
900 client.internalClient = c
901
902 client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
903 if err != nil {
904 // This error "should not happen", since we are just reusing old connection pool
905 // and never actually need to dial.
906 // If this does happen, we could leak connp. However, we cannot close conn:
907 // If the user invoked the constructor with option.WithGRPCConn,
908 // we would close a connection that's still in use.
909 // TODO: investigate error conditions.
910 return nil, err
911 }
912 c.LROClient = &client.LROClient
913 return &client, nil
914 }
915
916 // Connection returns a connection to the API service.
917 //
918 // Deprecated: Connections are now pooled so this method does not always
919 // return the same resource.
920 func (c *dataMigrationGRPCClient) Connection() *grpc.ClientConn {
921 return c.connPool.Conn()
922 }
923
924 // setGoogleClientInfo sets the name and version of the application in
925 // the `x-goog-api-client` header passed on each request. Intended for
926 // use by Google-written clients.
927 func (c *dataMigrationGRPCClient) setGoogleClientInfo(keyval ...string) {
928 kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
929 kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion)
930 c.xGoogHeaders = []string{
931 "x-goog-api-client", gax.XGoogHeader(kv...),
932 }
933 }
934
935 // Close closes the connection to the API service. The user should invoke this when
936 // the client is no longer required.
937 func (c *dataMigrationGRPCClient) Close() error {
938 return c.connPool.Close()
939 }
940
941 func (c *dataMigrationGRPCClient) ListMigrationJobs(ctx context.Context, req *clouddmspb.ListMigrationJobsRequest, opts ...gax.CallOption) *MigrationJobIterator {
942 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
943
944 hds = append(c.xGoogHeaders, hds...)
945 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
946 opts = append((*c.CallOptions).ListMigrationJobs[0:len((*c.CallOptions).ListMigrationJobs):len((*c.CallOptions).ListMigrationJobs)], opts...)
947 it := &MigrationJobIterator{}
948 req = proto.Clone(req).(*clouddmspb.ListMigrationJobsRequest)
949 it.InternalFetch = func(pageSize int, pageToken string) ([]*clouddmspb.MigrationJob, string, error) {
950 resp := &clouddmspb.ListMigrationJobsResponse{}
951 if pageToken != "" {
952 req.PageToken = pageToken
953 }
954 if pageSize > math.MaxInt32 {
955 req.PageSize = math.MaxInt32
956 } else if pageSize != 0 {
957 req.PageSize = int32(pageSize)
958 }
959 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
960 var err error
961 resp, err = executeRPC(ctx, c.dataMigrationClient.ListMigrationJobs, req, settings.GRPC, c.logger, "ListMigrationJobs")
962 return err
963 }, opts...)
964 if err != nil {
965 return nil, "", err
966 }
967
968 it.Response = resp
969 return resp.GetMigrationJobs(), resp.GetNextPageToken(), nil
970 }
971 fetch := func(pageSize int, pageToken string) (string, error) {
972 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
973 if err != nil {
974 return "", err
975 }
976 it.items = append(it.items, items...)
977 return nextPageToken, nil
978 }
979
980 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
981 it.pageInfo.MaxSize = int(req.GetPageSize())
982 it.pageInfo.Token = req.GetPageToken()
983
984 return it
985 }
986
987 func (c *dataMigrationGRPCClient) GetMigrationJob(ctx context.Context, req *clouddmspb.GetMigrationJobRequest, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
988 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
989
990 hds = append(c.xGoogHeaders, hds...)
991 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
992 opts = append((*c.CallOptions).GetMigrationJob[0:len((*c.CallOptions).GetMigrationJob):len((*c.CallOptions).GetMigrationJob)], opts...)
993 var resp *clouddmspb.MigrationJob
994 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
995 var err error
996 resp, err = executeRPC(ctx, c.dataMigrationClient.GetMigrationJob, req, settings.GRPC, c.logger, "GetMigrationJob")
997 return err
998 }, opts...)
999 if err != nil {
1000 return nil, err
1001 }
1002 return resp, nil
1003 }
1004
1005 func (c *dataMigrationGRPCClient) CreateMigrationJob(ctx context.Context, req *clouddmspb.CreateMigrationJobRequest, opts ...gax.CallOption) (*CreateMigrationJobOperation, error) {
1006 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1007
1008 hds = append(c.xGoogHeaders, hds...)
1009 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1010 opts = append((*c.CallOptions).CreateMigrationJob[0:len((*c.CallOptions).CreateMigrationJob):len((*c.CallOptions).CreateMigrationJob)], opts...)
1011 var resp *longrunningpb.Operation
1012 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1013 var err error
1014 resp, err = executeRPC(ctx, c.dataMigrationClient.CreateMigrationJob, req, settings.GRPC, c.logger, "CreateMigrationJob")
1015 return err
1016 }, opts...)
1017 if err != nil {
1018 return nil, err
1019 }
1020 return &CreateMigrationJobOperation{
1021 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1022 }, nil
1023 }
1024
1025 func (c *dataMigrationGRPCClient) UpdateMigrationJob(ctx context.Context, req *clouddmspb.UpdateMigrationJobRequest, opts ...gax.CallOption) (*UpdateMigrationJobOperation, error) {
1026 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "migration_job.name", url.QueryEscape(req.GetMigrationJob().GetName()))}
1027
1028 hds = append(c.xGoogHeaders, hds...)
1029 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1030 opts = append((*c.CallOptions).UpdateMigrationJob[0:len((*c.CallOptions).UpdateMigrationJob):len((*c.CallOptions).UpdateMigrationJob)], opts...)
1031 var resp *longrunningpb.Operation
1032 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1033 var err error
1034 resp, err = executeRPC(ctx, c.dataMigrationClient.UpdateMigrationJob, req, settings.GRPC, c.logger, "UpdateMigrationJob")
1035 return err
1036 }, opts...)
1037 if err != nil {
1038 return nil, err
1039 }
1040 return &UpdateMigrationJobOperation{
1041 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1042 }, nil
1043 }
1044
1045 func (c *dataMigrationGRPCClient) DeleteMigrationJob(ctx context.Context, req *clouddmspb.DeleteMigrationJobRequest, opts ...gax.CallOption) (*DeleteMigrationJobOperation, error) {
1046 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1047
1048 hds = append(c.xGoogHeaders, hds...)
1049 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1050 opts = append((*c.CallOptions).DeleteMigrationJob[0:len((*c.CallOptions).DeleteMigrationJob):len((*c.CallOptions).DeleteMigrationJob)], opts...)
1051 var resp *longrunningpb.Operation
1052 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1053 var err error
1054 resp, err = executeRPC(ctx, c.dataMigrationClient.DeleteMigrationJob, req, settings.GRPC, c.logger, "DeleteMigrationJob")
1055 return err
1056 }, opts...)
1057 if err != nil {
1058 return nil, err
1059 }
1060 return &DeleteMigrationJobOperation{
1061 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1062 }, nil
1063 }
1064
1065 func (c *dataMigrationGRPCClient) StartMigrationJob(ctx context.Context, req *clouddmspb.StartMigrationJobRequest, opts ...gax.CallOption) (*StartMigrationJobOperation, error) {
1066 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1067
1068 hds = append(c.xGoogHeaders, hds...)
1069 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1070 opts = append((*c.CallOptions).StartMigrationJob[0:len((*c.CallOptions).StartMigrationJob):len((*c.CallOptions).StartMigrationJob)], opts...)
1071 var resp *longrunningpb.Operation
1072 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1073 var err error
1074 resp, err = executeRPC(ctx, c.dataMigrationClient.StartMigrationJob, req, settings.GRPC, c.logger, "StartMigrationJob")
1075 return err
1076 }, opts...)
1077 if err != nil {
1078 return nil, err
1079 }
1080 return &StartMigrationJobOperation{
1081 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1082 }, nil
1083 }
1084
1085 func (c *dataMigrationGRPCClient) StopMigrationJob(ctx context.Context, req *clouddmspb.StopMigrationJobRequest, opts ...gax.CallOption) (*StopMigrationJobOperation, error) {
1086 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1087
1088 hds = append(c.xGoogHeaders, hds...)
1089 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1090 opts = append((*c.CallOptions).StopMigrationJob[0:len((*c.CallOptions).StopMigrationJob):len((*c.CallOptions).StopMigrationJob)], opts...)
1091 var resp *longrunningpb.Operation
1092 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1093 var err error
1094 resp, err = executeRPC(ctx, c.dataMigrationClient.StopMigrationJob, req, settings.GRPC, c.logger, "StopMigrationJob")
1095 return err
1096 }, opts...)
1097 if err != nil {
1098 return nil, err
1099 }
1100 return &StopMigrationJobOperation{
1101 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1102 }, nil
1103 }
1104
1105 func (c *dataMigrationGRPCClient) ResumeMigrationJob(ctx context.Context, req *clouddmspb.ResumeMigrationJobRequest, opts ...gax.CallOption) (*ResumeMigrationJobOperation, error) {
1106 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1107
1108 hds = append(c.xGoogHeaders, hds...)
1109 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1110 opts = append((*c.CallOptions).ResumeMigrationJob[0:len((*c.CallOptions).ResumeMigrationJob):len((*c.CallOptions).ResumeMigrationJob)], opts...)
1111 var resp *longrunningpb.Operation
1112 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1113 var err error
1114 resp, err = executeRPC(ctx, c.dataMigrationClient.ResumeMigrationJob, req, settings.GRPC, c.logger, "ResumeMigrationJob")
1115 return err
1116 }, opts...)
1117 if err != nil {
1118 return nil, err
1119 }
1120 return &ResumeMigrationJobOperation{
1121 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1122 }, nil
1123 }
1124
1125 func (c *dataMigrationGRPCClient) PromoteMigrationJob(ctx context.Context, req *clouddmspb.PromoteMigrationJobRequest, opts ...gax.CallOption) (*PromoteMigrationJobOperation, error) {
1126 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1127
1128 hds = append(c.xGoogHeaders, hds...)
1129 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1130 opts = append((*c.CallOptions).PromoteMigrationJob[0:len((*c.CallOptions).PromoteMigrationJob):len((*c.CallOptions).PromoteMigrationJob)], opts...)
1131 var resp *longrunningpb.Operation
1132 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1133 var err error
1134 resp, err = executeRPC(ctx, c.dataMigrationClient.PromoteMigrationJob, req, settings.GRPC, c.logger, "PromoteMigrationJob")
1135 return err
1136 }, opts...)
1137 if err != nil {
1138 return nil, err
1139 }
1140 return &PromoteMigrationJobOperation{
1141 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1142 }, nil
1143 }
1144
1145 func (c *dataMigrationGRPCClient) VerifyMigrationJob(ctx context.Context, req *clouddmspb.VerifyMigrationJobRequest, opts ...gax.CallOption) (*VerifyMigrationJobOperation, error) {
1146 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1147
1148 hds = append(c.xGoogHeaders, hds...)
1149 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1150 opts = append((*c.CallOptions).VerifyMigrationJob[0:len((*c.CallOptions).VerifyMigrationJob):len((*c.CallOptions).VerifyMigrationJob)], opts...)
1151 var resp *longrunningpb.Operation
1152 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1153 var err error
1154 resp, err = executeRPC(ctx, c.dataMigrationClient.VerifyMigrationJob, req, settings.GRPC, c.logger, "VerifyMigrationJob")
1155 return err
1156 }, opts...)
1157 if err != nil {
1158 return nil, err
1159 }
1160 return &VerifyMigrationJobOperation{
1161 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1162 }, nil
1163 }
1164
1165 func (c *dataMigrationGRPCClient) RestartMigrationJob(ctx context.Context, req *clouddmspb.RestartMigrationJobRequest, opts ...gax.CallOption) (*RestartMigrationJobOperation, error) {
1166 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1167
1168 hds = append(c.xGoogHeaders, hds...)
1169 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1170 opts = append((*c.CallOptions).RestartMigrationJob[0:len((*c.CallOptions).RestartMigrationJob):len((*c.CallOptions).RestartMigrationJob)], opts...)
1171 var resp *longrunningpb.Operation
1172 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1173 var err error
1174 resp, err = executeRPC(ctx, c.dataMigrationClient.RestartMigrationJob, req, settings.GRPC, c.logger, "RestartMigrationJob")
1175 return err
1176 }, opts...)
1177 if err != nil {
1178 return nil, err
1179 }
1180 return &RestartMigrationJobOperation{
1181 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1182 }, nil
1183 }
1184
1185 func (c *dataMigrationGRPCClient) GenerateSshScript(ctx context.Context, req *clouddmspb.GenerateSshScriptRequest, opts ...gax.CallOption) (*clouddmspb.SshScript, error) {
1186 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "migration_job", url.QueryEscape(req.GetMigrationJob()))}
1187
1188 hds = append(c.xGoogHeaders, hds...)
1189 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1190 opts = append((*c.CallOptions).GenerateSshScript[0:len((*c.CallOptions).GenerateSshScript):len((*c.CallOptions).GenerateSshScript)], opts...)
1191 var resp *clouddmspb.SshScript
1192 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1193 var err error
1194 resp, err = executeRPC(ctx, c.dataMigrationClient.GenerateSshScript, req, settings.GRPC, c.logger, "GenerateSshScript")
1195 return err
1196 }, opts...)
1197 if err != nil {
1198 return nil, err
1199 }
1200 return resp, nil
1201 }
1202
1203 func (c *dataMigrationGRPCClient) GenerateTcpProxyScript(ctx context.Context, req *clouddmspb.GenerateTcpProxyScriptRequest, opts ...gax.CallOption) (*clouddmspb.TcpProxyScript, error) {
1204 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "migration_job", url.QueryEscape(req.GetMigrationJob()))}
1205
1206 hds = append(c.xGoogHeaders, hds...)
1207 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1208 opts = append((*c.CallOptions).GenerateTcpProxyScript[0:len((*c.CallOptions).GenerateTcpProxyScript):len((*c.CallOptions).GenerateTcpProxyScript)], opts...)
1209 var resp *clouddmspb.TcpProxyScript
1210 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1211 var err error
1212 resp, err = executeRPC(ctx, c.dataMigrationClient.GenerateTcpProxyScript, req, settings.GRPC, c.logger, "GenerateTcpProxyScript")
1213 return err
1214 }, opts...)
1215 if err != nil {
1216 return nil, err
1217 }
1218 return resp, nil
1219 }
1220
1221 func (c *dataMigrationGRPCClient) ListConnectionProfiles(ctx context.Context, req *clouddmspb.ListConnectionProfilesRequest, opts ...gax.CallOption) *ConnectionProfileIterator {
1222 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1223
1224 hds = append(c.xGoogHeaders, hds...)
1225 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1226 opts = append((*c.CallOptions).ListConnectionProfiles[0:len((*c.CallOptions).ListConnectionProfiles):len((*c.CallOptions).ListConnectionProfiles)], opts...)
1227 it := &ConnectionProfileIterator{}
1228 req = proto.Clone(req).(*clouddmspb.ListConnectionProfilesRequest)
1229 it.InternalFetch = func(pageSize int, pageToken string) ([]*clouddmspb.ConnectionProfile, string, error) {
1230 resp := &clouddmspb.ListConnectionProfilesResponse{}
1231 if pageToken != "" {
1232 req.PageToken = pageToken
1233 }
1234 if pageSize > math.MaxInt32 {
1235 req.PageSize = math.MaxInt32
1236 } else if pageSize != 0 {
1237 req.PageSize = int32(pageSize)
1238 }
1239 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1240 var err error
1241 resp, err = executeRPC(ctx, c.dataMigrationClient.ListConnectionProfiles, req, settings.GRPC, c.logger, "ListConnectionProfiles")
1242 return err
1243 }, opts...)
1244 if err != nil {
1245 return nil, "", err
1246 }
1247
1248 it.Response = resp
1249 return resp.GetConnectionProfiles(), resp.GetNextPageToken(), nil
1250 }
1251 fetch := func(pageSize int, pageToken string) (string, error) {
1252 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1253 if err != nil {
1254 return "", err
1255 }
1256 it.items = append(it.items, items...)
1257 return nextPageToken, nil
1258 }
1259
1260 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1261 it.pageInfo.MaxSize = int(req.GetPageSize())
1262 it.pageInfo.Token = req.GetPageToken()
1263
1264 return it
1265 }
1266
1267 func (c *dataMigrationGRPCClient) GetConnectionProfile(ctx context.Context, req *clouddmspb.GetConnectionProfileRequest, opts ...gax.CallOption) (*clouddmspb.ConnectionProfile, error) {
1268 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1269
1270 hds = append(c.xGoogHeaders, hds...)
1271 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1272 opts = append((*c.CallOptions).GetConnectionProfile[0:len((*c.CallOptions).GetConnectionProfile):len((*c.CallOptions).GetConnectionProfile)], opts...)
1273 var resp *clouddmspb.ConnectionProfile
1274 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1275 var err error
1276 resp, err = executeRPC(ctx, c.dataMigrationClient.GetConnectionProfile, req, settings.GRPC, c.logger, "GetConnectionProfile")
1277 return err
1278 }, opts...)
1279 if err != nil {
1280 return nil, err
1281 }
1282 return resp, nil
1283 }
1284
1285 func (c *dataMigrationGRPCClient) CreateConnectionProfile(ctx context.Context, req *clouddmspb.CreateConnectionProfileRequest, opts ...gax.CallOption) (*CreateConnectionProfileOperation, error) {
1286 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1287
1288 hds = append(c.xGoogHeaders, hds...)
1289 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1290 opts = append((*c.CallOptions).CreateConnectionProfile[0:len((*c.CallOptions).CreateConnectionProfile):len((*c.CallOptions).CreateConnectionProfile)], opts...)
1291 var resp *longrunningpb.Operation
1292 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1293 var err error
1294 resp, err = executeRPC(ctx, c.dataMigrationClient.CreateConnectionProfile, req, settings.GRPC, c.logger, "CreateConnectionProfile")
1295 return err
1296 }, opts...)
1297 if err != nil {
1298 return nil, err
1299 }
1300 return &CreateConnectionProfileOperation{
1301 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1302 }, nil
1303 }
1304
1305 func (c *dataMigrationGRPCClient) UpdateConnectionProfile(ctx context.Context, req *clouddmspb.UpdateConnectionProfileRequest, opts ...gax.CallOption) (*UpdateConnectionProfileOperation, error) {
1306 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "connection_profile.name", url.QueryEscape(req.GetConnectionProfile().GetName()))}
1307
1308 hds = append(c.xGoogHeaders, hds...)
1309 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1310 opts = append((*c.CallOptions).UpdateConnectionProfile[0:len((*c.CallOptions).UpdateConnectionProfile):len((*c.CallOptions).UpdateConnectionProfile)], opts...)
1311 var resp *longrunningpb.Operation
1312 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1313 var err error
1314 resp, err = executeRPC(ctx, c.dataMigrationClient.UpdateConnectionProfile, req, settings.GRPC, c.logger, "UpdateConnectionProfile")
1315 return err
1316 }, opts...)
1317 if err != nil {
1318 return nil, err
1319 }
1320 return &UpdateConnectionProfileOperation{
1321 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1322 }, nil
1323 }
1324
1325 func (c *dataMigrationGRPCClient) DeleteConnectionProfile(ctx context.Context, req *clouddmspb.DeleteConnectionProfileRequest, opts ...gax.CallOption) (*DeleteConnectionProfileOperation, error) {
1326 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1327
1328 hds = append(c.xGoogHeaders, hds...)
1329 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1330 opts = append((*c.CallOptions).DeleteConnectionProfile[0:len((*c.CallOptions).DeleteConnectionProfile):len((*c.CallOptions).DeleteConnectionProfile)], opts...)
1331 var resp *longrunningpb.Operation
1332 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1333 var err error
1334 resp, err = executeRPC(ctx, c.dataMigrationClient.DeleteConnectionProfile, req, settings.GRPC, c.logger, "DeleteConnectionProfile")
1335 return err
1336 }, opts...)
1337 if err != nil {
1338 return nil, err
1339 }
1340 return &DeleteConnectionProfileOperation{
1341 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1342 }, nil
1343 }
1344
1345 func (c *dataMigrationGRPCClient) CreatePrivateConnection(ctx context.Context, req *clouddmspb.CreatePrivateConnectionRequest, opts ...gax.CallOption) (*CreatePrivateConnectionOperation, error) {
1346 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1347
1348 hds = append(c.xGoogHeaders, hds...)
1349 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1350 opts = append((*c.CallOptions).CreatePrivateConnection[0:len((*c.CallOptions).CreatePrivateConnection):len((*c.CallOptions).CreatePrivateConnection)], opts...)
1351 var resp *longrunningpb.Operation
1352 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1353 var err error
1354 resp, err = executeRPC(ctx, c.dataMigrationClient.CreatePrivateConnection, req, settings.GRPC, c.logger, "CreatePrivateConnection")
1355 return err
1356 }, opts...)
1357 if err != nil {
1358 return nil, err
1359 }
1360 return &CreatePrivateConnectionOperation{
1361 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1362 }, nil
1363 }
1364
1365 func (c *dataMigrationGRPCClient) GetPrivateConnection(ctx context.Context, req *clouddmspb.GetPrivateConnectionRequest, opts ...gax.CallOption) (*clouddmspb.PrivateConnection, error) {
1366 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1367
1368 hds = append(c.xGoogHeaders, hds...)
1369 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1370 opts = append((*c.CallOptions).GetPrivateConnection[0:len((*c.CallOptions).GetPrivateConnection):len((*c.CallOptions).GetPrivateConnection)], opts...)
1371 var resp *clouddmspb.PrivateConnection
1372 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1373 var err error
1374 resp, err = executeRPC(ctx, c.dataMigrationClient.GetPrivateConnection, req, settings.GRPC, c.logger, "GetPrivateConnection")
1375 return err
1376 }, opts...)
1377 if err != nil {
1378 return nil, err
1379 }
1380 return resp, nil
1381 }
1382
1383 func (c *dataMigrationGRPCClient) ListPrivateConnections(ctx context.Context, req *clouddmspb.ListPrivateConnectionsRequest, opts ...gax.CallOption) *PrivateConnectionIterator {
1384 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1385
1386 hds = append(c.xGoogHeaders, hds...)
1387 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1388 opts = append((*c.CallOptions).ListPrivateConnections[0:len((*c.CallOptions).ListPrivateConnections):len((*c.CallOptions).ListPrivateConnections)], opts...)
1389 it := &PrivateConnectionIterator{}
1390 req = proto.Clone(req).(*clouddmspb.ListPrivateConnectionsRequest)
1391 it.InternalFetch = func(pageSize int, pageToken string) ([]*clouddmspb.PrivateConnection, string, error) {
1392 resp := &clouddmspb.ListPrivateConnectionsResponse{}
1393 if pageToken != "" {
1394 req.PageToken = pageToken
1395 }
1396 if pageSize > math.MaxInt32 {
1397 req.PageSize = math.MaxInt32
1398 } else if pageSize != 0 {
1399 req.PageSize = int32(pageSize)
1400 }
1401 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1402 var err error
1403 resp, err = executeRPC(ctx, c.dataMigrationClient.ListPrivateConnections, req, settings.GRPC, c.logger, "ListPrivateConnections")
1404 return err
1405 }, opts...)
1406 if err != nil {
1407 return nil, "", err
1408 }
1409
1410 it.Response = resp
1411 return resp.GetPrivateConnections(), resp.GetNextPageToken(), nil
1412 }
1413 fetch := func(pageSize int, pageToken string) (string, error) {
1414 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1415 if err != nil {
1416 return "", err
1417 }
1418 it.items = append(it.items, items...)
1419 return nextPageToken, nil
1420 }
1421
1422 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1423 it.pageInfo.MaxSize = int(req.GetPageSize())
1424 it.pageInfo.Token = req.GetPageToken()
1425
1426 return it
1427 }
1428
1429 func (c *dataMigrationGRPCClient) DeletePrivateConnection(ctx context.Context, req *clouddmspb.DeletePrivateConnectionRequest, opts ...gax.CallOption) (*DeletePrivateConnectionOperation, error) {
1430 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1431
1432 hds = append(c.xGoogHeaders, hds...)
1433 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1434 opts = append((*c.CallOptions).DeletePrivateConnection[0:len((*c.CallOptions).DeletePrivateConnection):len((*c.CallOptions).DeletePrivateConnection)], opts...)
1435 var resp *longrunningpb.Operation
1436 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1437 var err error
1438 resp, err = executeRPC(ctx, c.dataMigrationClient.DeletePrivateConnection, req, settings.GRPC, c.logger, "DeletePrivateConnection")
1439 return err
1440 }, opts...)
1441 if err != nil {
1442 return nil, err
1443 }
1444 return &DeletePrivateConnectionOperation{
1445 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1446 }, nil
1447 }
1448
1449 func (c *dataMigrationGRPCClient) GetConversionWorkspace(ctx context.Context, req *clouddmspb.GetConversionWorkspaceRequest, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
1450 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1451
1452 hds = append(c.xGoogHeaders, hds...)
1453 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1454 opts = append((*c.CallOptions).GetConversionWorkspace[0:len((*c.CallOptions).GetConversionWorkspace):len((*c.CallOptions).GetConversionWorkspace)], opts...)
1455 var resp *clouddmspb.ConversionWorkspace
1456 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1457 var err error
1458 resp, err = executeRPC(ctx, c.dataMigrationClient.GetConversionWorkspace, req, settings.GRPC, c.logger, "GetConversionWorkspace")
1459 return err
1460 }, opts...)
1461 if err != nil {
1462 return nil, err
1463 }
1464 return resp, nil
1465 }
1466
1467 func (c *dataMigrationGRPCClient) ListConversionWorkspaces(ctx context.Context, req *clouddmspb.ListConversionWorkspacesRequest, opts ...gax.CallOption) *ConversionWorkspaceIterator {
1468 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1469
1470 hds = append(c.xGoogHeaders, hds...)
1471 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1472 opts = append((*c.CallOptions).ListConversionWorkspaces[0:len((*c.CallOptions).ListConversionWorkspaces):len((*c.CallOptions).ListConversionWorkspaces)], opts...)
1473 it := &ConversionWorkspaceIterator{}
1474 req = proto.Clone(req).(*clouddmspb.ListConversionWorkspacesRequest)
1475 it.InternalFetch = func(pageSize int, pageToken string) ([]*clouddmspb.ConversionWorkspace, string, error) {
1476 resp := &clouddmspb.ListConversionWorkspacesResponse{}
1477 if pageToken != "" {
1478 req.PageToken = pageToken
1479 }
1480 if pageSize > math.MaxInt32 {
1481 req.PageSize = math.MaxInt32
1482 } else if pageSize != 0 {
1483 req.PageSize = int32(pageSize)
1484 }
1485 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1486 var err error
1487 resp, err = executeRPC(ctx, c.dataMigrationClient.ListConversionWorkspaces, req, settings.GRPC, c.logger, "ListConversionWorkspaces")
1488 return err
1489 }, opts...)
1490 if err != nil {
1491 return nil, "", err
1492 }
1493
1494 it.Response = resp
1495 return resp.GetConversionWorkspaces(), resp.GetNextPageToken(), nil
1496 }
1497 fetch := func(pageSize int, pageToken string) (string, error) {
1498 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1499 if err != nil {
1500 return "", err
1501 }
1502 it.items = append(it.items, items...)
1503 return nextPageToken, nil
1504 }
1505
1506 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1507 it.pageInfo.MaxSize = int(req.GetPageSize())
1508 it.pageInfo.Token = req.GetPageToken()
1509
1510 return it
1511 }
1512
1513 func (c *dataMigrationGRPCClient) CreateConversionWorkspace(ctx context.Context, req *clouddmspb.CreateConversionWorkspaceRequest, opts ...gax.CallOption) (*CreateConversionWorkspaceOperation, error) {
1514 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1515
1516 hds = append(c.xGoogHeaders, hds...)
1517 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1518 opts = append((*c.CallOptions).CreateConversionWorkspace[0:len((*c.CallOptions).CreateConversionWorkspace):len((*c.CallOptions).CreateConversionWorkspace)], opts...)
1519 var resp *longrunningpb.Operation
1520 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1521 var err error
1522 resp, err = executeRPC(ctx, c.dataMigrationClient.CreateConversionWorkspace, req, settings.GRPC, c.logger, "CreateConversionWorkspace")
1523 return err
1524 }, opts...)
1525 if err != nil {
1526 return nil, err
1527 }
1528 return &CreateConversionWorkspaceOperation{
1529 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1530 }, nil
1531 }
1532
1533 func (c *dataMigrationGRPCClient) UpdateConversionWorkspace(ctx context.Context, req *clouddmspb.UpdateConversionWorkspaceRequest, opts ...gax.CallOption) (*UpdateConversionWorkspaceOperation, error) {
1534 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversion_workspace.name", url.QueryEscape(req.GetConversionWorkspace().GetName()))}
1535
1536 hds = append(c.xGoogHeaders, hds...)
1537 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1538 opts = append((*c.CallOptions).UpdateConversionWorkspace[0:len((*c.CallOptions).UpdateConversionWorkspace):len((*c.CallOptions).UpdateConversionWorkspace)], opts...)
1539 var resp *longrunningpb.Operation
1540 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1541 var err error
1542 resp, err = executeRPC(ctx, c.dataMigrationClient.UpdateConversionWorkspace, req, settings.GRPC, c.logger, "UpdateConversionWorkspace")
1543 return err
1544 }, opts...)
1545 if err != nil {
1546 return nil, err
1547 }
1548 return &UpdateConversionWorkspaceOperation{
1549 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1550 }, nil
1551 }
1552
1553 func (c *dataMigrationGRPCClient) DeleteConversionWorkspace(ctx context.Context, req *clouddmspb.DeleteConversionWorkspaceRequest, opts ...gax.CallOption) (*DeleteConversionWorkspaceOperation, error) {
1554 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1555
1556 hds = append(c.xGoogHeaders, hds...)
1557 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1558 opts = append((*c.CallOptions).DeleteConversionWorkspace[0:len((*c.CallOptions).DeleteConversionWorkspace):len((*c.CallOptions).DeleteConversionWorkspace)], opts...)
1559 var resp *longrunningpb.Operation
1560 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1561 var err error
1562 resp, err = executeRPC(ctx, c.dataMigrationClient.DeleteConversionWorkspace, req, settings.GRPC, c.logger, "DeleteConversionWorkspace")
1563 return err
1564 }, opts...)
1565 if err != nil {
1566 return nil, err
1567 }
1568 return &DeleteConversionWorkspaceOperation{
1569 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1570 }, nil
1571 }
1572
1573 func (c *dataMigrationGRPCClient) CreateMappingRule(ctx context.Context, req *clouddmspb.CreateMappingRuleRequest, opts ...gax.CallOption) (*clouddmspb.MappingRule, error) {
1574 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1575
1576 hds = append(c.xGoogHeaders, hds...)
1577 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1578 opts = append((*c.CallOptions).CreateMappingRule[0:len((*c.CallOptions).CreateMappingRule):len((*c.CallOptions).CreateMappingRule)], opts...)
1579 var resp *clouddmspb.MappingRule
1580 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1581 var err error
1582 resp, err = executeRPC(ctx, c.dataMigrationClient.CreateMappingRule, req, settings.GRPC, c.logger, "CreateMappingRule")
1583 return err
1584 }, opts...)
1585 if err != nil {
1586 return nil, err
1587 }
1588 return resp, nil
1589 }
1590
1591 func (c *dataMigrationGRPCClient) DeleteMappingRule(ctx context.Context, req *clouddmspb.DeleteMappingRuleRequest, opts ...gax.CallOption) error {
1592 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1593
1594 hds = append(c.xGoogHeaders, hds...)
1595 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1596 opts = append((*c.CallOptions).DeleteMappingRule[0:len((*c.CallOptions).DeleteMappingRule):len((*c.CallOptions).DeleteMappingRule)], opts...)
1597 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1598 var err error
1599 _, err = executeRPC(ctx, c.dataMigrationClient.DeleteMappingRule, req, settings.GRPC, c.logger, "DeleteMappingRule")
1600 return err
1601 }, opts...)
1602 return err
1603 }
1604
1605 func (c *dataMigrationGRPCClient) ListMappingRules(ctx context.Context, req *clouddmspb.ListMappingRulesRequest, opts ...gax.CallOption) *MappingRuleIterator {
1606 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1607
1608 hds = append(c.xGoogHeaders, hds...)
1609 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1610 opts = append((*c.CallOptions).ListMappingRules[0:len((*c.CallOptions).ListMappingRules):len((*c.CallOptions).ListMappingRules)], opts...)
1611 it := &MappingRuleIterator{}
1612 req = proto.Clone(req).(*clouddmspb.ListMappingRulesRequest)
1613 it.InternalFetch = func(pageSize int, pageToken string) ([]*clouddmspb.MappingRule, string, error) {
1614 resp := &clouddmspb.ListMappingRulesResponse{}
1615 if pageToken != "" {
1616 req.PageToken = pageToken
1617 }
1618 if pageSize > math.MaxInt32 {
1619 req.PageSize = math.MaxInt32
1620 } else if pageSize != 0 {
1621 req.PageSize = int32(pageSize)
1622 }
1623 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1624 var err error
1625 resp, err = executeRPC(ctx, c.dataMigrationClient.ListMappingRules, req, settings.GRPC, c.logger, "ListMappingRules")
1626 return err
1627 }, opts...)
1628 if err != nil {
1629 return nil, "", err
1630 }
1631
1632 it.Response = resp
1633 return resp.GetMappingRules(), resp.GetNextPageToken(), nil
1634 }
1635 fetch := func(pageSize int, pageToken string) (string, error) {
1636 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1637 if err != nil {
1638 return "", err
1639 }
1640 it.items = append(it.items, items...)
1641 return nextPageToken, nil
1642 }
1643
1644 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1645 it.pageInfo.MaxSize = int(req.GetPageSize())
1646 it.pageInfo.Token = req.GetPageToken()
1647
1648 return it
1649 }
1650
1651 func (c *dataMigrationGRPCClient) GetMappingRule(ctx context.Context, req *clouddmspb.GetMappingRuleRequest, opts ...gax.CallOption) (*clouddmspb.MappingRule, error) {
1652 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1653
1654 hds = append(c.xGoogHeaders, hds...)
1655 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1656 opts = append((*c.CallOptions).GetMappingRule[0:len((*c.CallOptions).GetMappingRule):len((*c.CallOptions).GetMappingRule)], opts...)
1657 var resp *clouddmspb.MappingRule
1658 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1659 var err error
1660 resp, err = executeRPC(ctx, c.dataMigrationClient.GetMappingRule, req, settings.GRPC, c.logger, "GetMappingRule")
1661 return err
1662 }, opts...)
1663 if err != nil {
1664 return nil, err
1665 }
1666 return resp, nil
1667 }
1668
1669 func (c *dataMigrationGRPCClient) SeedConversionWorkspace(ctx context.Context, req *clouddmspb.SeedConversionWorkspaceRequest, opts ...gax.CallOption) (*SeedConversionWorkspaceOperation, error) {
1670 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1671
1672 hds = append(c.xGoogHeaders, hds...)
1673 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1674 opts = append((*c.CallOptions).SeedConversionWorkspace[0:len((*c.CallOptions).SeedConversionWorkspace):len((*c.CallOptions).SeedConversionWorkspace)], opts...)
1675 var resp *longrunningpb.Operation
1676 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1677 var err error
1678 resp, err = executeRPC(ctx, c.dataMigrationClient.SeedConversionWorkspace, req, settings.GRPC, c.logger, "SeedConversionWorkspace")
1679 return err
1680 }, opts...)
1681 if err != nil {
1682 return nil, err
1683 }
1684 return &SeedConversionWorkspaceOperation{
1685 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1686 }, nil
1687 }
1688
1689 func (c *dataMigrationGRPCClient) ImportMappingRules(ctx context.Context, req *clouddmspb.ImportMappingRulesRequest, opts ...gax.CallOption) (*ImportMappingRulesOperation, error) {
1690 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
1691
1692 hds = append(c.xGoogHeaders, hds...)
1693 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1694 opts = append((*c.CallOptions).ImportMappingRules[0:len((*c.CallOptions).ImportMappingRules):len((*c.CallOptions).ImportMappingRules)], opts...)
1695 var resp *longrunningpb.Operation
1696 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1697 var err error
1698 resp, err = executeRPC(ctx, c.dataMigrationClient.ImportMappingRules, req, settings.GRPC, c.logger, "ImportMappingRules")
1699 return err
1700 }, opts...)
1701 if err != nil {
1702 return nil, err
1703 }
1704 return &ImportMappingRulesOperation{
1705 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1706 }, nil
1707 }
1708
1709 func (c *dataMigrationGRPCClient) ConvertConversionWorkspace(ctx context.Context, req *clouddmspb.ConvertConversionWorkspaceRequest, opts ...gax.CallOption) (*ConvertConversionWorkspaceOperation, error) {
1710 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1711
1712 hds = append(c.xGoogHeaders, hds...)
1713 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1714 opts = append((*c.CallOptions).ConvertConversionWorkspace[0:len((*c.CallOptions).ConvertConversionWorkspace):len((*c.CallOptions).ConvertConversionWorkspace)], opts...)
1715 var resp *longrunningpb.Operation
1716 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1717 var err error
1718 resp, err = executeRPC(ctx, c.dataMigrationClient.ConvertConversionWorkspace, req, settings.GRPC, c.logger, "ConvertConversionWorkspace")
1719 return err
1720 }, opts...)
1721 if err != nil {
1722 return nil, err
1723 }
1724 return &ConvertConversionWorkspaceOperation{
1725 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1726 }, nil
1727 }
1728
1729 func (c *dataMigrationGRPCClient) CommitConversionWorkspace(ctx context.Context, req *clouddmspb.CommitConversionWorkspaceRequest, opts ...gax.CallOption) (*CommitConversionWorkspaceOperation, error) {
1730 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1731
1732 hds = append(c.xGoogHeaders, hds...)
1733 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1734 opts = append((*c.CallOptions).CommitConversionWorkspace[0:len((*c.CallOptions).CommitConversionWorkspace):len((*c.CallOptions).CommitConversionWorkspace)], opts...)
1735 var resp *longrunningpb.Operation
1736 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1737 var err error
1738 resp, err = executeRPC(ctx, c.dataMigrationClient.CommitConversionWorkspace, req, settings.GRPC, c.logger, "CommitConversionWorkspace")
1739 return err
1740 }, opts...)
1741 if err != nil {
1742 return nil, err
1743 }
1744 return &CommitConversionWorkspaceOperation{
1745 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1746 }, nil
1747 }
1748
1749 func (c *dataMigrationGRPCClient) RollbackConversionWorkspace(ctx context.Context, req *clouddmspb.RollbackConversionWorkspaceRequest, opts ...gax.CallOption) (*RollbackConversionWorkspaceOperation, error) {
1750 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1751
1752 hds = append(c.xGoogHeaders, hds...)
1753 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1754 opts = append((*c.CallOptions).RollbackConversionWorkspace[0:len((*c.CallOptions).RollbackConversionWorkspace):len((*c.CallOptions).RollbackConversionWorkspace)], opts...)
1755 var resp *longrunningpb.Operation
1756 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1757 var err error
1758 resp, err = executeRPC(ctx, c.dataMigrationClient.RollbackConversionWorkspace, req, settings.GRPC, c.logger, "RollbackConversionWorkspace")
1759 return err
1760 }, opts...)
1761 if err != nil {
1762 return nil, err
1763 }
1764 return &RollbackConversionWorkspaceOperation{
1765 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1766 }, nil
1767 }
1768
1769 func (c *dataMigrationGRPCClient) ApplyConversionWorkspace(ctx context.Context, req *clouddmspb.ApplyConversionWorkspaceRequest, opts ...gax.CallOption) (*ApplyConversionWorkspaceOperation, error) {
1770 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1771
1772 hds = append(c.xGoogHeaders, hds...)
1773 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1774 opts = append((*c.CallOptions).ApplyConversionWorkspace[0:len((*c.CallOptions).ApplyConversionWorkspace):len((*c.CallOptions).ApplyConversionWorkspace)], opts...)
1775 var resp *longrunningpb.Operation
1776 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1777 var err error
1778 resp, err = executeRPC(ctx, c.dataMigrationClient.ApplyConversionWorkspace, req, settings.GRPC, c.logger, "ApplyConversionWorkspace")
1779 return err
1780 }, opts...)
1781 if err != nil {
1782 return nil, err
1783 }
1784 return &ApplyConversionWorkspaceOperation{
1785 lro: longrunning.InternalNewOperation(*c.LROClient, resp),
1786 }, nil
1787 }
1788
1789 func (c *dataMigrationGRPCClient) DescribeDatabaseEntities(ctx context.Context, req *clouddmspb.DescribeDatabaseEntitiesRequest, opts ...gax.CallOption) *DatabaseEntityIterator {
1790 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversion_workspace", url.QueryEscape(req.GetConversionWorkspace()))}
1791
1792 hds = append(c.xGoogHeaders, hds...)
1793 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1794 opts = append((*c.CallOptions).DescribeDatabaseEntities[0:len((*c.CallOptions).DescribeDatabaseEntities):len((*c.CallOptions).DescribeDatabaseEntities)], opts...)
1795 it := &DatabaseEntityIterator{}
1796 req = proto.Clone(req).(*clouddmspb.DescribeDatabaseEntitiesRequest)
1797 it.InternalFetch = func(pageSize int, pageToken string) ([]*clouddmspb.DatabaseEntity, string, error) {
1798 resp := &clouddmspb.DescribeDatabaseEntitiesResponse{}
1799 if pageToken != "" {
1800 req.PageToken = pageToken
1801 }
1802 if pageSize > math.MaxInt32 {
1803 req.PageSize = math.MaxInt32
1804 } else if pageSize != 0 {
1805 req.PageSize = int32(pageSize)
1806 }
1807 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1808 var err error
1809 resp, err = executeRPC(ctx, c.dataMigrationClient.DescribeDatabaseEntities, req, settings.GRPC, c.logger, "DescribeDatabaseEntities")
1810 return err
1811 }, opts...)
1812 if err != nil {
1813 return nil, "", err
1814 }
1815
1816 it.Response = resp
1817 return resp.GetDatabaseEntities(), resp.GetNextPageToken(), nil
1818 }
1819 fetch := func(pageSize int, pageToken string) (string, error) {
1820 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1821 if err != nil {
1822 return "", err
1823 }
1824 it.items = append(it.items, items...)
1825 return nextPageToken, nil
1826 }
1827
1828 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1829 it.pageInfo.MaxSize = int(req.GetPageSize())
1830 it.pageInfo.Token = req.GetPageToken()
1831
1832 return it
1833 }
1834
1835 func (c *dataMigrationGRPCClient) SearchBackgroundJobs(ctx context.Context, req *clouddmspb.SearchBackgroundJobsRequest, opts ...gax.CallOption) (*clouddmspb.SearchBackgroundJobsResponse, error) {
1836 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversion_workspace", url.QueryEscape(req.GetConversionWorkspace()))}
1837
1838 hds = append(c.xGoogHeaders, hds...)
1839 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1840 opts = append((*c.CallOptions).SearchBackgroundJobs[0:len((*c.CallOptions).SearchBackgroundJobs):len((*c.CallOptions).SearchBackgroundJobs)], opts...)
1841 var resp *clouddmspb.SearchBackgroundJobsResponse
1842 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1843 var err error
1844 resp, err = executeRPC(ctx, c.dataMigrationClient.SearchBackgroundJobs, req, settings.GRPC, c.logger, "SearchBackgroundJobs")
1845 return err
1846 }, opts...)
1847 if err != nil {
1848 return nil, err
1849 }
1850 return resp, nil
1851 }
1852
1853 func (c *dataMigrationGRPCClient) DescribeConversionWorkspaceRevisions(ctx context.Context, req *clouddmspb.DescribeConversionWorkspaceRevisionsRequest, opts ...gax.CallOption) (*clouddmspb.DescribeConversionWorkspaceRevisionsResponse, error) {
1854 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "conversion_workspace", url.QueryEscape(req.GetConversionWorkspace()))}
1855
1856 hds = append(c.xGoogHeaders, hds...)
1857 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1858 opts = append((*c.CallOptions).DescribeConversionWorkspaceRevisions[0:len((*c.CallOptions).DescribeConversionWorkspaceRevisions):len((*c.CallOptions).DescribeConversionWorkspaceRevisions)], opts...)
1859 var resp *clouddmspb.DescribeConversionWorkspaceRevisionsResponse
1860 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1861 var err error
1862 resp, err = executeRPC(ctx, c.dataMigrationClient.DescribeConversionWorkspaceRevisions, req, settings.GRPC, c.logger, "DescribeConversionWorkspaceRevisions")
1863 return err
1864 }, opts...)
1865 if err != nil {
1866 return nil, err
1867 }
1868 return resp, nil
1869 }
1870
1871 func (c *dataMigrationGRPCClient) FetchStaticIps(ctx context.Context, req *clouddmspb.FetchStaticIpsRequest, opts ...gax.CallOption) *StringIterator {
1872 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1873
1874 hds = append(c.xGoogHeaders, hds...)
1875 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1876 opts = append((*c.CallOptions).FetchStaticIps[0:len((*c.CallOptions).FetchStaticIps):len((*c.CallOptions).FetchStaticIps)], opts...)
1877 it := &StringIterator{}
1878 req = proto.Clone(req).(*clouddmspb.FetchStaticIpsRequest)
1879 it.InternalFetch = func(pageSize int, pageToken string) ([]string, string, error) {
1880 resp := &clouddmspb.FetchStaticIpsResponse{}
1881 if pageToken != "" {
1882 req.PageToken = pageToken
1883 }
1884 if pageSize > math.MaxInt32 {
1885 req.PageSize = math.MaxInt32
1886 } else if pageSize != 0 {
1887 req.PageSize = int32(pageSize)
1888 }
1889 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1890 var err error
1891 resp, err = executeRPC(ctx, c.dataMigrationClient.FetchStaticIps, req, settings.GRPC, c.logger, "FetchStaticIps")
1892 return err
1893 }, opts...)
1894 if err != nil {
1895 return nil, "", err
1896 }
1897
1898 it.Response = resp
1899 return resp.GetStaticIps(), resp.GetNextPageToken(), nil
1900 }
1901 fetch := func(pageSize int, pageToken string) (string, error) {
1902 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1903 if err != nil {
1904 return "", err
1905 }
1906 it.items = append(it.items, items...)
1907 return nextPageToken, nil
1908 }
1909
1910 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1911 it.pageInfo.MaxSize = int(req.GetPageSize())
1912 it.pageInfo.Token = req.GetPageToken()
1913
1914 return it
1915 }
1916
1917 func (c *dataMigrationGRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) {
1918 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1919
1920 hds = append(c.xGoogHeaders, hds...)
1921 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1922 opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...)
1923 var resp *locationpb.Location
1924 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1925 var err error
1926 resp, err = executeRPC(ctx, c.locationsClient.GetLocation, req, settings.GRPC, c.logger, "GetLocation")
1927 return err
1928 }, opts...)
1929 if err != nil {
1930 return nil, err
1931 }
1932 return resp, nil
1933 }
1934
1935 func (c *dataMigrationGRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator {
1936 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
1937
1938 hds = append(c.xGoogHeaders, hds...)
1939 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1940 opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...)
1941 it := &LocationIterator{}
1942 req = proto.Clone(req).(*locationpb.ListLocationsRequest)
1943 it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) {
1944 resp := &locationpb.ListLocationsResponse{}
1945 if pageToken != "" {
1946 req.PageToken = pageToken
1947 }
1948 if pageSize > math.MaxInt32 {
1949 req.PageSize = math.MaxInt32
1950 } else if pageSize != 0 {
1951 req.PageSize = int32(pageSize)
1952 }
1953 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1954 var err error
1955 resp, err = executeRPC(ctx, c.locationsClient.ListLocations, req, settings.GRPC, c.logger, "ListLocations")
1956 return err
1957 }, opts...)
1958 if err != nil {
1959 return nil, "", err
1960 }
1961
1962 it.Response = resp
1963 return resp.GetLocations(), resp.GetNextPageToken(), nil
1964 }
1965 fetch := func(pageSize int, pageToken string) (string, error) {
1966 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
1967 if err != nil {
1968 return "", err
1969 }
1970 it.items = append(it.items, items...)
1971 return nextPageToken, nil
1972 }
1973
1974 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
1975 it.pageInfo.MaxSize = int(req.GetPageSize())
1976 it.pageInfo.Token = req.GetPageToken()
1977
1978 return it
1979 }
1980
1981 func (c *dataMigrationGRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
1982 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
1983
1984 hds = append(c.xGoogHeaders, hds...)
1985 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
1986 opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...)
1987 var resp *iampb.Policy
1988 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
1989 var err error
1990 resp, err = executeRPC(ctx, c.iamPolicyClient.GetIamPolicy, req, settings.GRPC, c.logger, "GetIamPolicy")
1991 return err
1992 }, opts...)
1993 if err != nil {
1994 return nil, err
1995 }
1996 return resp, nil
1997 }
1998
1999 func (c *dataMigrationGRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
2000 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
2001
2002 hds = append(c.xGoogHeaders, hds...)
2003 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2004 opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...)
2005 var resp *iampb.Policy
2006 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2007 var err error
2008 resp, err = executeRPC(ctx, c.iamPolicyClient.SetIamPolicy, req, settings.GRPC, c.logger, "SetIamPolicy")
2009 return err
2010 }, opts...)
2011 if err != nil {
2012 return nil, err
2013 }
2014 return resp, nil
2015 }
2016
2017 func (c *dataMigrationGRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
2018 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))}
2019
2020 hds = append(c.xGoogHeaders, hds...)
2021 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2022 opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
2023 var resp *iampb.TestIamPermissionsResponse
2024 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2025 var err error
2026 resp, err = executeRPC(ctx, c.iamPolicyClient.TestIamPermissions, req, settings.GRPC, c.logger, "TestIamPermissions")
2027 return err
2028 }, opts...)
2029 if err != nil {
2030 return nil, err
2031 }
2032 return resp, nil
2033 }
2034
2035 func (c *dataMigrationGRPCClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error {
2036 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2037
2038 hds = append(c.xGoogHeaders, hds...)
2039 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2040 opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...)
2041 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2042 var err error
2043 _, err = executeRPC(ctx, c.operationsClient.CancelOperation, req, settings.GRPC, c.logger, "CancelOperation")
2044 return err
2045 }, opts...)
2046 return err
2047 }
2048
2049 func (c *dataMigrationGRPCClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error {
2050 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2051
2052 hds = append(c.xGoogHeaders, hds...)
2053 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2054 opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...)
2055 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2056 var err error
2057 _, err = executeRPC(ctx, c.operationsClient.DeleteOperation, req, settings.GRPC, c.logger, "DeleteOperation")
2058 return err
2059 }, opts...)
2060 return err
2061 }
2062
2063 func (c *dataMigrationGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) {
2064 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2065
2066 hds = append(c.xGoogHeaders, hds...)
2067 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2068 opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...)
2069 var resp *longrunningpb.Operation
2070 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2071 var err error
2072 resp, err = executeRPC(ctx, c.operationsClient.GetOperation, req, settings.GRPC, c.logger, "GetOperation")
2073 return err
2074 }, opts...)
2075 if err != nil {
2076 return nil, err
2077 }
2078 return resp, nil
2079 }
2080
2081 func (c *dataMigrationGRPCClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator {
2082 hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
2083
2084 hds = append(c.xGoogHeaders, hds...)
2085 ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
2086 opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...)
2087 it := &OperationIterator{}
2088 req = proto.Clone(req).(*longrunningpb.ListOperationsRequest)
2089 it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) {
2090 resp := &longrunningpb.ListOperationsResponse{}
2091 if pageToken != "" {
2092 req.PageToken = pageToken
2093 }
2094 if pageSize > math.MaxInt32 {
2095 req.PageSize = math.MaxInt32
2096 } else if pageSize != 0 {
2097 req.PageSize = int32(pageSize)
2098 }
2099 err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
2100 var err error
2101 resp, err = executeRPC(ctx, c.operationsClient.ListOperations, req, settings.GRPC, c.logger, "ListOperations")
2102 return err
2103 }, opts...)
2104 if err != nil {
2105 return nil, "", err
2106 }
2107
2108 it.Response = resp
2109 return resp.GetOperations(), resp.GetNextPageToken(), nil
2110 }
2111 fetch := func(pageSize int, pageToken string) (string, error) {
2112 items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
2113 if err != nil {
2114 return "", err
2115 }
2116 it.items = append(it.items, items...)
2117 return nextPageToken, nil
2118 }
2119
2120 it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
2121 it.pageInfo.MaxSize = int(req.GetPageSize())
2122 it.pageInfo.Token = req.GetPageToken()
2123
2124 return it
2125 }
2126
2127 // ApplyConversionWorkspaceOperation returns a new ApplyConversionWorkspaceOperation from a given name.
2128 // The name must be that of a previously created ApplyConversionWorkspaceOperation, possibly from a different process.
2129 func (c *dataMigrationGRPCClient) ApplyConversionWorkspaceOperation(name string) *ApplyConversionWorkspaceOperation {
2130 return &ApplyConversionWorkspaceOperation{
2131 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2132 }
2133 }
2134
2135 // CommitConversionWorkspaceOperation returns a new CommitConversionWorkspaceOperation from a given name.
2136 // The name must be that of a previously created CommitConversionWorkspaceOperation, possibly from a different process.
2137 func (c *dataMigrationGRPCClient) CommitConversionWorkspaceOperation(name string) *CommitConversionWorkspaceOperation {
2138 return &CommitConversionWorkspaceOperation{
2139 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2140 }
2141 }
2142
2143 // ConvertConversionWorkspaceOperation returns a new ConvertConversionWorkspaceOperation from a given name.
2144 // The name must be that of a previously created ConvertConversionWorkspaceOperation, possibly from a different process.
2145 func (c *dataMigrationGRPCClient) ConvertConversionWorkspaceOperation(name string) *ConvertConversionWorkspaceOperation {
2146 return &ConvertConversionWorkspaceOperation{
2147 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2148 }
2149 }
2150
2151 // CreateConnectionProfileOperation returns a new CreateConnectionProfileOperation from a given name.
2152 // The name must be that of a previously created CreateConnectionProfileOperation, possibly from a different process.
2153 func (c *dataMigrationGRPCClient) CreateConnectionProfileOperation(name string) *CreateConnectionProfileOperation {
2154 return &CreateConnectionProfileOperation{
2155 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2156 }
2157 }
2158
2159 // CreateConversionWorkspaceOperation returns a new CreateConversionWorkspaceOperation from a given name.
2160 // The name must be that of a previously created CreateConversionWorkspaceOperation, possibly from a different process.
2161 func (c *dataMigrationGRPCClient) CreateConversionWorkspaceOperation(name string) *CreateConversionWorkspaceOperation {
2162 return &CreateConversionWorkspaceOperation{
2163 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2164 }
2165 }
2166
2167 // CreateMigrationJobOperation returns a new CreateMigrationJobOperation from a given name.
2168 // The name must be that of a previously created CreateMigrationJobOperation, possibly from a different process.
2169 func (c *dataMigrationGRPCClient) CreateMigrationJobOperation(name string) *CreateMigrationJobOperation {
2170 return &CreateMigrationJobOperation{
2171 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2172 }
2173 }
2174
2175 // CreatePrivateConnectionOperation returns a new CreatePrivateConnectionOperation from a given name.
2176 // The name must be that of a previously created CreatePrivateConnectionOperation, possibly from a different process.
2177 func (c *dataMigrationGRPCClient) CreatePrivateConnectionOperation(name string) *CreatePrivateConnectionOperation {
2178 return &CreatePrivateConnectionOperation{
2179 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2180 }
2181 }
2182
2183 // DeleteConnectionProfileOperation returns a new DeleteConnectionProfileOperation from a given name.
2184 // The name must be that of a previously created DeleteConnectionProfileOperation, possibly from a different process.
2185 func (c *dataMigrationGRPCClient) DeleteConnectionProfileOperation(name string) *DeleteConnectionProfileOperation {
2186 return &DeleteConnectionProfileOperation{
2187 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2188 }
2189 }
2190
2191 // DeleteConversionWorkspaceOperation returns a new DeleteConversionWorkspaceOperation from a given name.
2192 // The name must be that of a previously created DeleteConversionWorkspaceOperation, possibly from a different process.
2193 func (c *dataMigrationGRPCClient) DeleteConversionWorkspaceOperation(name string) *DeleteConversionWorkspaceOperation {
2194 return &DeleteConversionWorkspaceOperation{
2195 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2196 }
2197 }
2198
2199 // DeleteMigrationJobOperation returns a new DeleteMigrationJobOperation from a given name.
2200 // The name must be that of a previously created DeleteMigrationJobOperation, possibly from a different process.
2201 func (c *dataMigrationGRPCClient) DeleteMigrationJobOperation(name string) *DeleteMigrationJobOperation {
2202 return &DeleteMigrationJobOperation{
2203 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2204 }
2205 }
2206
2207 // DeletePrivateConnectionOperation returns a new DeletePrivateConnectionOperation from a given name.
2208 // The name must be that of a previously created DeletePrivateConnectionOperation, possibly from a different process.
2209 func (c *dataMigrationGRPCClient) DeletePrivateConnectionOperation(name string) *DeletePrivateConnectionOperation {
2210 return &DeletePrivateConnectionOperation{
2211 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2212 }
2213 }
2214
2215 // ImportMappingRulesOperation returns a new ImportMappingRulesOperation from a given name.
2216 // The name must be that of a previously created ImportMappingRulesOperation, possibly from a different process.
2217 func (c *dataMigrationGRPCClient) ImportMappingRulesOperation(name string) *ImportMappingRulesOperation {
2218 return &ImportMappingRulesOperation{
2219 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2220 }
2221 }
2222
2223 // PromoteMigrationJobOperation returns a new PromoteMigrationJobOperation from a given name.
2224 // The name must be that of a previously created PromoteMigrationJobOperation, possibly from a different process.
2225 func (c *dataMigrationGRPCClient) PromoteMigrationJobOperation(name string) *PromoteMigrationJobOperation {
2226 return &PromoteMigrationJobOperation{
2227 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2228 }
2229 }
2230
2231 // RestartMigrationJobOperation returns a new RestartMigrationJobOperation from a given name.
2232 // The name must be that of a previously created RestartMigrationJobOperation, possibly from a different process.
2233 func (c *dataMigrationGRPCClient) RestartMigrationJobOperation(name string) *RestartMigrationJobOperation {
2234 return &RestartMigrationJobOperation{
2235 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2236 }
2237 }
2238
2239 // ResumeMigrationJobOperation returns a new ResumeMigrationJobOperation from a given name.
2240 // The name must be that of a previously created ResumeMigrationJobOperation, possibly from a different process.
2241 func (c *dataMigrationGRPCClient) ResumeMigrationJobOperation(name string) *ResumeMigrationJobOperation {
2242 return &ResumeMigrationJobOperation{
2243 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2244 }
2245 }
2246
2247 // RollbackConversionWorkspaceOperation returns a new RollbackConversionWorkspaceOperation from a given name.
2248 // The name must be that of a previously created RollbackConversionWorkspaceOperation, possibly from a different process.
2249 func (c *dataMigrationGRPCClient) RollbackConversionWorkspaceOperation(name string) *RollbackConversionWorkspaceOperation {
2250 return &RollbackConversionWorkspaceOperation{
2251 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2252 }
2253 }
2254
2255 // SeedConversionWorkspaceOperation returns a new SeedConversionWorkspaceOperation from a given name.
2256 // The name must be that of a previously created SeedConversionWorkspaceOperation, possibly from a different process.
2257 func (c *dataMigrationGRPCClient) SeedConversionWorkspaceOperation(name string) *SeedConversionWorkspaceOperation {
2258 return &SeedConversionWorkspaceOperation{
2259 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2260 }
2261 }
2262
2263 // StartMigrationJobOperation returns a new StartMigrationJobOperation from a given name.
2264 // The name must be that of a previously created StartMigrationJobOperation, possibly from a different process.
2265 func (c *dataMigrationGRPCClient) StartMigrationJobOperation(name string) *StartMigrationJobOperation {
2266 return &StartMigrationJobOperation{
2267 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2268 }
2269 }
2270
2271 // StopMigrationJobOperation returns a new StopMigrationJobOperation from a given name.
2272 // The name must be that of a previously created StopMigrationJobOperation, possibly from a different process.
2273 func (c *dataMigrationGRPCClient) StopMigrationJobOperation(name string) *StopMigrationJobOperation {
2274 return &StopMigrationJobOperation{
2275 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2276 }
2277 }
2278
2279 // UpdateConnectionProfileOperation returns a new UpdateConnectionProfileOperation from a given name.
2280 // The name must be that of a previously created UpdateConnectionProfileOperation, possibly from a different process.
2281 func (c *dataMigrationGRPCClient) UpdateConnectionProfileOperation(name string) *UpdateConnectionProfileOperation {
2282 return &UpdateConnectionProfileOperation{
2283 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2284 }
2285 }
2286
2287 // UpdateConversionWorkspaceOperation returns a new UpdateConversionWorkspaceOperation from a given name.
2288 // The name must be that of a previously created UpdateConversionWorkspaceOperation, possibly from a different process.
2289 func (c *dataMigrationGRPCClient) UpdateConversionWorkspaceOperation(name string) *UpdateConversionWorkspaceOperation {
2290 return &UpdateConversionWorkspaceOperation{
2291 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2292 }
2293 }
2294
2295 // UpdateMigrationJobOperation returns a new UpdateMigrationJobOperation from a given name.
2296 // The name must be that of a previously created UpdateMigrationJobOperation, possibly from a different process.
2297 func (c *dataMigrationGRPCClient) UpdateMigrationJobOperation(name string) *UpdateMigrationJobOperation {
2298 return &UpdateMigrationJobOperation{
2299 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2300 }
2301 }
2302
2303 // VerifyMigrationJobOperation returns a new VerifyMigrationJobOperation from a given name.
2304 // The name must be that of a previously created VerifyMigrationJobOperation, possibly from a different process.
2305 func (c *dataMigrationGRPCClient) VerifyMigrationJobOperation(name string) *VerifyMigrationJobOperation {
2306 return &VerifyMigrationJobOperation{
2307 lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
2308 }
2309 }