| 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 gkemulticloud |
| 18 | |
| 19 | import ( |
| 20 | "context" |
| 21 | "time" |
| 22 | |
| 23 | gkemulticloudpb "cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb" |
| 24 | "cloud.google.com/go/longrunning" |
| 25 | longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" |
| 26 | gax "github.com/googleapis/gax-go/v2" |
| 27 | "google.golang.org/api/iterator" |
| 28 | ) |
| 29 | |
| 30 | // CreateAttachedClusterOperation manages a long-running operation from CreateAttachedCluster. |
| 31 | type CreateAttachedClusterOperation struct { |
| 32 | lro *longrunning.Operation |
| 33 | } |
| 34 | |
| 35 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 36 | // |
| 37 | // See documentation of Poll for error-handling information. |
| 38 | func (op *CreateAttachedClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AttachedCluster, error) { |
| 39 | var resp gkemulticloudpb.AttachedCluster |
| 40 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 41 | return nil, err |
| 42 | } |
| 43 | return &resp, nil |
| 44 | } |
| 45 | |
| 46 | // Poll fetches the latest state of the long-running operation. |
| 47 | // |
| 48 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 49 | // |
| 50 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 51 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 52 | // If Poll succeeds and the operation has completed successfully, |
| 53 | // op.Done will return true, and the response of the operation is returned. |
| 54 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 55 | func (op *CreateAttachedClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AttachedCluster, error) { |
| 56 | var resp gkemulticloudpb.AttachedCluster |
| 57 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 58 | return nil, err |
| 59 | } |
| 60 | if !op.Done() { |
| 61 | return nil, nil |
| 62 | } |
| 63 | return &resp, nil |
| 64 | } |
| 65 | |
| 66 | // Metadata returns metadata associated with the long-running operation. |
| 67 | // Metadata itself does not contact the server, but Poll does. |
| 68 | // To get the latest metadata, call this method after a successful call to Poll. |
| 69 | // If the metadata is not available, the returned metadata and error are both nil. |
| 70 | func (op *CreateAttachedClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 71 | var meta gkemulticloudpb.OperationMetadata |
| 72 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 73 | return nil, nil |
| 74 | } else if err != nil { |
| 75 | return nil, err |
| 76 | } |
| 77 | return &meta, nil |
| 78 | } |
| 79 | |
| 80 | // Done reports whether the long-running operation has completed. |
| 81 | func (op *CreateAttachedClusterOperation) Done() bool { |
| 82 | return op.lro.Done() |
| 83 | } |
| 84 | |
| 85 | // Name returns the name of the long-running operation. |
| 86 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 87 | func (op *CreateAttachedClusterOperation) Name() string { |
| 88 | return op.lro.Name() |
| 89 | } |
| 90 | |
| 91 | // CreateAwsClusterOperation manages a long-running operation from CreateAwsCluster. |
| 92 | type CreateAwsClusterOperation struct { |
| 93 | lro *longrunning.Operation |
| 94 | } |
| 95 | |
| 96 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 97 | // |
| 98 | // See documentation of Poll for error-handling information. |
| 99 | func (op *CreateAwsClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsCluster, error) { |
| 100 | var resp gkemulticloudpb.AwsCluster |
| 101 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 102 | return nil, err |
| 103 | } |
| 104 | return &resp, nil |
| 105 | } |
| 106 | |
| 107 | // Poll fetches the latest state of the long-running operation. |
| 108 | // |
| 109 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 110 | // |
| 111 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 112 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 113 | // If Poll succeeds and the operation has completed successfully, |
| 114 | // op.Done will return true, and the response of the operation is returned. |
| 115 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 116 | func (op *CreateAwsClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsCluster, error) { |
| 117 | var resp gkemulticloudpb.AwsCluster |
| 118 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 119 | return nil, err |
| 120 | } |
| 121 | if !op.Done() { |
| 122 | return nil, nil |
| 123 | } |
| 124 | return &resp, nil |
| 125 | } |
| 126 | |
| 127 | // Metadata returns metadata associated with the long-running operation. |
| 128 | // Metadata itself does not contact the server, but Poll does. |
| 129 | // To get the latest metadata, call this method after a successful call to Poll. |
| 130 | // If the metadata is not available, the returned metadata and error are both nil. |
| 131 | func (op *CreateAwsClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 132 | var meta gkemulticloudpb.OperationMetadata |
| 133 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 134 | return nil, nil |
| 135 | } else if err != nil { |
| 136 | return nil, err |
| 137 | } |
| 138 | return &meta, nil |
| 139 | } |
| 140 | |
| 141 | // Done reports whether the long-running operation has completed. |
| 142 | func (op *CreateAwsClusterOperation) Done() bool { |
| 143 | return op.lro.Done() |
| 144 | } |
| 145 | |
| 146 | // Name returns the name of the long-running operation. |
| 147 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 148 | func (op *CreateAwsClusterOperation) Name() string { |
| 149 | return op.lro.Name() |
| 150 | } |
| 151 | |
| 152 | // CreateAwsNodePoolOperation manages a long-running operation from CreateAwsNodePool. |
| 153 | type CreateAwsNodePoolOperation struct { |
| 154 | lro *longrunning.Operation |
| 155 | } |
| 156 | |
| 157 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 158 | // |
| 159 | // See documentation of Poll for error-handling information. |
| 160 | func (op *CreateAwsNodePoolOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsNodePool, error) { |
| 161 | var resp gkemulticloudpb.AwsNodePool |
| 162 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 163 | return nil, err |
| 164 | } |
| 165 | return &resp, nil |
| 166 | } |
| 167 | |
| 168 | // Poll fetches the latest state of the long-running operation. |
| 169 | // |
| 170 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 171 | // |
| 172 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 173 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 174 | // If Poll succeeds and the operation has completed successfully, |
| 175 | // op.Done will return true, and the response of the operation is returned. |
| 176 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 177 | func (op *CreateAwsNodePoolOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsNodePool, error) { |
| 178 | var resp gkemulticloudpb.AwsNodePool |
| 179 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 180 | return nil, err |
| 181 | } |
| 182 | if !op.Done() { |
| 183 | return nil, nil |
| 184 | } |
| 185 | return &resp, nil |
| 186 | } |
| 187 | |
| 188 | // Metadata returns metadata associated with the long-running operation. |
| 189 | // Metadata itself does not contact the server, but Poll does. |
| 190 | // To get the latest metadata, call this method after a successful call to Poll. |
| 191 | // If the metadata is not available, the returned metadata and error are both nil. |
| 192 | func (op *CreateAwsNodePoolOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 193 | var meta gkemulticloudpb.OperationMetadata |
| 194 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 195 | return nil, nil |
| 196 | } else if err != nil { |
| 197 | return nil, err |
| 198 | } |
| 199 | return &meta, nil |
| 200 | } |
| 201 | |
| 202 | // Done reports whether the long-running operation has completed. |
| 203 | func (op *CreateAwsNodePoolOperation) Done() bool { |
| 204 | return op.lro.Done() |
| 205 | } |
| 206 | |
| 207 | // Name returns the name of the long-running operation. |
| 208 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 209 | func (op *CreateAwsNodePoolOperation) Name() string { |
| 210 | return op.lro.Name() |
| 211 | } |
| 212 | |
| 213 | // CreateAzureClientOperation manages a long-running operation from CreateAzureClient. |
| 214 | type CreateAzureClientOperation struct { |
| 215 | lro *longrunning.Operation |
| 216 | } |
| 217 | |
| 218 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 219 | // |
| 220 | // See documentation of Poll for error-handling information. |
| 221 | func (op *CreateAzureClientOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureClient, error) { |
| 222 | var resp gkemulticloudpb.AzureClient |
| 223 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 224 | return nil, err |
| 225 | } |
| 226 | return &resp, nil |
| 227 | } |
| 228 | |
| 229 | // Poll fetches the latest state of the long-running operation. |
| 230 | // |
| 231 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 232 | // |
| 233 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 234 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 235 | // If Poll succeeds and the operation has completed successfully, |
| 236 | // op.Done will return true, and the response of the operation is returned. |
| 237 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 238 | func (op *CreateAzureClientOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureClient, error) { |
| 239 | var resp gkemulticloudpb.AzureClient |
| 240 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 241 | return nil, err |
| 242 | } |
| 243 | if !op.Done() { |
| 244 | return nil, nil |
| 245 | } |
| 246 | return &resp, nil |
| 247 | } |
| 248 | |
| 249 | // Metadata returns metadata associated with the long-running operation. |
| 250 | // Metadata itself does not contact the server, but Poll does. |
| 251 | // To get the latest metadata, call this method after a successful call to Poll. |
| 252 | // If the metadata is not available, the returned metadata and error are both nil. |
| 253 | func (op *CreateAzureClientOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 254 | var meta gkemulticloudpb.OperationMetadata |
| 255 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 256 | return nil, nil |
| 257 | } else if err != nil { |
| 258 | return nil, err |
| 259 | } |
| 260 | return &meta, nil |
| 261 | } |
| 262 | |
| 263 | // Done reports whether the long-running operation has completed. |
| 264 | func (op *CreateAzureClientOperation) Done() bool { |
| 265 | return op.lro.Done() |
| 266 | } |
| 267 | |
| 268 | // Name returns the name of the long-running operation. |
| 269 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 270 | func (op *CreateAzureClientOperation) Name() string { |
| 271 | return op.lro.Name() |
| 272 | } |
| 273 | |
| 274 | // CreateAzureClusterOperation manages a long-running operation from CreateAzureCluster. |
| 275 | type CreateAzureClusterOperation struct { |
| 276 | lro *longrunning.Operation |
| 277 | } |
| 278 | |
| 279 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 280 | // |
| 281 | // See documentation of Poll for error-handling information. |
| 282 | func (op *CreateAzureClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureCluster, error) { |
| 283 | var resp gkemulticloudpb.AzureCluster |
| 284 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 285 | return nil, err |
| 286 | } |
| 287 | return &resp, nil |
| 288 | } |
| 289 | |
| 290 | // Poll fetches the latest state of the long-running operation. |
| 291 | // |
| 292 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 293 | // |
| 294 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 295 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 296 | // If Poll succeeds and the operation has completed successfully, |
| 297 | // op.Done will return true, and the response of the operation is returned. |
| 298 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 299 | func (op *CreateAzureClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureCluster, error) { |
| 300 | var resp gkemulticloudpb.AzureCluster |
| 301 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 302 | return nil, err |
| 303 | } |
| 304 | if !op.Done() { |
| 305 | return nil, nil |
| 306 | } |
| 307 | return &resp, nil |
| 308 | } |
| 309 | |
| 310 | // Metadata returns metadata associated with the long-running operation. |
| 311 | // Metadata itself does not contact the server, but Poll does. |
| 312 | // To get the latest metadata, call this method after a successful call to Poll. |
| 313 | // If the metadata is not available, the returned metadata and error are both nil. |
| 314 | func (op *CreateAzureClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 315 | var meta gkemulticloudpb.OperationMetadata |
| 316 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 317 | return nil, nil |
| 318 | } else if err != nil { |
| 319 | return nil, err |
| 320 | } |
| 321 | return &meta, nil |
| 322 | } |
| 323 | |
| 324 | // Done reports whether the long-running operation has completed. |
| 325 | func (op *CreateAzureClusterOperation) Done() bool { |
| 326 | return op.lro.Done() |
| 327 | } |
| 328 | |
| 329 | // Name returns the name of the long-running operation. |
| 330 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 331 | func (op *CreateAzureClusterOperation) Name() string { |
| 332 | return op.lro.Name() |
| 333 | } |
| 334 | |
| 335 | // CreateAzureNodePoolOperation manages a long-running operation from CreateAzureNodePool. |
| 336 | type CreateAzureNodePoolOperation struct { |
| 337 | lro *longrunning.Operation |
| 338 | } |
| 339 | |
| 340 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 341 | // |
| 342 | // See documentation of Poll for error-handling information. |
| 343 | func (op *CreateAzureNodePoolOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureNodePool, error) { |
| 344 | var resp gkemulticloudpb.AzureNodePool |
| 345 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 346 | return nil, err |
| 347 | } |
| 348 | return &resp, nil |
| 349 | } |
| 350 | |
| 351 | // Poll fetches the latest state of the long-running operation. |
| 352 | // |
| 353 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 354 | // |
| 355 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 356 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 357 | // If Poll succeeds and the operation has completed successfully, |
| 358 | // op.Done will return true, and the response of the operation is returned. |
| 359 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 360 | func (op *CreateAzureNodePoolOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureNodePool, error) { |
| 361 | var resp gkemulticloudpb.AzureNodePool |
| 362 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 363 | return nil, err |
| 364 | } |
| 365 | if !op.Done() { |
| 366 | return nil, nil |
| 367 | } |
| 368 | return &resp, nil |
| 369 | } |
| 370 | |
| 371 | // Metadata returns metadata associated with the long-running operation. |
| 372 | // Metadata itself does not contact the server, but Poll does. |
| 373 | // To get the latest metadata, call this method after a successful call to Poll. |
| 374 | // If the metadata is not available, the returned metadata and error are both nil. |
| 375 | func (op *CreateAzureNodePoolOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 376 | var meta gkemulticloudpb.OperationMetadata |
| 377 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 378 | return nil, nil |
| 379 | } else if err != nil { |
| 380 | return nil, err |
| 381 | } |
| 382 | return &meta, nil |
| 383 | } |
| 384 | |
| 385 | // Done reports whether the long-running operation has completed. |
| 386 | func (op *CreateAzureNodePoolOperation) Done() bool { |
| 387 | return op.lro.Done() |
| 388 | } |
| 389 | |
| 390 | // Name returns the name of the long-running operation. |
| 391 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 392 | func (op *CreateAzureNodePoolOperation) Name() string { |
| 393 | return op.lro.Name() |
| 394 | } |
| 395 | |
| 396 | // DeleteAttachedClusterOperation manages a long-running operation from DeleteAttachedCluster. |
| 397 | type DeleteAttachedClusterOperation struct { |
| 398 | lro *longrunning.Operation |
| 399 | } |
| 400 | |
| 401 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 402 | // |
| 403 | // See documentation of Poll for error-handling information. |
| 404 | func (op *DeleteAttachedClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 405 | return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 406 | } |
| 407 | |
| 408 | // Poll fetches the latest state of the long-running operation. |
| 409 | // |
| 410 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 411 | // |
| 412 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 413 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 414 | // If Poll succeeds and the operation has completed successfully, |
| 415 | // op.Done will return true, and the response of the operation is returned. |
| 416 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 417 | func (op *DeleteAttachedClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 418 | return op.lro.Poll(ctx, nil, opts...) |
| 419 | } |
| 420 | |
| 421 | // Metadata returns metadata associated with the long-running operation. |
| 422 | // Metadata itself does not contact the server, but Poll does. |
| 423 | // To get the latest metadata, call this method after a successful call to Poll. |
| 424 | // If the metadata is not available, the returned metadata and error are both nil. |
| 425 | func (op *DeleteAttachedClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 426 | var meta gkemulticloudpb.OperationMetadata |
| 427 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 428 | return nil, nil |
| 429 | } else if err != nil { |
| 430 | return nil, err |
| 431 | } |
| 432 | return &meta, nil |
| 433 | } |
| 434 | |
| 435 | // Done reports whether the long-running operation has completed. |
| 436 | func (op *DeleteAttachedClusterOperation) Done() bool { |
| 437 | return op.lro.Done() |
| 438 | } |
| 439 | |
| 440 | // Name returns the name of the long-running operation. |
| 441 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 442 | func (op *DeleteAttachedClusterOperation) Name() string { |
| 443 | return op.lro.Name() |
| 444 | } |
| 445 | |
| 446 | // DeleteAwsClusterOperation manages a long-running operation from DeleteAwsCluster. |
| 447 | type DeleteAwsClusterOperation struct { |
| 448 | lro *longrunning.Operation |
| 449 | } |
| 450 | |
| 451 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 452 | // |
| 453 | // See documentation of Poll for error-handling information. |
| 454 | func (op *DeleteAwsClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 455 | return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 456 | } |
| 457 | |
| 458 | // Poll fetches the latest state of the long-running operation. |
| 459 | // |
| 460 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 461 | // |
| 462 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 463 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 464 | // If Poll succeeds and the operation has completed successfully, |
| 465 | // op.Done will return true, and the response of the operation is returned. |
| 466 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 467 | func (op *DeleteAwsClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 468 | return op.lro.Poll(ctx, nil, opts...) |
| 469 | } |
| 470 | |
| 471 | // Metadata returns metadata associated with the long-running operation. |
| 472 | // Metadata itself does not contact the server, but Poll does. |
| 473 | // To get the latest metadata, call this method after a successful call to Poll. |
| 474 | // If the metadata is not available, the returned metadata and error are both nil. |
| 475 | func (op *DeleteAwsClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 476 | var meta gkemulticloudpb.OperationMetadata |
| 477 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 478 | return nil, nil |
| 479 | } else if err != nil { |
| 480 | return nil, err |
| 481 | } |
| 482 | return &meta, nil |
| 483 | } |
| 484 | |
| 485 | // Done reports whether the long-running operation has completed. |
| 486 | func (op *DeleteAwsClusterOperation) Done() bool { |
| 487 | return op.lro.Done() |
| 488 | } |
| 489 | |
| 490 | // Name returns the name of the long-running operation. |
| 491 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 492 | func (op *DeleteAwsClusterOperation) Name() string { |
| 493 | return op.lro.Name() |
| 494 | } |
| 495 | |
| 496 | // DeleteAwsNodePoolOperation manages a long-running operation from DeleteAwsNodePool. |
| 497 | type DeleteAwsNodePoolOperation struct { |
| 498 | lro *longrunning.Operation |
| 499 | } |
| 500 | |
| 501 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 502 | // |
| 503 | // See documentation of Poll for error-handling information. |
| 504 | func (op *DeleteAwsNodePoolOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 505 | return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 506 | } |
| 507 | |
| 508 | // Poll fetches the latest state of the long-running operation. |
| 509 | // |
| 510 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 511 | // |
| 512 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 513 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 514 | // If Poll succeeds and the operation has completed successfully, |
| 515 | // op.Done will return true, and the response of the operation is returned. |
| 516 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 517 | func (op *DeleteAwsNodePoolOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 518 | return op.lro.Poll(ctx, nil, opts...) |
| 519 | } |
| 520 | |
| 521 | // Metadata returns metadata associated with the long-running operation. |
| 522 | // Metadata itself does not contact the server, but Poll does. |
| 523 | // To get the latest metadata, call this method after a successful call to Poll. |
| 524 | // If the metadata is not available, the returned metadata and error are both nil. |
| 525 | func (op *DeleteAwsNodePoolOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 526 | var meta gkemulticloudpb.OperationMetadata |
| 527 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 528 | return nil, nil |
| 529 | } else if err != nil { |
| 530 | return nil, err |
| 531 | } |
| 532 | return &meta, nil |
| 533 | } |
| 534 | |
| 535 | // Done reports whether the long-running operation has completed. |
| 536 | func (op *DeleteAwsNodePoolOperation) Done() bool { |
| 537 | return op.lro.Done() |
| 538 | } |
| 539 | |
| 540 | // Name returns the name of the long-running operation. |
| 541 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 542 | func (op *DeleteAwsNodePoolOperation) Name() string { |
| 543 | return op.lro.Name() |
| 544 | } |
| 545 | |
| 546 | // DeleteAzureClientOperation manages a long-running operation from DeleteAzureClient. |
| 547 | type DeleteAzureClientOperation struct { |
| 548 | lro *longrunning.Operation |
| 549 | } |
| 550 | |
| 551 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 552 | // |
| 553 | // See documentation of Poll for error-handling information. |
| 554 | func (op *DeleteAzureClientOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 555 | return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 556 | } |
| 557 | |
| 558 | // Poll fetches the latest state of the long-running operation. |
| 559 | // |
| 560 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 561 | // |
| 562 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 563 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 564 | // If Poll succeeds and the operation has completed successfully, |
| 565 | // op.Done will return true, and the response of the operation is returned. |
| 566 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 567 | func (op *DeleteAzureClientOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 568 | return op.lro.Poll(ctx, nil, opts...) |
| 569 | } |
| 570 | |
| 571 | // Metadata returns metadata associated with the long-running operation. |
| 572 | // Metadata itself does not contact the server, but Poll does. |
| 573 | // To get the latest metadata, call this method after a successful call to Poll. |
| 574 | // If the metadata is not available, the returned metadata and error are both nil. |
| 575 | func (op *DeleteAzureClientOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 576 | var meta gkemulticloudpb.OperationMetadata |
| 577 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 578 | return nil, nil |
| 579 | } else if err != nil { |
| 580 | return nil, err |
| 581 | } |
| 582 | return &meta, nil |
| 583 | } |
| 584 | |
| 585 | // Done reports whether the long-running operation has completed. |
| 586 | func (op *DeleteAzureClientOperation) Done() bool { |
| 587 | return op.lro.Done() |
| 588 | } |
| 589 | |
| 590 | // Name returns the name of the long-running operation. |
| 591 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 592 | func (op *DeleteAzureClientOperation) Name() string { |
| 593 | return op.lro.Name() |
| 594 | } |
| 595 | |
| 596 | // DeleteAzureClusterOperation manages a long-running operation from DeleteAzureCluster. |
| 597 | type DeleteAzureClusterOperation struct { |
| 598 | lro *longrunning.Operation |
| 599 | } |
| 600 | |
| 601 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 602 | // |
| 603 | // See documentation of Poll for error-handling information. |
| 604 | func (op *DeleteAzureClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 605 | return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 606 | } |
| 607 | |
| 608 | // Poll fetches the latest state of the long-running operation. |
| 609 | // |
| 610 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 611 | // |
| 612 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 613 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 614 | // If Poll succeeds and the operation has completed successfully, |
| 615 | // op.Done will return true, and the response of the operation is returned. |
| 616 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 617 | func (op *DeleteAzureClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 618 | return op.lro.Poll(ctx, nil, opts...) |
| 619 | } |
| 620 | |
| 621 | // Metadata returns metadata associated with the long-running operation. |
| 622 | // Metadata itself does not contact the server, but Poll does. |
| 623 | // To get the latest metadata, call this method after a successful call to Poll. |
| 624 | // If the metadata is not available, the returned metadata and error are both nil. |
| 625 | func (op *DeleteAzureClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 626 | var meta gkemulticloudpb.OperationMetadata |
| 627 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 628 | return nil, nil |
| 629 | } else if err != nil { |
| 630 | return nil, err |
| 631 | } |
| 632 | return &meta, nil |
| 633 | } |
| 634 | |
| 635 | // Done reports whether the long-running operation has completed. |
| 636 | func (op *DeleteAzureClusterOperation) Done() bool { |
| 637 | return op.lro.Done() |
| 638 | } |
| 639 | |
| 640 | // Name returns the name of the long-running operation. |
| 641 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 642 | func (op *DeleteAzureClusterOperation) Name() string { |
| 643 | return op.lro.Name() |
| 644 | } |
| 645 | |
| 646 | // DeleteAzureNodePoolOperation manages a long-running operation from DeleteAzureNodePool. |
| 647 | type DeleteAzureNodePoolOperation struct { |
| 648 | lro *longrunning.Operation |
| 649 | } |
| 650 | |
| 651 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 652 | // |
| 653 | // See documentation of Poll for error-handling information. |
| 654 | func (op *DeleteAzureNodePoolOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 655 | return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 656 | } |
| 657 | |
| 658 | // Poll fetches the latest state of the long-running operation. |
| 659 | // |
| 660 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 661 | // |
| 662 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 663 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 664 | // If Poll succeeds and the operation has completed successfully, |
| 665 | // op.Done will return true, and the response of the operation is returned. |
| 666 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 667 | func (op *DeleteAzureNodePoolOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 668 | return op.lro.Poll(ctx, nil, opts...) |
| 669 | } |
| 670 | |
| 671 | // Metadata returns metadata associated with the long-running operation. |
| 672 | // Metadata itself does not contact the server, but Poll does. |
| 673 | // To get the latest metadata, call this method after a successful call to Poll. |
| 674 | // If the metadata is not available, the returned metadata and error are both nil. |
| 675 | func (op *DeleteAzureNodePoolOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 676 | var meta gkemulticloudpb.OperationMetadata |
| 677 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 678 | return nil, nil |
| 679 | } else if err != nil { |
| 680 | return nil, err |
| 681 | } |
| 682 | return &meta, nil |
| 683 | } |
| 684 | |
| 685 | // Done reports whether the long-running operation has completed. |
| 686 | func (op *DeleteAzureNodePoolOperation) Done() bool { |
| 687 | return op.lro.Done() |
| 688 | } |
| 689 | |
| 690 | // Name returns the name of the long-running operation. |
| 691 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 692 | func (op *DeleteAzureNodePoolOperation) Name() string { |
| 693 | return op.lro.Name() |
| 694 | } |
| 695 | |
| 696 | // ImportAttachedClusterOperation manages a long-running operation from ImportAttachedCluster. |
| 697 | type ImportAttachedClusterOperation struct { |
| 698 | lro *longrunning.Operation |
| 699 | } |
| 700 | |
| 701 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 702 | // |
| 703 | // See documentation of Poll for error-handling information. |
| 704 | func (op *ImportAttachedClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AttachedCluster, error) { |
| 705 | var resp gkemulticloudpb.AttachedCluster |
| 706 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 707 | return nil, err |
| 708 | } |
| 709 | return &resp, nil |
| 710 | } |
| 711 | |
| 712 | // Poll fetches the latest state of the long-running operation. |
| 713 | // |
| 714 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 715 | // |
| 716 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 717 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 718 | // If Poll succeeds and the operation has completed successfully, |
| 719 | // op.Done will return true, and the response of the operation is returned. |
| 720 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 721 | func (op *ImportAttachedClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AttachedCluster, error) { |
| 722 | var resp gkemulticloudpb.AttachedCluster |
| 723 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 724 | return nil, err |
| 725 | } |
| 726 | if !op.Done() { |
| 727 | return nil, nil |
| 728 | } |
| 729 | return &resp, nil |
| 730 | } |
| 731 | |
| 732 | // Metadata returns metadata associated with the long-running operation. |
| 733 | // Metadata itself does not contact the server, but Poll does. |
| 734 | // To get the latest metadata, call this method after a successful call to Poll. |
| 735 | // If the metadata is not available, the returned metadata and error are both nil. |
| 736 | func (op *ImportAttachedClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 737 | var meta gkemulticloudpb.OperationMetadata |
| 738 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 739 | return nil, nil |
| 740 | } else if err != nil { |
| 741 | return nil, err |
| 742 | } |
| 743 | return &meta, nil |
| 744 | } |
| 745 | |
| 746 | // Done reports whether the long-running operation has completed. |
| 747 | func (op *ImportAttachedClusterOperation) Done() bool { |
| 748 | return op.lro.Done() |
| 749 | } |
| 750 | |
| 751 | // Name returns the name of the long-running operation. |
| 752 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 753 | func (op *ImportAttachedClusterOperation) Name() string { |
| 754 | return op.lro.Name() |
| 755 | } |
| 756 | |
| 757 | // RollbackAwsNodePoolUpdateOperation manages a long-running operation from RollbackAwsNodePoolUpdate. |
| 758 | type RollbackAwsNodePoolUpdateOperation struct { |
| 759 | lro *longrunning.Operation |
| 760 | } |
| 761 | |
| 762 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 763 | // |
| 764 | // See documentation of Poll for error-handling information. |
| 765 | func (op *RollbackAwsNodePoolUpdateOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsNodePool, error) { |
| 766 | var resp gkemulticloudpb.AwsNodePool |
| 767 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 768 | return nil, err |
| 769 | } |
| 770 | return &resp, nil |
| 771 | } |
| 772 | |
| 773 | // Poll fetches the latest state of the long-running operation. |
| 774 | // |
| 775 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 776 | // |
| 777 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 778 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 779 | // If Poll succeeds and the operation has completed successfully, |
| 780 | // op.Done will return true, and the response of the operation is returned. |
| 781 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 782 | func (op *RollbackAwsNodePoolUpdateOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsNodePool, error) { |
| 783 | var resp gkemulticloudpb.AwsNodePool |
| 784 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 785 | return nil, err |
| 786 | } |
| 787 | if !op.Done() { |
| 788 | return nil, nil |
| 789 | } |
| 790 | return &resp, nil |
| 791 | } |
| 792 | |
| 793 | // Metadata returns metadata associated with the long-running operation. |
| 794 | // Metadata itself does not contact the server, but Poll does. |
| 795 | // To get the latest metadata, call this method after a successful call to Poll. |
| 796 | // If the metadata is not available, the returned metadata and error are both nil. |
| 797 | func (op *RollbackAwsNodePoolUpdateOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 798 | var meta gkemulticloudpb.OperationMetadata |
| 799 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 800 | return nil, nil |
| 801 | } else if err != nil { |
| 802 | return nil, err |
| 803 | } |
| 804 | return &meta, nil |
| 805 | } |
| 806 | |
| 807 | // Done reports whether the long-running operation has completed. |
| 808 | func (op *RollbackAwsNodePoolUpdateOperation) Done() bool { |
| 809 | return op.lro.Done() |
| 810 | } |
| 811 | |
| 812 | // Name returns the name of the long-running operation. |
| 813 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 814 | func (op *RollbackAwsNodePoolUpdateOperation) Name() string { |
| 815 | return op.lro.Name() |
| 816 | } |
| 817 | |
| 818 | // UpdateAttachedClusterOperation manages a long-running operation from UpdateAttachedCluster. |
| 819 | type UpdateAttachedClusterOperation struct { |
| 820 | lro *longrunning.Operation |
| 821 | } |
| 822 | |
| 823 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 824 | // |
| 825 | // See documentation of Poll for error-handling information. |
| 826 | func (op *UpdateAttachedClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AttachedCluster, error) { |
| 827 | var resp gkemulticloudpb.AttachedCluster |
| 828 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 829 | return nil, err |
| 830 | } |
| 831 | return &resp, nil |
| 832 | } |
| 833 | |
| 834 | // Poll fetches the latest state of the long-running operation. |
| 835 | // |
| 836 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 837 | // |
| 838 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 839 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 840 | // If Poll succeeds and the operation has completed successfully, |
| 841 | // op.Done will return true, and the response of the operation is returned. |
| 842 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 843 | func (op *UpdateAttachedClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AttachedCluster, error) { |
| 844 | var resp gkemulticloudpb.AttachedCluster |
| 845 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 846 | return nil, err |
| 847 | } |
| 848 | if !op.Done() { |
| 849 | return nil, nil |
| 850 | } |
| 851 | return &resp, nil |
| 852 | } |
| 853 | |
| 854 | // Metadata returns metadata associated with the long-running operation. |
| 855 | // Metadata itself does not contact the server, but Poll does. |
| 856 | // To get the latest metadata, call this method after a successful call to Poll. |
| 857 | // If the metadata is not available, the returned metadata and error are both nil. |
| 858 | func (op *UpdateAttachedClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 859 | var meta gkemulticloudpb.OperationMetadata |
| 860 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 861 | return nil, nil |
| 862 | } else if err != nil { |
| 863 | return nil, err |
| 864 | } |
| 865 | return &meta, nil |
| 866 | } |
| 867 | |
| 868 | // Done reports whether the long-running operation has completed. |
| 869 | func (op *UpdateAttachedClusterOperation) Done() bool { |
| 870 | return op.lro.Done() |
| 871 | } |
| 872 | |
| 873 | // Name returns the name of the long-running operation. |
| 874 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 875 | func (op *UpdateAttachedClusterOperation) Name() string { |
| 876 | return op.lro.Name() |
| 877 | } |
| 878 | |
| 879 | // UpdateAwsClusterOperation manages a long-running operation from UpdateAwsCluster. |
| 880 | type UpdateAwsClusterOperation struct { |
| 881 | lro *longrunning.Operation |
| 882 | } |
| 883 | |
| 884 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 885 | // |
| 886 | // See documentation of Poll for error-handling information. |
| 887 | func (op *UpdateAwsClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsCluster, error) { |
| 888 | var resp gkemulticloudpb.AwsCluster |
| 889 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 890 | return nil, err |
| 891 | } |
| 892 | return &resp, nil |
| 893 | } |
| 894 | |
| 895 | // Poll fetches the latest state of the long-running operation. |
| 896 | // |
| 897 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 898 | // |
| 899 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 900 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 901 | // If Poll succeeds and the operation has completed successfully, |
| 902 | // op.Done will return true, and the response of the operation is returned. |
| 903 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 904 | func (op *UpdateAwsClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsCluster, error) { |
| 905 | var resp gkemulticloudpb.AwsCluster |
| 906 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 907 | return nil, err |
| 908 | } |
| 909 | if !op.Done() { |
| 910 | return nil, nil |
| 911 | } |
| 912 | return &resp, nil |
| 913 | } |
| 914 | |
| 915 | // Metadata returns metadata associated with the long-running operation. |
| 916 | // Metadata itself does not contact the server, but Poll does. |
| 917 | // To get the latest metadata, call this method after a successful call to Poll. |
| 918 | // If the metadata is not available, the returned metadata and error are both nil. |
| 919 | func (op *UpdateAwsClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 920 | var meta gkemulticloudpb.OperationMetadata |
| 921 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 922 | return nil, nil |
| 923 | } else if err != nil { |
| 924 | return nil, err |
| 925 | } |
| 926 | return &meta, nil |
| 927 | } |
| 928 | |
| 929 | // Done reports whether the long-running operation has completed. |
| 930 | func (op *UpdateAwsClusterOperation) Done() bool { |
| 931 | return op.lro.Done() |
| 932 | } |
| 933 | |
| 934 | // Name returns the name of the long-running operation. |
| 935 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 936 | func (op *UpdateAwsClusterOperation) Name() string { |
| 937 | return op.lro.Name() |
| 938 | } |
| 939 | |
| 940 | // UpdateAwsNodePoolOperation manages a long-running operation from UpdateAwsNodePool. |
| 941 | type UpdateAwsNodePoolOperation struct { |
| 942 | lro *longrunning.Operation |
| 943 | } |
| 944 | |
| 945 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 946 | // |
| 947 | // See documentation of Poll for error-handling information. |
| 948 | func (op *UpdateAwsNodePoolOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsNodePool, error) { |
| 949 | var resp gkemulticloudpb.AwsNodePool |
| 950 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 951 | return nil, err |
| 952 | } |
| 953 | return &resp, nil |
| 954 | } |
| 955 | |
| 956 | // Poll fetches the latest state of the long-running operation. |
| 957 | // |
| 958 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 959 | // |
| 960 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 961 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 962 | // If Poll succeeds and the operation has completed successfully, |
| 963 | // op.Done will return true, and the response of the operation is returned. |
| 964 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 965 | func (op *UpdateAwsNodePoolOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AwsNodePool, error) { |
| 966 | var resp gkemulticloudpb.AwsNodePool |
| 967 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 968 | return nil, err |
| 969 | } |
| 970 | if !op.Done() { |
| 971 | return nil, nil |
| 972 | } |
| 973 | return &resp, nil |
| 974 | } |
| 975 | |
| 976 | // Metadata returns metadata associated with the long-running operation. |
| 977 | // Metadata itself does not contact the server, but Poll does. |
| 978 | // To get the latest metadata, call this method after a successful call to Poll. |
| 979 | // If the metadata is not available, the returned metadata and error are both nil. |
| 980 | func (op *UpdateAwsNodePoolOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 981 | var meta gkemulticloudpb.OperationMetadata |
| 982 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 983 | return nil, nil |
| 984 | } else if err != nil { |
| 985 | return nil, err |
| 986 | } |
| 987 | return &meta, nil |
| 988 | } |
| 989 | |
| 990 | // Done reports whether the long-running operation has completed. |
| 991 | func (op *UpdateAwsNodePoolOperation) Done() bool { |
| 992 | return op.lro.Done() |
| 993 | } |
| 994 | |
| 995 | // Name returns the name of the long-running operation. |
| 996 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 997 | func (op *UpdateAwsNodePoolOperation) Name() string { |
| 998 | return op.lro.Name() |
| 999 | } |
| 1000 | |
| 1001 | // UpdateAzureClusterOperation manages a long-running operation from UpdateAzureCluster. |
| 1002 | type UpdateAzureClusterOperation struct { |
| 1003 | lro *longrunning.Operation |
| 1004 | } |
| 1005 | |
| 1006 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 1007 | // |
| 1008 | // See documentation of Poll for error-handling information. |
| 1009 | func (op *UpdateAzureClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureCluster, error) { |
| 1010 | var resp gkemulticloudpb.AzureCluster |
| 1011 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 1012 | return nil, err |
| 1013 | } |
| 1014 | return &resp, nil |
| 1015 | } |
| 1016 | |
| 1017 | // Poll fetches the latest state of the long-running operation. |
| 1018 | // |
| 1019 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 1020 | // |
| 1021 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 1022 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 1023 | // If Poll succeeds and the operation has completed successfully, |
| 1024 | // op.Done will return true, and the response of the operation is returned. |
| 1025 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 1026 | func (op *UpdateAzureClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureCluster, error) { |
| 1027 | var resp gkemulticloudpb.AzureCluster |
| 1028 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 1029 | return nil, err |
| 1030 | } |
| 1031 | if !op.Done() { |
| 1032 | return nil, nil |
| 1033 | } |
| 1034 | return &resp, nil |
| 1035 | } |
| 1036 | |
| 1037 | // Metadata returns metadata associated with the long-running operation. |
| 1038 | // Metadata itself does not contact the server, but Poll does. |
| 1039 | // To get the latest metadata, call this method after a successful call to Poll. |
| 1040 | // If the metadata is not available, the returned metadata and error are both nil. |
| 1041 | func (op *UpdateAzureClusterOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 1042 | var meta gkemulticloudpb.OperationMetadata |
| 1043 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 1044 | return nil, nil |
| 1045 | } else if err != nil { |
| 1046 | return nil, err |
| 1047 | } |
| 1048 | return &meta, nil |
| 1049 | } |
| 1050 | |
| 1051 | // Done reports whether the long-running operation has completed. |
| 1052 | func (op *UpdateAzureClusterOperation) Done() bool { |
| 1053 | return op.lro.Done() |
| 1054 | } |
| 1055 | |
| 1056 | // Name returns the name of the long-running operation. |
| 1057 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 1058 | func (op *UpdateAzureClusterOperation) Name() string { |
| 1059 | return op.lro.Name() |
| 1060 | } |
| 1061 | |
| 1062 | // UpdateAzureNodePoolOperation manages a long-running operation from UpdateAzureNodePool. |
| 1063 | type UpdateAzureNodePoolOperation struct { |
| 1064 | lro *longrunning.Operation |
| 1065 | } |
| 1066 | |
| 1067 | // Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 1068 | // |
| 1069 | // See documentation of Poll for error-handling information. |
| 1070 | func (op *UpdateAzureNodePoolOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureNodePool, error) { |
| 1071 | var resp gkemulticloudpb.AzureNodePool |
| 1072 | if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 1073 | return nil, err |
| 1074 | } |
| 1075 | return &resp, nil |
| 1076 | } |
| 1077 | |
| 1078 | // Poll fetches the latest state of the long-running operation. |
| 1079 | // |
| 1080 | // Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 1081 | // |
| 1082 | // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 1083 | // the operation has completed with failure, the error is returned and op.Done will return true. |
| 1084 | // If Poll succeeds and the operation has completed successfully, |
| 1085 | // op.Done will return true, and the response of the operation is returned. |
| 1086 | // If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 1087 | func (op *UpdateAzureNodePoolOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkemulticloudpb.AzureNodePool, error) { |
| 1088 | var resp gkemulticloudpb.AzureNodePool |
| 1089 | if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 1090 | return nil, err |
| 1091 | } |
| 1092 | if !op.Done() { |
| 1093 | return nil, nil |
| 1094 | } |
| 1095 | return &resp, nil |
| 1096 | } |
| 1097 | |
| 1098 | // Metadata returns metadata associated with the long-running operation. |
| 1099 | // Metadata itself does not contact the server, but Poll does. |
| 1100 | // To get the latest metadata, call this method after a successful call to Poll. |
| 1101 | // If the metadata is not available, the returned metadata and error are both nil. |
| 1102 | func (op *UpdateAzureNodePoolOperation) Metadata() (*gkemulticloudpb.OperationMetadata, error) { |
| 1103 | var meta gkemulticloudpb.OperationMetadata |
| 1104 | if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 1105 | return nil, nil |
| 1106 | } else if err != nil { |
| 1107 | return nil, err |
| 1108 | } |
| 1109 | return &meta, nil |
| 1110 | } |
| 1111 | |
| 1112 | // Done reports whether the long-running operation has completed. |
| 1113 | func (op *UpdateAzureNodePoolOperation) Done() bool { |
| 1114 | return op.lro.Done() |
| 1115 | } |
| 1116 | |
| 1117 | // Name returns the name of the long-running operation. |
| 1118 | // The name is assigned by the server and is unique within the service from which the operation is created. |
| 1119 | func (op *UpdateAzureNodePoolOperation) Name() string { |
| 1120 | return op.lro.Name() |
| 1121 | } |
| 1122 | |
| 1123 | // AttachedClusterIterator manages a stream of *gkemulticloudpb.AttachedCluster. |
| 1124 | type AttachedClusterIterator struct { |
| 1125 | items []*gkemulticloudpb.AttachedCluster |
| 1126 | pageInfo *iterator.PageInfo |
| 1127 | nextFunc func() error |
| 1128 | |
| 1129 | // Response is the raw response for the current page. |
| 1130 | // It must be cast to the RPC response type. |
| 1131 | // Calling Next() or InternalFetch() updates this value. |
| 1132 | Response interface{} |
| 1133 | |
| 1134 | // InternalFetch is for use by the Google Cloud Libraries only. |
| 1135 | // It is not part of the stable interface of this package. |
| 1136 | // |
| 1137 | // InternalFetch returns results from a single call to the underlying RPC. |
| 1138 | // The number of results is no greater than pageSize. |
| 1139 | // If there are no more results, nextPageToken is empty and err is nil. |
| 1140 | InternalFetch func(pageSize int, pageToken string) (results []*gkemulticloudpb.AttachedCluster, nextPageToken string, err error) |
| 1141 | } |
| 1142 | |
| 1143 | // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1144 | func (it *AttachedClusterIterator) PageInfo() *iterator.PageInfo { |
| 1145 | return it.pageInfo |
| 1146 | } |
| 1147 | |
| 1148 | // Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1149 | // results. Once Next returns Done, all subsequent calls will return Done. |
| 1150 | func (it *AttachedClusterIterator) Next() (*gkemulticloudpb.AttachedCluster, error) { |
| 1151 | var item *gkemulticloudpb.AttachedCluster |
| 1152 | if err := it.nextFunc(); err != nil { |
| 1153 | return item, err |
| 1154 | } |
| 1155 | item = it.items[0] |
| 1156 | it.items = it.items[1:] |
| 1157 | return item, nil |
| 1158 | } |
| 1159 | |
| 1160 | func (it *AttachedClusterIterator) bufLen() int { |
| 1161 | return len(it.items) |
| 1162 | } |
| 1163 | |
| 1164 | func (it *AttachedClusterIterator) takeBuf() interface{} { |
| 1165 | b := it.items |
| 1166 | it.items = nil |
| 1167 | return b |
| 1168 | } |
| 1169 | |
| 1170 | // AwsClusterIterator manages a stream of *gkemulticloudpb.AwsCluster. |
| 1171 | type AwsClusterIterator struct { |
| 1172 | items []*gkemulticloudpb.AwsCluster |
| 1173 | pageInfo *iterator.PageInfo |
| 1174 | nextFunc func() error |
| 1175 | |
| 1176 | // Response is the raw response for the current page. |
| 1177 | // It must be cast to the RPC response type. |
| 1178 | // Calling Next() or InternalFetch() updates this value. |
| 1179 | Response interface{} |
| 1180 | |
| 1181 | // InternalFetch is for use by the Google Cloud Libraries only. |
| 1182 | // It is not part of the stable interface of this package. |
| 1183 | // |
| 1184 | // InternalFetch returns results from a single call to the underlying RPC. |
| 1185 | // The number of results is no greater than pageSize. |
| 1186 | // If there are no more results, nextPageToken is empty and err is nil. |
| 1187 | InternalFetch func(pageSize int, pageToken string) (results []*gkemulticloudpb.AwsCluster, nextPageToken string, err error) |
| 1188 | } |
| 1189 | |
| 1190 | // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1191 | func (it *AwsClusterIterator) PageInfo() *iterator.PageInfo { |
| 1192 | return it.pageInfo |
| 1193 | } |
| 1194 | |
| 1195 | // Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1196 | // results. Once Next returns Done, all subsequent calls will return Done. |
| 1197 | func (it *AwsClusterIterator) Next() (*gkemulticloudpb.AwsCluster, error) { |
| 1198 | var item *gkemulticloudpb.AwsCluster |
| 1199 | if err := it.nextFunc(); err != nil { |
| 1200 | return item, err |
| 1201 | } |
| 1202 | item = it.items[0] |
| 1203 | it.items = it.items[1:] |
| 1204 | return item, nil |
| 1205 | } |
| 1206 | |
| 1207 | func (it *AwsClusterIterator) bufLen() int { |
| 1208 | return len(it.items) |
| 1209 | } |
| 1210 | |
| 1211 | func (it *AwsClusterIterator) takeBuf() interface{} { |
| 1212 | b := it.items |
| 1213 | it.items = nil |
| 1214 | return b |
| 1215 | } |
| 1216 | |
| 1217 | // AwsNodePoolIterator manages a stream of *gkemulticloudpb.AwsNodePool. |
| 1218 | type AwsNodePoolIterator struct { |
| 1219 | items []*gkemulticloudpb.AwsNodePool |
| 1220 | pageInfo *iterator.PageInfo |
| 1221 | nextFunc func() error |
| 1222 | |
| 1223 | // Response is the raw response for the current page. |
| 1224 | // It must be cast to the RPC response type. |
| 1225 | // Calling Next() or InternalFetch() updates this value. |
| 1226 | Response interface{} |
| 1227 | |
| 1228 | // InternalFetch is for use by the Google Cloud Libraries only. |
| 1229 | // It is not part of the stable interface of this package. |
| 1230 | // |
| 1231 | // InternalFetch returns results from a single call to the underlying RPC. |
| 1232 | // The number of results is no greater than pageSize. |
| 1233 | // If there are no more results, nextPageToken is empty and err is nil. |
| 1234 | InternalFetch func(pageSize int, pageToken string) (results []*gkemulticloudpb.AwsNodePool, nextPageToken string, err error) |
| 1235 | } |
| 1236 | |
| 1237 | // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1238 | func (it *AwsNodePoolIterator) PageInfo() *iterator.PageInfo { |
| 1239 | return it.pageInfo |
| 1240 | } |
| 1241 | |
| 1242 | // Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1243 | // results. Once Next returns Done, all subsequent calls will return Done. |
| 1244 | func (it *AwsNodePoolIterator) Next() (*gkemulticloudpb.AwsNodePool, error) { |
| 1245 | var item *gkemulticloudpb.AwsNodePool |
| 1246 | if err := it.nextFunc(); err != nil { |
| 1247 | return item, err |
| 1248 | } |
| 1249 | item = it.items[0] |
| 1250 | it.items = it.items[1:] |
| 1251 | return item, nil |
| 1252 | } |
| 1253 | |
| 1254 | func (it *AwsNodePoolIterator) bufLen() int { |
| 1255 | return len(it.items) |
| 1256 | } |
| 1257 | |
| 1258 | func (it *AwsNodePoolIterator) takeBuf() interface{} { |
| 1259 | b := it.items |
| 1260 | it.items = nil |
| 1261 | return b |
| 1262 | } |
| 1263 | |
| 1264 | // AzureClientIterator manages a stream of *gkemulticloudpb.AzureClient. |
| 1265 | type AzureClientIterator struct { |
| 1266 | items []*gkemulticloudpb.AzureClient |
| 1267 | pageInfo *iterator.PageInfo |
| 1268 | nextFunc func() error |
| 1269 | |
| 1270 | // Response is the raw response for the current page. |
| 1271 | // It must be cast to the RPC response type. |
| 1272 | // Calling Next() or InternalFetch() updates this value. |
| 1273 | Response interface{} |
| 1274 | |
| 1275 | // InternalFetch is for use by the Google Cloud Libraries only. |
| 1276 | // It is not part of the stable interface of this package. |
| 1277 | // |
| 1278 | // InternalFetch returns results from a single call to the underlying RPC. |
| 1279 | // The number of results is no greater than pageSize. |
| 1280 | // If there are no more results, nextPageToken is empty and err is nil. |
| 1281 | InternalFetch func(pageSize int, pageToken string) (results []*gkemulticloudpb.AzureClient, nextPageToken string, err error) |
| 1282 | } |
| 1283 | |
| 1284 | // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1285 | func (it *AzureClientIterator) PageInfo() *iterator.PageInfo { |
| 1286 | return it.pageInfo |
| 1287 | } |
| 1288 | |
| 1289 | // Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1290 | // results. Once Next returns Done, all subsequent calls will return Done. |
| 1291 | func (it *AzureClientIterator) Next() (*gkemulticloudpb.AzureClient, error) { |
| 1292 | var item *gkemulticloudpb.AzureClient |
| 1293 | if err := it.nextFunc(); err != nil { |
| 1294 | return item, err |
| 1295 | } |
| 1296 | item = it.items[0] |
| 1297 | it.items = it.items[1:] |
| 1298 | return item, nil |
| 1299 | } |
| 1300 | |
| 1301 | func (it *AzureClientIterator) bufLen() int { |
| 1302 | return len(it.items) |
| 1303 | } |
| 1304 | |
| 1305 | func (it *AzureClientIterator) takeBuf() interface{} { |
| 1306 | b := it.items |
| 1307 | it.items = nil |
| 1308 | return b |
| 1309 | } |
| 1310 | |
| 1311 | // AzureClusterIterator manages a stream of *gkemulticloudpb.AzureCluster. |
| 1312 | type AzureClusterIterator struct { |
| 1313 | items []*gkemulticloudpb.AzureCluster |
| 1314 | pageInfo *iterator.PageInfo |
| 1315 | nextFunc func() error |
| 1316 | |
| 1317 | // Response is the raw response for the current page. |
| 1318 | // It must be cast to the RPC response type. |
| 1319 | // Calling Next() or InternalFetch() updates this value. |
| 1320 | Response interface{} |
| 1321 | |
| 1322 | // InternalFetch is for use by the Google Cloud Libraries only. |
| 1323 | // It is not part of the stable interface of this package. |
| 1324 | // |
| 1325 | // InternalFetch returns results from a single call to the underlying RPC. |
| 1326 | // The number of results is no greater than pageSize. |
| 1327 | // If there are no more results, nextPageToken is empty and err is nil. |
| 1328 | InternalFetch func(pageSize int, pageToken string) (results []*gkemulticloudpb.AzureCluster, nextPageToken string, err error) |
| 1329 | } |
| 1330 | |
| 1331 | // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1332 | func (it *AzureClusterIterator) PageInfo() *iterator.PageInfo { |
| 1333 | return it.pageInfo |
| 1334 | } |
| 1335 | |
| 1336 | // Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1337 | // results. Once Next returns Done, all subsequent calls will return Done. |
| 1338 | func (it *AzureClusterIterator) Next() (*gkemulticloudpb.AzureCluster, error) { |
| 1339 | var item *gkemulticloudpb.AzureCluster |
| 1340 | if err := it.nextFunc(); err != nil { |
| 1341 | return item, err |
| 1342 | } |
| 1343 | item = it.items[0] |
| 1344 | it.items = it.items[1:] |
| 1345 | return item, nil |
| 1346 | } |
| 1347 | |
| 1348 | func (it *AzureClusterIterator) bufLen() int { |
| 1349 | return len(it.items) |
| 1350 | } |
| 1351 | |
| 1352 | func (it *AzureClusterIterator) takeBuf() interface{} { |
| 1353 | b := it.items |
| 1354 | it.items = nil |
| 1355 | return b |
| 1356 | } |
| 1357 | |
| 1358 | // AzureNodePoolIterator manages a stream of *gkemulticloudpb.AzureNodePool. |
| 1359 | type AzureNodePoolIterator struct { |
| 1360 | items []*gkemulticloudpb.AzureNodePool |
| 1361 | pageInfo *iterator.PageInfo |
| 1362 | nextFunc func() error |
| 1363 | |
| 1364 | // Response is the raw response for the current page. |
| 1365 | // It must be cast to the RPC response type. |
| 1366 | // Calling Next() or InternalFetch() updates this value. |
| 1367 | Response interface{} |
| 1368 | |
| 1369 | // InternalFetch is for use by the Google Cloud Libraries only. |
| 1370 | // It is not part of the stable interface of this package. |
| 1371 | // |
| 1372 | // InternalFetch returns results from a single call to the underlying RPC. |
| 1373 | // The number of results is no greater than pageSize. |
| 1374 | // If there are no more results, nextPageToken is empty and err is nil. |
| 1375 | InternalFetch func(pageSize int, pageToken string) (results []*gkemulticloudpb.AzureNodePool, nextPageToken string, err error) |
| 1376 | } |
| 1377 | |
| 1378 | // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1379 | func (it *AzureNodePoolIterator) PageInfo() *iterator.PageInfo { |
| 1380 | return it.pageInfo |
| 1381 | } |
| 1382 | |
| 1383 | // Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1384 | // results. Once Next returns Done, all subsequent calls will return Done. |
| 1385 | func (it *AzureNodePoolIterator) Next() (*gkemulticloudpb.AzureNodePool, error) { |
| 1386 | var item *gkemulticloudpb.AzureNodePool |
| 1387 | if err := it.nextFunc(); err != nil { |
| 1388 | return item, err |
| 1389 | } |
| 1390 | item = it.items[0] |
| 1391 | it.items = it.items[1:] |
| 1392 | return item, nil |
| 1393 | } |
| 1394 | |
| 1395 | func (it *AzureNodePoolIterator) bufLen() int { |
| 1396 | return len(it.items) |
| 1397 | } |
| 1398 | |
| 1399 | func (it *AzureNodePoolIterator) takeBuf() interface{} { |
| 1400 | b := it.items |
| 1401 | it.items = nil |
| 1402 | return b |
| 1403 | } |
| 1404 | |
| 1405 | // OperationIterator manages a stream of *longrunningpb.Operation. |
| 1406 | type OperationIterator struct { |
| 1407 | items []*longrunningpb.Operation |
| 1408 | pageInfo *iterator.PageInfo |
| 1409 | nextFunc func() error |
| 1410 | |
| 1411 | // Response is the raw response for the current page. |
| 1412 | // It must be cast to the RPC response type. |
| 1413 | // Calling Next() or InternalFetch() updates this value. |
| 1414 | Response interface{} |
| 1415 | |
| 1416 | // InternalFetch is for use by the Google Cloud Libraries only. |
| 1417 | // It is not part of the stable interface of this package. |
| 1418 | // |
| 1419 | // InternalFetch returns results from a single call to the underlying RPC. |
| 1420 | // The number of results is no greater than pageSize. |
| 1421 | // If there are no more results, nextPageToken is empty and err is nil. |
| 1422 | InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) |
| 1423 | } |
| 1424 | |
| 1425 | // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1426 | func (it *OperationIterator) PageInfo() *iterator.PageInfo { |
| 1427 | return it.pageInfo |
| 1428 | } |
| 1429 | |
| 1430 | // Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1431 | // results. Once Next returns Done, all subsequent calls will return Done. |
| 1432 | func (it *OperationIterator) Next() (*longrunningpb.Operation, error) { |
| 1433 | var item *longrunningpb.Operation |
| 1434 | if err := it.nextFunc(); err != nil { |
| 1435 | return item, err |
| 1436 | } |
| 1437 | item = it.items[0] |
| 1438 | it.items = it.items[1:] |
| 1439 | return item, nil |
| 1440 | } |
| 1441 | |
| 1442 | func (it *OperationIterator) bufLen() int { |
| 1443 | return len(it.items) |
| 1444 | } |
| 1445 | |
| 1446 | func (it *OperationIterator) takeBuf() interface{} { |
| 1447 | b := it.items |
| 1448 | it.items = nil |
| 1449 | return b |
| 1450 | } |