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