| 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 service |
| 18 |
|
| 19 |
import ( |
| 20 |
"context" |
| 21 |
"time" |
| 22 |
|
| 23 |
"cloud.google.com/go/longrunning" |
| 24 |
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" |
| 25 |
servicepb "cloud.google.com/go/orchestration/airflow/service/apiv1/servicepb" |
| 26 |
gax "github.com/googleapis/gax-go/v2" |
| 27 |
"google.golang.org/api/iterator" |
| 28 |
) |
| 29 |
|
| 30 |
// CheckUpgradeOperation manages a long-running operation from CheckUpgrade. |
| 31 |
type CheckUpgradeOperation struct { |
| 32 |
lro *longrunning.Operation |
| 33 |
pollPath string |
| 34 |
} |
| 35 |
|
| 36 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 37 |
// |
| 38 |
// See documentation of Poll for error-handling information. |
| 39 |
func (op *CheckUpgradeOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.CheckUpgradeResponse, error) { |
| 40 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 41 |
var resp servicepb.CheckUpgradeResponse |
| 42 |
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 43 |
return nil, err |
| 44 |
} |
| 45 |
return &resp, nil |
| 46 |
} |
| 47 |
|
| 48 |
// Poll fetches the latest state of the long-running operation. |
| 49 |
// |
| 50 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 51 |
// |
| 52 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 53 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 54 |
// If Poll succeeds and the operation has completed successfully, |
| 55 |
// op.Done will return true, and the response of the operation is returned. |
| 56 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 57 |
func (op *CheckUpgradeOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.CheckUpgradeResponse, error) { |
| 58 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 59 |
var resp servicepb.CheckUpgradeResponse |
| 60 |
if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 61 |
return nil, err |
| 62 |
} |
| 63 |
if !op.Done() { |
| 64 |
return nil, nil |
| 65 |
} |
| 66 |
return &resp, nil |
| 67 |
} |
| 68 |
|
| 69 |
// Metadata returns metadata associated with the long-running operation. |
| 70 |
// Metadata itself does not contact the server, but Poll does. |
| 71 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 72 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 73 |
func (op *CheckUpgradeOperation) Metadata() (*servicepb.OperationMetadata, error) { |
| 74 |
var meta servicepb.OperationMetadata |
| 75 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 76 |
return nil, nil |
| 77 |
} else if err != nil { |
| 78 |
return nil, err |
| 79 |
} |
| 80 |
return &meta, nil |
| 81 |
} |
| 82 |
|
| 83 |
// Done reports whether the long-running operation has completed. |
| 84 |
func (op *CheckUpgradeOperation) Done() bool { |
| 85 |
return op.lro.Done() |
| 86 |
} |
| 87 |
|
| 88 |
// Name returns the name of the long-running operation. |
| 89 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 90 |
func (op *CheckUpgradeOperation) Name() string { |
| 91 |
return op.lro.Name() |
| 92 |
} |
| 93 |
|
| 94 |
// CreateEnvironmentOperation manages a long-running operation from CreateEnvironment. |
| 95 |
type CreateEnvironmentOperation struct { |
| 96 |
lro *longrunning.Operation |
| 97 |
pollPath string |
| 98 |
} |
| 99 |
|
| 100 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 101 |
// |
| 102 |
// See documentation of Poll for error-handling information. |
| 103 |
func (op *CreateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error) { |
| 104 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 105 |
var resp servicepb.Environment |
| 106 |
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 107 |
return nil, err |
| 108 |
} |
| 109 |
return &resp, nil |
| 110 |
} |
| 111 |
|
| 112 |
// Poll fetches the latest state of the long-running operation. |
| 113 |
// |
| 114 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 115 |
// |
| 116 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 117 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 118 |
// If Poll succeeds and the operation has completed successfully, |
| 119 |
// op.Done will return true, and the response of the operation is returned. |
| 120 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 121 |
func (op *CreateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error) { |
| 122 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 123 |
var resp servicepb.Environment |
| 124 |
if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 125 |
return nil, err |
| 126 |
} |
| 127 |
if !op.Done() { |
| 128 |
return nil, nil |
| 129 |
} |
| 130 |
return &resp, nil |
| 131 |
} |
| 132 |
|
| 133 |
// Metadata returns metadata associated with the long-running operation. |
| 134 |
// Metadata itself does not contact the server, but Poll does. |
| 135 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 136 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 137 |
func (op *CreateEnvironmentOperation) Metadata() (*servicepb.OperationMetadata, error) { |
| 138 |
var meta servicepb.OperationMetadata |
| 139 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 140 |
return nil, nil |
| 141 |
} else if err != nil { |
| 142 |
return nil, err |
| 143 |
} |
| 144 |
return &meta, nil |
| 145 |
} |
| 146 |
|
| 147 |
// Done reports whether the long-running operation has completed. |
| 148 |
func (op *CreateEnvironmentOperation) Done() bool { |
| 149 |
return op.lro.Done() |
| 150 |
} |
| 151 |
|
| 152 |
// Name returns the name of the long-running operation. |
| 153 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 154 |
func (op *CreateEnvironmentOperation) Name() string { |
| 155 |
return op.lro.Name() |
| 156 |
} |
| 157 |
|
| 158 |
// DatabaseFailoverOperation manages a long-running operation from DatabaseFailover. |
| 159 |
type DatabaseFailoverOperation struct { |
| 160 |
lro *longrunning.Operation |
| 161 |
pollPath string |
| 162 |
} |
| 163 |
|
| 164 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 165 |
// |
| 166 |
// See documentation of Poll for error-handling information. |
| 167 |
func (op *DatabaseFailoverOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.DatabaseFailoverResponse, error) { |
| 168 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 169 |
var resp servicepb.DatabaseFailoverResponse |
| 170 |
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 171 |
return nil, err |
| 172 |
} |
| 173 |
return &resp, nil |
| 174 |
} |
| 175 |
|
| 176 |
// Poll fetches the latest state of the long-running operation. |
| 177 |
// |
| 178 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 179 |
// |
| 180 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 181 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 182 |
// If Poll succeeds and the operation has completed successfully, |
| 183 |
// op.Done will return true, and the response of the operation is returned. |
| 184 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 185 |
func (op *DatabaseFailoverOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.DatabaseFailoverResponse, error) { |
| 186 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 187 |
var resp servicepb.DatabaseFailoverResponse |
| 188 |
if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 189 |
return nil, err |
| 190 |
} |
| 191 |
if !op.Done() { |
| 192 |
return nil, nil |
| 193 |
} |
| 194 |
return &resp, nil |
| 195 |
} |
| 196 |
|
| 197 |
// Metadata returns metadata associated with the long-running operation. |
| 198 |
// Metadata itself does not contact the server, but Poll does. |
| 199 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 200 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 201 |
func (op *DatabaseFailoverOperation) Metadata() (*servicepb.OperationMetadata, error) { |
| 202 |
var meta servicepb.OperationMetadata |
| 203 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 204 |
return nil, nil |
| 205 |
} else if err != nil { |
| 206 |
return nil, err |
| 207 |
} |
| 208 |
return &meta, nil |
| 209 |
} |
| 210 |
|
| 211 |
// Done reports whether the long-running operation has completed. |
| 212 |
func (op *DatabaseFailoverOperation) Done() bool { |
| 213 |
return op.lro.Done() |
| 214 |
} |
| 215 |
|
| 216 |
// Name returns the name of the long-running operation. |
| 217 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 218 |
func (op *DatabaseFailoverOperation) Name() string { |
| 219 |
return op.lro.Name() |
| 220 |
} |
| 221 |
|
| 222 |
// DeleteEnvironmentOperation manages a long-running operation from DeleteEnvironment. |
| 223 |
type DeleteEnvironmentOperation struct { |
| 224 |
lro *longrunning.Operation |
| 225 |
pollPath string |
| 226 |
} |
| 227 |
|
| 228 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 229 |
// |
| 230 |
// See documentation of Poll for error-handling information. |
| 231 |
func (op *DeleteEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 232 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 233 |
return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 234 |
} |
| 235 |
|
| 236 |
// Poll fetches the latest state of the long-running operation. |
| 237 |
// |
| 238 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 239 |
// |
| 240 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 241 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 242 |
// If Poll succeeds and the operation has completed successfully, |
| 243 |
// op.Done will return true, and the response of the operation is returned. |
| 244 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 245 |
func (op *DeleteEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 246 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 247 |
return op.lro.Poll(ctx, nil, opts...) |
| 248 |
} |
| 249 |
|
| 250 |
// Metadata returns metadata associated with the long-running operation. |
| 251 |
// Metadata itself does not contact the server, but Poll does. |
| 252 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 253 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 254 |
func (op *DeleteEnvironmentOperation) Metadata() (*servicepb.OperationMetadata, error) { |
| 255 |
var meta servicepb.OperationMetadata |
| 256 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 257 |
return nil, nil |
| 258 |
} else if err != nil { |
| 259 |
return nil, err |
| 260 |
} |
| 261 |
return &meta, nil |
| 262 |
} |
| 263 |
|
| 264 |
// Done reports whether the long-running operation has completed. |
| 265 |
func (op *DeleteEnvironmentOperation) Done() bool { |
| 266 |
return op.lro.Done() |
| 267 |
} |
| 268 |
|
| 269 |
// Name returns the name of the long-running operation. |
| 270 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 271 |
func (op *DeleteEnvironmentOperation) Name() string { |
| 272 |
return op.lro.Name() |
| 273 |
} |
| 274 |
|
| 275 |
// LoadSnapshotOperation manages a long-running operation from LoadSnapshot. |
| 276 |
type LoadSnapshotOperation struct { |
| 277 |
lro *longrunning.Operation |
| 278 |
pollPath string |
| 279 |
} |
| 280 |
|
| 281 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 282 |
// |
| 283 |
// See documentation of Poll for error-handling information. |
| 284 |
func (op *LoadSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.LoadSnapshotResponse, error) { |
| 285 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 286 |
var resp servicepb.LoadSnapshotResponse |
| 287 |
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 288 |
return nil, err |
| 289 |
} |
| 290 |
return &resp, nil |
| 291 |
} |
| 292 |
|
| 293 |
// Poll fetches the latest state of the long-running operation. |
| 294 |
// |
| 295 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 296 |
// |
| 297 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 298 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 299 |
// If Poll succeeds and the operation has completed successfully, |
| 300 |
// op.Done will return true, and the response of the operation is returned. |
| 301 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 302 |
func (op *LoadSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.LoadSnapshotResponse, error) { |
| 303 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 304 |
var resp servicepb.LoadSnapshotResponse |
| 305 |
if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 306 |
return nil, err |
| 307 |
} |
| 308 |
if !op.Done() { |
| 309 |
return nil, nil |
| 310 |
} |
| 311 |
return &resp, nil |
| 312 |
} |
| 313 |
|
| 314 |
// Metadata returns metadata associated with the long-running operation. |
| 315 |
// Metadata itself does not contact the server, but Poll does. |
| 316 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 317 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 318 |
func (op *LoadSnapshotOperation) Metadata() (*servicepb.OperationMetadata, error) { |
| 319 |
var meta servicepb.OperationMetadata |
| 320 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 321 |
return nil, nil |
| 322 |
} else if err != nil { |
| 323 |
return nil, err |
| 324 |
} |
| 325 |
return &meta, nil |
| 326 |
} |
| 327 |
|
| 328 |
// Done reports whether the long-running operation has completed. |
| 329 |
func (op *LoadSnapshotOperation) Done() bool { |
| 330 |
return op.lro.Done() |
| 331 |
} |
| 332 |
|
| 333 |
// Name returns the name of the long-running operation. |
| 334 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 335 |
func (op *LoadSnapshotOperation) Name() string { |
| 336 |
return op.lro.Name() |
| 337 |
} |
| 338 |
|
| 339 |
// SaveSnapshotOperation manages a long-running operation from SaveSnapshot. |
| 340 |
type SaveSnapshotOperation struct { |
| 341 |
lro *longrunning.Operation |
| 342 |
pollPath string |
| 343 |
} |
| 344 |
|
| 345 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 346 |
// |
| 347 |
// See documentation of Poll for error-handling information. |
| 348 |
func (op *SaveSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.SaveSnapshotResponse, error) { |
| 349 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 350 |
var resp servicepb.SaveSnapshotResponse |
| 351 |
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 352 |
return nil, err |
| 353 |
} |
| 354 |
return &resp, nil |
| 355 |
} |
| 356 |
|
| 357 |
// Poll fetches the latest state of the long-running operation. |
| 358 |
// |
| 359 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 360 |
// |
| 361 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 362 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 363 |
// If Poll succeeds and the operation has completed successfully, |
| 364 |
// op.Done will return true, and the response of the operation is returned. |
| 365 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 366 |
func (op *SaveSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.SaveSnapshotResponse, error) { |
| 367 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 368 |
var resp servicepb.SaveSnapshotResponse |
| 369 |
if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 370 |
return nil, err |
| 371 |
} |
| 372 |
if !op.Done() { |
| 373 |
return nil, nil |
| 374 |
} |
| 375 |
return &resp, nil |
| 376 |
} |
| 377 |
|
| 378 |
// Metadata returns metadata associated with the long-running operation. |
| 379 |
// Metadata itself does not contact the server, but Poll does. |
| 380 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 381 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 382 |
func (op *SaveSnapshotOperation) Metadata() (*servicepb.OperationMetadata, error) { |
| 383 |
var meta servicepb.OperationMetadata |
| 384 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 385 |
return nil, nil |
| 386 |
} else if err != nil { |
| 387 |
return nil, err |
| 388 |
} |
| 389 |
return &meta, nil |
| 390 |
} |
| 391 |
|
| 392 |
// Done reports whether the long-running operation has completed. |
| 393 |
func (op *SaveSnapshotOperation) Done() bool { |
| 394 |
return op.lro.Done() |
| 395 |
} |
| 396 |
|
| 397 |
// Name returns the name of the long-running operation. |
| 398 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 399 |
func (op *SaveSnapshotOperation) Name() string { |
| 400 |
return op.lro.Name() |
| 401 |
} |
| 402 |
|
| 403 |
// UpdateEnvironmentOperation manages a long-running operation from UpdateEnvironment. |
| 404 |
type UpdateEnvironmentOperation struct { |
| 405 |
lro *longrunning.Operation |
| 406 |
pollPath string |
| 407 |
} |
| 408 |
|
| 409 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 410 |
// |
| 411 |
// See documentation of Poll for error-handling information. |
| 412 |
func (op *UpdateEnvironmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error) { |
| 413 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 414 |
var resp servicepb.Environment |
| 415 |
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 416 |
return nil, err |
| 417 |
} |
| 418 |
return &resp, nil |
| 419 |
} |
| 420 |
|
| 421 |
// Poll fetches the latest state of the long-running operation. |
| 422 |
// |
| 423 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 424 |
// |
| 425 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 426 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 427 |
// If Poll succeeds and the operation has completed successfully, |
| 428 |
// op.Done will return true, and the response of the operation is returned. |
| 429 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 430 |
func (op *UpdateEnvironmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicepb.Environment, error) { |
| 431 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 432 |
var resp servicepb.Environment |
| 433 |
if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 434 |
return nil, err |
| 435 |
} |
| 436 |
if !op.Done() { |
| 437 |
return nil, nil |
| 438 |
} |
| 439 |
return &resp, nil |
| 440 |
} |
| 441 |
|
| 442 |
// Metadata returns metadata associated with the long-running operation. |
| 443 |
// Metadata itself does not contact the server, but Poll does. |
| 444 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 445 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 446 |
func (op *UpdateEnvironmentOperation) Metadata() (*servicepb.OperationMetadata, error) { |
| 447 |
var meta servicepb.OperationMetadata |
| 448 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 449 |
return nil, nil |
| 450 |
} else if err != nil { |
| 451 |
return nil, err |
| 452 |
} |
| 453 |
return &meta, nil |
| 454 |
} |
| 455 |
|
| 456 |
// Done reports whether the long-running operation has completed. |
| 457 |
func (op *UpdateEnvironmentOperation) Done() bool { |
| 458 |
return op.lro.Done() |
| 459 |
} |
| 460 |
|
| 461 |
// Name returns the name of the long-running operation. |
| 462 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 463 |
func (op *UpdateEnvironmentOperation) Name() string { |
| 464 |
return op.lro.Name() |
| 465 |
} |
| 466 |
|
| 467 |
// EnvironmentIterator manages a stream of *servicepb.Environment. |
| 468 |
type EnvironmentIterator struct { |
| 469 |
items []*servicepb.Environment |
| 470 |
pageInfo *iterator.PageInfo |
| 471 |
nextFunc func() error |
| 472 |
|
| 473 |
// Response is the raw response for the current page. |
| 474 |
// It must be cast to the RPC response type. |
| 475 |
// Calling Next() or InternalFetch() updates this value. |
| 476 |
Response interface{} |
| 477 |
|
| 478 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 479 |
// It is not part of the stable interface of this package. |
| 480 |
// |
| 481 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 482 |
// The number of results is no greater than pageSize. |
| 483 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 484 |
InternalFetch func(pageSize int, pageToken string) (results []*servicepb.Environment, nextPageToken string, err error) |
| 485 |
} |
| 486 |
|
| 487 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 488 |
func (it *EnvironmentIterator) PageInfo() *iterator.PageInfo { |
| 489 |
return it.pageInfo |
| 490 |
} |
| 491 |
|
| 492 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 493 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 494 |
func (it *EnvironmentIterator) Next() (*servicepb.Environment, error) { |
| 495 |
var item *servicepb.Environment |
| 496 |
if err := it.nextFunc(); err != nil { |
| 497 |
return item, err |
| 498 |
} |
| 499 |
item = it.items[0] |
| 500 |
it.items = it.items[1:] |
| 501 |
return item, nil |
| 502 |
} |
| 503 |
|
| 504 |
func (it *EnvironmentIterator) bufLen() int { |
| 505 |
return len(it.items) |
| 506 |
} |
| 507 |
|
| 508 |
func (it *EnvironmentIterator) takeBuf() interface{} { |
| 509 |
b := it.items |
| 510 |
it.items = nil |
| 511 |
return b |
| 512 |
} |
| 513 |
|
| 514 |
// ImageVersionIterator manages a stream of *servicepb.ImageVersion. |
| 515 |
type ImageVersionIterator struct { |
| 516 |
items []*servicepb.ImageVersion |
| 517 |
pageInfo *iterator.PageInfo |
| 518 |
nextFunc func() error |
| 519 |
|
| 520 |
// Response is the raw response for the current page. |
| 521 |
// It must be cast to the RPC response type. |
| 522 |
// Calling Next() or InternalFetch() updates this value. |
| 523 |
Response interface{} |
| 524 |
|
| 525 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 526 |
// It is not part of the stable interface of this package. |
| 527 |
// |
| 528 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 529 |
// The number of results is no greater than pageSize. |
| 530 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 531 |
InternalFetch func(pageSize int, pageToken string) (results []*servicepb.ImageVersion, nextPageToken string, err error) |
| 532 |
} |
| 533 |
|
| 534 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 535 |
func (it *ImageVersionIterator) PageInfo() *iterator.PageInfo { |
| 536 |
return it.pageInfo |
| 537 |
} |
| 538 |
|
| 539 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 540 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 541 |
func (it *ImageVersionIterator) Next() (*servicepb.ImageVersion, error) { |
| 542 |
var item *servicepb.ImageVersion |
| 543 |
if err := it.nextFunc(); err != nil { |
| 544 |
return item, err |
| 545 |
} |
| 546 |
item = it.items[0] |
| 547 |
it.items = it.items[1:] |
| 548 |
return item, nil |
| 549 |
} |
| 550 |
|
| 551 |
func (it *ImageVersionIterator) bufLen() int { |
| 552 |
return len(it.items) |
| 553 |
} |
| 554 |
|
| 555 |
func (it *ImageVersionIterator) takeBuf() interface{} { |
| 556 |
b := it.items |
| 557 |
it.items = nil |
| 558 |
return b |
| 559 |
} |
| 560 |
|
| 561 |
// ListWorkloadsResponse_ComposerWorkloadIterator manages a stream of *servicepb.ListWorkloadsResponse_ComposerWorkload. |
| 562 |
type ListWorkloadsResponse_ComposerWorkloadIterator struct { |
| 563 |
items []*servicepb.ListWorkloadsResponse_ComposerWorkload |
| 564 |
pageInfo *iterator.PageInfo |
| 565 |
nextFunc func() error |
| 566 |
|
| 567 |
// Response is the raw response for the current page. |
| 568 |
// It must be cast to the RPC response type. |
| 569 |
// Calling Next() or InternalFetch() updates this value. |
| 570 |
Response interface{} |
| 571 |
|
| 572 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 573 |
// It is not part of the stable interface of this package. |
| 574 |
// |
| 575 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 576 |
// The number of results is no greater than pageSize. |
| 577 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 578 |
InternalFetch func(pageSize int, pageToken string) (results []*servicepb.ListWorkloadsResponse_ComposerWorkload, nextPageToken string, err error) |
| 579 |
} |
| 580 |
|
| 581 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 582 |
func (it *ListWorkloadsResponse_ComposerWorkloadIterator) PageInfo() *iterator.PageInfo { |
| 583 |
return it.pageInfo |
| 584 |
} |
| 585 |
|
| 586 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 587 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 588 |
func (it *ListWorkloadsResponse_ComposerWorkloadIterator) Next() (*servicepb.ListWorkloadsResponse_ComposerWorkload, error) { |
| 589 |
var item *servicepb.ListWorkloadsResponse_ComposerWorkload |
| 590 |
if err := it.nextFunc(); err != nil { |
| 591 |
return item, err |
| 592 |
} |
| 593 |
item = it.items[0] |
| 594 |
it.items = it.items[1:] |
| 595 |
return item, nil |
| 596 |
} |
| 597 |
|
| 598 |
func (it *ListWorkloadsResponse_ComposerWorkloadIterator) bufLen() int { |
| 599 |
return len(it.items) |
| 600 |
} |
| 601 |
|
| 602 |
func (it *ListWorkloadsResponse_ComposerWorkloadIterator) takeBuf() interface{} { |
| 603 |
b := it.items |
| 604 |
it.items = nil |
| 605 |
return b |
| 606 |
} |
| 607 |
|
| 608 |
// OperationIterator manages a stream of *longrunningpb.Operation. |
| 609 |
type OperationIterator struct { |
| 610 |
items []*longrunningpb.Operation |
| 611 |
pageInfo *iterator.PageInfo |
| 612 |
nextFunc func() error |
| 613 |
|
| 614 |
// Response is the raw response for the current page. |
| 615 |
// It must be cast to the RPC response type. |
| 616 |
// Calling Next() or InternalFetch() updates this value. |
| 617 |
Response interface{} |
| 618 |
|
| 619 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 620 |
// It is not part of the stable interface of this package. |
| 621 |
// |
| 622 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 623 |
// The number of results is no greater than pageSize. |
| 624 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 625 |
InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) |
| 626 |
} |
| 627 |
|
| 628 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 629 |
func (it *OperationIterator) PageInfo() *iterator.PageInfo { |
| 630 |
return it.pageInfo |
| 631 |
} |
| 632 |
|
| 633 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 634 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 635 |
func (it *OperationIterator) Next() (*longrunningpb.Operation, error) { |
| 636 |
var item *longrunningpb.Operation |
| 637 |
if err := it.nextFunc(); err != nil { |
| 638 |
return item, err |
| 639 |
} |
| 640 |
item = it.items[0] |
| 641 |
it.items = it.items[1:] |
| 642 |
return item, nil |
| 643 |
} |
| 644 |
|
| 645 |
func (it *OperationIterator) bufLen() int { |
| 646 |
return len(it.items) |
| 647 |
} |
| 648 |
|
| 649 |
func (it *OperationIterator) takeBuf() interface{} { |
| 650 |
b := it.items |
| 651 |
it.items = nil |
| 652 |
return b |
| 653 |
} |
| 654 |
|
| 655 |
// UserWorkloadsConfigMapIterator manages a stream of *servicepb.UserWorkloadsConfigMap. |
| 656 |
type UserWorkloadsConfigMapIterator struct { |
| 657 |
items []*servicepb.UserWorkloadsConfigMap |
| 658 |
pageInfo *iterator.PageInfo |
| 659 |
nextFunc func() error |
| 660 |
|
| 661 |
// Response is the raw response for the current page. |
| 662 |
// It must be cast to the RPC response type. |
| 663 |
// Calling Next() or InternalFetch() updates this value. |
| 664 |
Response interface{} |
| 665 |
|
| 666 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 667 |
// It is not part of the stable interface of this package. |
| 668 |
// |
| 669 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 670 |
// The number of results is no greater than pageSize. |
| 671 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 672 |
InternalFetch func(pageSize int, pageToken string) (results []*servicepb.UserWorkloadsConfigMap, nextPageToken string, err error) |
| 673 |
} |
| 674 |
|
| 675 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 676 |
func (it *UserWorkloadsConfigMapIterator) PageInfo() *iterator.PageInfo { |
| 677 |
return it.pageInfo |
| 678 |
} |
| 679 |
|
| 680 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 681 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 682 |
func (it *UserWorkloadsConfigMapIterator) Next() (*servicepb.UserWorkloadsConfigMap, error) { |
| 683 |
var item *servicepb.UserWorkloadsConfigMap |
| 684 |
if err := it.nextFunc(); err != nil { |
| 685 |
return item, err |
| 686 |
} |
| 687 |
item = it.items[0] |
| 688 |
it.items = it.items[1:] |
| 689 |
return item, nil |
| 690 |
} |
| 691 |
|
| 692 |
func (it *UserWorkloadsConfigMapIterator) bufLen() int { |
| 693 |
return len(it.items) |
| 694 |
} |
| 695 |
|
| 696 |
func (it *UserWorkloadsConfigMapIterator) takeBuf() interface{} { |
| 697 |
b := it.items |
| 698 |
it.items = nil |
| 699 |
return b |
| 700 |
} |
| 701 |
|
| 702 |
// UserWorkloadsSecretIterator manages a stream of *servicepb.UserWorkloadsSecret. |
| 703 |
type UserWorkloadsSecretIterator struct { |
| 704 |
items []*servicepb.UserWorkloadsSecret |
| 705 |
pageInfo *iterator.PageInfo |
| 706 |
nextFunc func() error |
| 707 |
|
| 708 |
// Response is the raw response for the current page. |
| 709 |
// It must be cast to the RPC response type. |
| 710 |
// Calling Next() or InternalFetch() updates this value. |
| 711 |
Response interface{} |
| 712 |
|
| 713 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 714 |
// It is not part of the stable interface of this package. |
| 715 |
// |
| 716 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 717 |
// The number of results is no greater than pageSize. |
| 718 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 719 |
InternalFetch func(pageSize int, pageToken string) (results []*servicepb.UserWorkloadsSecret, nextPageToken string, err error) |
| 720 |
} |
| 721 |
|
| 722 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 723 |
func (it *UserWorkloadsSecretIterator) PageInfo() *iterator.PageInfo { |
| 724 |
return it.pageInfo |
| 725 |
} |
| 726 |
|
| 727 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 728 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 729 |
func (it *UserWorkloadsSecretIterator) Next() (*servicepb.UserWorkloadsSecret, error) { |
| 730 |
var item *servicepb.UserWorkloadsSecret |
| 731 |
if err := it.nextFunc(); err != nil { |
| 732 |
return item, err |
| 733 |
} |
| 734 |
item = it.items[0] |
| 735 |
it.items = it.items[1:] |
| 736 |
return item, nil |
| 737 |
} |
| 738 |
|
| 739 |
func (it *UserWorkloadsSecretIterator) bufLen() int { |
| 740 |
return len(it.items) |
| 741 |
} |
| 742 |
|
| 743 |
func (it *UserWorkloadsSecretIterator) takeBuf() interface{} { |
| 744 |
b := it.items |
| 745 |
it.items = nil |
| 746 |
return b |
| 747 |
} |