| 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 apihub |
| 18 |
|
| 19 |
import ( |
| 20 |
"context" |
| 21 |
"time" |
| 22 |
|
| 23 |
apihubpb "cloud.google.com/go/apihub/apiv1/apihubpb" |
| 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 |
// CollectApiDataOperation manages a long-running operation from CollectApiData. |
| 32 |
type CollectApiDataOperation 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 *CollectApiDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.CollectApiDataResponse, error) { |
| 41 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 42 |
var resp apihubpb.CollectApiDataResponse |
| 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 *CollectApiDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.CollectApiDataResponse, error) { |
| 59 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 60 |
var resp apihubpb.CollectApiDataResponse |
| 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 *CollectApiDataOperation) Metadata() (*apihubpb.OperationMetadata, error) { |
| 75 |
var meta apihubpb.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 *CollectApiDataOperation) 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 *CollectApiDataOperation) Name() string { |
| 92 |
return op.lro.Name() |
| 93 |
} |
| 94 |
|
| 95 |
// CreateApiHubInstanceOperation manages a long-running operation from CreateApiHubInstance. |
| 96 |
type CreateApiHubInstanceOperation 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 *CreateApiHubInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ApiHubInstance, error) { |
| 105 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 106 |
var resp apihubpb.ApiHubInstance |
| 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 *CreateApiHubInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ApiHubInstance, error) { |
| 123 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 124 |
var resp apihubpb.ApiHubInstance |
| 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 *CreateApiHubInstanceOperation) Metadata() (*apihubpb.OperationMetadata, error) { |
| 139 |
var meta apihubpb.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 *CreateApiHubInstanceOperation) 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 *CreateApiHubInstanceOperation) Name() string { |
| 156 |
return op.lro.Name() |
| 157 |
} |
| 158 |
|
| 159 |
// CreatePluginInstanceOperation manages a long-running operation from CreatePluginInstance. |
| 160 |
type CreatePluginInstanceOperation 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 *CreatePluginInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.PluginInstance, error) { |
| 169 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 170 |
var resp apihubpb.PluginInstance |
| 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 *CreatePluginInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.PluginInstance, error) { |
| 187 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 188 |
var resp apihubpb.PluginInstance |
| 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 *CreatePluginInstanceOperation) Metadata() (*apihubpb.OperationMetadata, error) { |
| 203 |
var meta apihubpb.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 *CreatePluginInstanceOperation) 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 *CreatePluginInstanceOperation) Name() string { |
| 220 |
return op.lro.Name() |
| 221 |
} |
| 222 |
|
| 223 |
// DeleteApiHubInstanceOperation manages a long-running operation from DeleteApiHubInstance. |
| 224 |
type DeleteApiHubInstanceOperation 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 *DeleteApiHubInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 233 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 234 |
return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 235 |
} |
| 236 |
|
| 237 |
// Poll fetches the latest state of the long-running operation. |
| 238 |
// |
| 239 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 240 |
// |
| 241 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 242 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 243 |
// If Poll succeeds and the operation has completed successfully, |
| 244 |
// op.Done will return true, and the response of the operation is returned. |
| 245 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 246 |
func (op *DeleteApiHubInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 247 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 248 |
return op.lro.Poll(ctx, nil, opts...) |
| 249 |
} |
| 250 |
|
| 251 |
// Metadata returns metadata associated with the long-running operation. |
| 252 |
// Metadata itself does not contact the server, but Poll does. |
| 253 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 254 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 255 |
func (op *DeleteApiHubInstanceOperation) Metadata() (*apihubpb.OperationMetadata, error) { |
| 256 |
var meta apihubpb.OperationMetadata |
| 257 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 258 |
return nil, nil |
| 259 |
} else if err != nil { |
| 260 |
return nil, err |
| 261 |
} |
| 262 |
return &meta, nil |
| 263 |
} |
| 264 |
|
| 265 |
// Done reports whether the long-running operation has completed. |
| 266 |
func (op *DeleteApiHubInstanceOperation) Done() bool { |
| 267 |
return op.lro.Done() |
| 268 |
} |
| 269 |
|
| 270 |
// Name returns the name of the long-running operation. |
| 271 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 272 |
func (op *DeleteApiHubInstanceOperation) Name() string { |
| 273 |
return op.lro.Name() |
| 274 |
} |
| 275 |
|
| 276 |
// DeletePluginInstanceOperation manages a long-running operation from DeletePluginInstance. |
| 277 |
type DeletePluginInstanceOperation struct { |
| 278 |
lro *longrunning.Operation |
| 279 |
pollPath string |
| 280 |
} |
| 281 |
|
| 282 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 283 |
// |
| 284 |
// See documentation of Poll for error-handling information. |
| 285 |
func (op *DeletePluginInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 286 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 287 |
return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 288 |
} |
| 289 |
|
| 290 |
// Poll fetches the latest state of the long-running operation. |
| 291 |
// |
| 292 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 293 |
// |
| 294 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 295 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 296 |
// If Poll succeeds and the operation has completed successfully, |
| 297 |
// op.Done will return true, and the response of the operation is returned. |
| 298 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 299 |
func (op *DeletePluginInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 300 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 301 |
return op.lro.Poll(ctx, nil, opts...) |
| 302 |
} |
| 303 |
|
| 304 |
// Metadata returns metadata associated with the long-running operation. |
| 305 |
// Metadata itself does not contact the server, but Poll does. |
| 306 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 307 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 308 |
func (op *DeletePluginInstanceOperation) Metadata() (*apihubpb.OperationMetadata, error) { |
| 309 |
var meta apihubpb.OperationMetadata |
| 310 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 311 |
return nil, nil |
| 312 |
} else if err != nil { |
| 313 |
return nil, err |
| 314 |
} |
| 315 |
return &meta, nil |
| 316 |
} |
| 317 |
|
| 318 |
// Done reports whether the long-running operation has completed. |
| 319 |
func (op *DeletePluginInstanceOperation) Done() bool { |
| 320 |
return op.lro.Done() |
| 321 |
} |
| 322 |
|
| 323 |
// Name returns the name of the long-running operation. |
| 324 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 325 |
func (op *DeletePluginInstanceOperation) Name() string { |
| 326 |
return op.lro.Name() |
| 327 |
} |
| 328 |
|
| 329 |
// DeletePluginOperation manages a long-running operation from DeletePlugin. |
| 330 |
type DeletePluginOperation struct { |
| 331 |
lro *longrunning.Operation |
| 332 |
pollPath string |
| 333 |
} |
| 334 |
|
| 335 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 336 |
// |
| 337 |
// See documentation of Poll for error-handling information. |
| 338 |
func (op *DeletePluginOperation) Wait(ctx context.Context, opts ...gax.CallOption) error { |
| 339 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 340 |
return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...) |
| 341 |
} |
| 342 |
|
| 343 |
// Poll fetches the latest state of the long-running operation. |
| 344 |
// |
| 345 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 346 |
// |
| 347 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 348 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 349 |
// If Poll succeeds and the operation has completed successfully, |
| 350 |
// op.Done will return true, and the response of the operation is returned. |
| 351 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 352 |
func (op *DeletePluginOperation) Poll(ctx context.Context, opts ...gax.CallOption) error { |
| 353 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 354 |
return op.lro.Poll(ctx, nil, opts...) |
| 355 |
} |
| 356 |
|
| 357 |
// Metadata returns metadata associated with the long-running operation. |
| 358 |
// Metadata itself does not contact the server, but Poll does. |
| 359 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 360 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 361 |
func (op *DeletePluginOperation) Metadata() (*apihubpb.OperationMetadata, error) { |
| 362 |
var meta apihubpb.OperationMetadata |
| 363 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 364 |
return nil, nil |
| 365 |
} else if err != nil { |
| 366 |
return nil, err |
| 367 |
} |
| 368 |
return &meta, nil |
| 369 |
} |
| 370 |
|
| 371 |
// Done reports whether the long-running operation has completed. |
| 372 |
func (op *DeletePluginOperation) Done() bool { |
| 373 |
return op.lro.Done() |
| 374 |
} |
| 375 |
|
| 376 |
// Name returns the name of the long-running operation. |
| 377 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 378 |
func (op *DeletePluginOperation) Name() string { |
| 379 |
return op.lro.Name() |
| 380 |
} |
| 381 |
|
| 382 |
// DisablePluginInstanceActionOperation manages a long-running operation from DisablePluginInstanceAction. |
| 383 |
type DisablePluginInstanceActionOperation struct { |
| 384 |
lro *longrunning.Operation |
| 385 |
pollPath string |
| 386 |
} |
| 387 |
|
| 388 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 389 |
// |
| 390 |
// See documentation of Poll for error-handling information. |
| 391 |
func (op *DisablePluginInstanceActionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.DisablePluginInstanceActionResponse, error) { |
| 392 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 393 |
var resp apihubpb.DisablePluginInstanceActionResponse |
| 394 |
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 395 |
return nil, err |
| 396 |
} |
| 397 |
return &resp, nil |
| 398 |
} |
| 399 |
|
| 400 |
// Poll fetches the latest state of the long-running operation. |
| 401 |
// |
| 402 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 403 |
// |
| 404 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 405 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 406 |
// If Poll succeeds and the operation has completed successfully, |
| 407 |
// op.Done will return true, and the response of the operation is returned. |
| 408 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 409 |
func (op *DisablePluginInstanceActionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.DisablePluginInstanceActionResponse, error) { |
| 410 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 411 |
var resp apihubpb.DisablePluginInstanceActionResponse |
| 412 |
if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 413 |
return nil, err |
| 414 |
} |
| 415 |
if !op.Done() { |
| 416 |
return nil, nil |
| 417 |
} |
| 418 |
return &resp, nil |
| 419 |
} |
| 420 |
|
| 421 |
// Metadata returns metadata associated with the long-running operation. |
| 422 |
// Metadata itself does not contact the server, but Poll does. |
| 423 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 424 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 425 |
func (op *DisablePluginInstanceActionOperation) Metadata() (*apihubpb.OperationMetadata, error) { |
| 426 |
var meta apihubpb.OperationMetadata |
| 427 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 428 |
return nil, nil |
| 429 |
} else if err != nil { |
| 430 |
return nil, err |
| 431 |
} |
| 432 |
return &meta, nil |
| 433 |
} |
| 434 |
|
| 435 |
// Done reports whether the long-running operation has completed. |
| 436 |
func (op *DisablePluginInstanceActionOperation) Done() bool { |
| 437 |
return op.lro.Done() |
| 438 |
} |
| 439 |
|
| 440 |
// Name returns the name of the long-running operation. |
| 441 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 442 |
func (op *DisablePluginInstanceActionOperation) Name() string { |
| 443 |
return op.lro.Name() |
| 444 |
} |
| 445 |
|
| 446 |
// EnablePluginInstanceActionOperation manages a long-running operation from EnablePluginInstanceAction. |
| 447 |
type EnablePluginInstanceActionOperation struct { |
| 448 |
lro *longrunning.Operation |
| 449 |
pollPath string |
| 450 |
} |
| 451 |
|
| 452 |
// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. |
| 453 |
// |
| 454 |
// See documentation of Poll for error-handling information. |
| 455 |
func (op *EnablePluginInstanceActionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.EnablePluginInstanceActionResponse, error) { |
| 456 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 457 |
var resp apihubpb.EnablePluginInstanceActionResponse |
| 458 |
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 459 |
return nil, err |
| 460 |
} |
| 461 |
return &resp, nil |
| 462 |
} |
| 463 |
|
| 464 |
// Poll fetches the latest state of the long-running operation. |
| 465 |
// |
| 466 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 467 |
// |
| 468 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 469 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 470 |
// If Poll succeeds and the operation has completed successfully, |
| 471 |
// op.Done will return true, and the response of the operation is returned. |
| 472 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 473 |
func (op *EnablePluginInstanceActionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.EnablePluginInstanceActionResponse, error) { |
| 474 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 475 |
var resp apihubpb.EnablePluginInstanceActionResponse |
| 476 |
if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 477 |
return nil, err |
| 478 |
} |
| 479 |
if !op.Done() { |
| 480 |
return nil, nil |
| 481 |
} |
| 482 |
return &resp, nil |
| 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 *EnablePluginInstanceActionOperation) Metadata() (*apihubpb.OperationMetadata, error) { |
| 490 |
var meta apihubpb.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 *EnablePluginInstanceActionOperation) 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 *EnablePluginInstanceActionOperation) Name() string { |
| 507 |
return op.lro.Name() |
| 508 |
} |
| 509 |
|
| 510 |
// ExecutePluginInstanceActionOperation manages a long-running operation from ExecutePluginInstanceAction. |
| 511 |
type ExecutePluginInstanceActionOperation 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 *ExecutePluginInstanceActionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ExecutePluginInstanceActionResponse, error) { |
| 520 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 521 |
var resp apihubpb.ExecutePluginInstanceActionResponse |
| 522 |
if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { |
| 523 |
return nil, err |
| 524 |
} |
| 525 |
return &resp, nil |
| 526 |
} |
| 527 |
|
| 528 |
// Poll fetches the latest state of the long-running operation. |
| 529 |
// |
| 530 |
// Poll also fetches the latest metadata, which can be retrieved by Metadata. |
| 531 |
// |
| 532 |
// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and |
| 533 |
// the operation has completed with failure, the error is returned and op.Done will return true. |
| 534 |
// If Poll succeeds and the operation has completed successfully, |
| 535 |
// op.Done will return true, and the response of the operation is returned. |
| 536 |
// If Poll succeeds and the operation has not completed, the returned response and error are both nil. |
| 537 |
func (op *ExecutePluginInstanceActionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*apihubpb.ExecutePluginInstanceActionResponse, error) { |
| 538 |
opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) |
| 539 |
var resp apihubpb.ExecutePluginInstanceActionResponse |
| 540 |
if err := op.lro.Poll(ctx, &resp, opts...); err != nil { |
| 541 |
return nil, err |
| 542 |
} |
| 543 |
if !op.Done() { |
| 544 |
return nil, nil |
| 545 |
} |
| 546 |
return &resp, nil |
| 547 |
} |
| 548 |
|
| 549 |
// Metadata returns metadata associated with the long-running operation. |
| 550 |
// Metadata itself does not contact the server, but Poll does. |
| 551 |
// To get the latest metadata, call this method after a successful call to Poll. |
| 552 |
// If the metadata is not available, the returned metadata and error are both nil. |
| 553 |
func (op *ExecutePluginInstanceActionOperation) Metadata() (*apihubpb.OperationMetadata, error) { |
| 554 |
var meta apihubpb.OperationMetadata |
| 555 |
if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { |
| 556 |
return nil, nil |
| 557 |
} else if err != nil { |
| 558 |
return nil, err |
| 559 |
} |
| 560 |
return &meta, nil |
| 561 |
} |
| 562 |
|
| 563 |
// Done reports whether the long-running operation has completed. |
| 564 |
func (op *ExecutePluginInstanceActionOperation) Done() bool { |
| 565 |
return op.lro.Done() |
| 566 |
} |
| 567 |
|
| 568 |
// Name returns the name of the long-running operation. |
| 569 |
// The name is assigned by the server and is unique within the service from which the operation is created. |
| 570 |
func (op *ExecutePluginInstanceActionOperation) Name() string { |
| 571 |
return op.lro.Name() |
| 572 |
} |
| 573 |
|
| 574 |
// ApiIterator manages a stream of *apihubpb.Api. |
| 575 |
type ApiIterator struct { |
| 576 |
items []*apihubpb.Api |
| 577 |
pageInfo *iterator.PageInfo |
| 578 |
nextFunc func() error |
| 579 |
|
| 580 |
// Response is the raw response for the current page. |
| 581 |
// It must be cast to the RPC response type. |
| 582 |
// Calling Next() or InternalFetch() updates this value. |
| 583 |
Response interface{} |
| 584 |
|
| 585 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 586 |
// It is not part of the stable interface of this package. |
| 587 |
// |
| 588 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 589 |
// The number of results is no greater than pageSize. |
| 590 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 591 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.Api, nextPageToken string, err error) |
| 592 |
} |
| 593 |
|
| 594 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 595 |
func (it *ApiIterator) PageInfo() *iterator.PageInfo { |
| 596 |
return it.pageInfo |
| 597 |
} |
| 598 |
|
| 599 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 600 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 601 |
func (it *ApiIterator) Next() (*apihubpb.Api, error) { |
| 602 |
var item *apihubpb.Api |
| 603 |
if err := it.nextFunc(); err != nil { |
| 604 |
return item, err |
| 605 |
} |
| 606 |
item = it.items[0] |
| 607 |
it.items = it.items[1:] |
| 608 |
return item, nil |
| 609 |
} |
| 610 |
|
| 611 |
func (it *ApiIterator) bufLen() int { |
| 612 |
return len(it.items) |
| 613 |
} |
| 614 |
|
| 615 |
func (it *ApiIterator) takeBuf() interface{} { |
| 616 |
b := it.items |
| 617 |
it.items = nil |
| 618 |
return b |
| 619 |
} |
| 620 |
|
| 621 |
// ApiOperationIterator manages a stream of *apihubpb.ApiOperation. |
| 622 |
type ApiOperationIterator struct { |
| 623 |
items []*apihubpb.ApiOperation |
| 624 |
pageInfo *iterator.PageInfo |
| 625 |
nextFunc func() error |
| 626 |
|
| 627 |
// Response is the raw response for the current page. |
| 628 |
// It must be cast to the RPC response type. |
| 629 |
// Calling Next() or InternalFetch() updates this value. |
| 630 |
Response interface{} |
| 631 |
|
| 632 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 633 |
// It is not part of the stable interface of this package. |
| 634 |
// |
| 635 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 636 |
// The number of results is no greater than pageSize. |
| 637 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 638 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.ApiOperation, nextPageToken string, err error) |
| 639 |
} |
| 640 |
|
| 641 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 642 |
func (it *ApiOperationIterator) PageInfo() *iterator.PageInfo { |
| 643 |
return it.pageInfo |
| 644 |
} |
| 645 |
|
| 646 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 647 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 648 |
func (it *ApiOperationIterator) Next() (*apihubpb.ApiOperation, error) { |
| 649 |
var item *apihubpb.ApiOperation |
| 650 |
if err := it.nextFunc(); err != nil { |
| 651 |
return item, err |
| 652 |
} |
| 653 |
item = it.items[0] |
| 654 |
it.items = it.items[1:] |
| 655 |
return item, nil |
| 656 |
} |
| 657 |
|
| 658 |
func (it *ApiOperationIterator) bufLen() int { |
| 659 |
return len(it.items) |
| 660 |
} |
| 661 |
|
| 662 |
func (it *ApiOperationIterator) takeBuf() interface{} { |
| 663 |
b := it.items |
| 664 |
it.items = nil |
| 665 |
return b |
| 666 |
} |
| 667 |
|
| 668 |
// AttributeIterator manages a stream of *apihubpb.Attribute. |
| 669 |
type AttributeIterator struct { |
| 670 |
items []*apihubpb.Attribute |
| 671 |
pageInfo *iterator.PageInfo |
| 672 |
nextFunc func() error |
| 673 |
|
| 674 |
// Response is the raw response for the current page. |
| 675 |
// It must be cast to the RPC response type. |
| 676 |
// Calling Next() or InternalFetch() updates this value. |
| 677 |
Response interface{} |
| 678 |
|
| 679 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 680 |
// It is not part of the stable interface of this package. |
| 681 |
// |
| 682 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 683 |
// The number of results is no greater than pageSize. |
| 684 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 685 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.Attribute, nextPageToken string, err error) |
| 686 |
} |
| 687 |
|
| 688 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 689 |
func (it *AttributeIterator) PageInfo() *iterator.PageInfo { |
| 690 |
return it.pageInfo |
| 691 |
} |
| 692 |
|
| 693 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 694 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 695 |
func (it *AttributeIterator) Next() (*apihubpb.Attribute, error) { |
| 696 |
var item *apihubpb.Attribute |
| 697 |
if err := it.nextFunc(); err != nil { |
| 698 |
return item, err |
| 699 |
} |
| 700 |
item = it.items[0] |
| 701 |
it.items = it.items[1:] |
| 702 |
return item, nil |
| 703 |
} |
| 704 |
|
| 705 |
func (it *AttributeIterator) bufLen() int { |
| 706 |
return len(it.items) |
| 707 |
} |
| 708 |
|
| 709 |
func (it *AttributeIterator) takeBuf() interface{} { |
| 710 |
b := it.items |
| 711 |
it.items = nil |
| 712 |
return b |
| 713 |
} |
| 714 |
|
| 715 |
// CurationIterator manages a stream of *apihubpb.Curation. |
| 716 |
type CurationIterator struct { |
| 717 |
items []*apihubpb.Curation |
| 718 |
pageInfo *iterator.PageInfo |
| 719 |
nextFunc func() error |
| 720 |
|
| 721 |
// Response is the raw response for the current page. |
| 722 |
// It must be cast to the RPC response type. |
| 723 |
// Calling Next() or InternalFetch() updates this value. |
| 724 |
Response interface{} |
| 725 |
|
| 726 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 727 |
// It is not part of the stable interface of this package. |
| 728 |
// |
| 729 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 730 |
// The number of results is no greater than pageSize. |
| 731 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 732 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.Curation, nextPageToken string, err error) |
| 733 |
} |
| 734 |
|
| 735 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 736 |
func (it *CurationIterator) PageInfo() *iterator.PageInfo { |
| 737 |
return it.pageInfo |
| 738 |
} |
| 739 |
|
| 740 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 741 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 742 |
func (it *CurationIterator) Next() (*apihubpb.Curation, error) { |
| 743 |
var item *apihubpb.Curation |
| 744 |
if err := it.nextFunc(); err != nil { |
| 745 |
return item, err |
| 746 |
} |
| 747 |
item = it.items[0] |
| 748 |
it.items = it.items[1:] |
| 749 |
return item, nil |
| 750 |
} |
| 751 |
|
| 752 |
func (it *CurationIterator) bufLen() int { |
| 753 |
return len(it.items) |
| 754 |
} |
| 755 |
|
| 756 |
func (it *CurationIterator) takeBuf() interface{} { |
| 757 |
b := it.items |
| 758 |
it.items = nil |
| 759 |
return b |
| 760 |
} |
| 761 |
|
| 762 |
// DependencyIterator manages a stream of *apihubpb.Dependency. |
| 763 |
type DependencyIterator struct { |
| 764 |
items []*apihubpb.Dependency |
| 765 |
pageInfo *iterator.PageInfo |
| 766 |
nextFunc func() error |
| 767 |
|
| 768 |
// Response is the raw response for the current page. |
| 769 |
// It must be cast to the RPC response type. |
| 770 |
// Calling Next() or InternalFetch() updates this value. |
| 771 |
Response interface{} |
| 772 |
|
| 773 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 774 |
// It is not part of the stable interface of this package. |
| 775 |
// |
| 776 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 777 |
// The number of results is no greater than pageSize. |
| 778 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 779 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.Dependency, nextPageToken string, err error) |
| 780 |
} |
| 781 |
|
| 782 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 783 |
func (it *DependencyIterator) PageInfo() *iterator.PageInfo { |
| 784 |
return it.pageInfo |
| 785 |
} |
| 786 |
|
| 787 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 788 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 789 |
func (it *DependencyIterator) Next() (*apihubpb.Dependency, error) { |
| 790 |
var item *apihubpb.Dependency |
| 791 |
if err := it.nextFunc(); err != nil { |
| 792 |
return item, err |
| 793 |
} |
| 794 |
item = it.items[0] |
| 795 |
it.items = it.items[1:] |
| 796 |
return item, nil |
| 797 |
} |
| 798 |
|
| 799 |
func (it *DependencyIterator) bufLen() int { |
| 800 |
return len(it.items) |
| 801 |
} |
| 802 |
|
| 803 |
func (it *DependencyIterator) takeBuf() interface{} { |
| 804 |
b := it.items |
| 805 |
it.items = nil |
| 806 |
return b |
| 807 |
} |
| 808 |
|
| 809 |
// DeploymentIterator manages a stream of *apihubpb.Deployment. |
| 810 |
type DeploymentIterator struct { |
| 811 |
items []*apihubpb.Deployment |
| 812 |
pageInfo *iterator.PageInfo |
| 813 |
nextFunc func() error |
| 814 |
|
| 815 |
// Response is the raw response for the current page. |
| 816 |
// It must be cast to the RPC response type. |
| 817 |
// Calling Next() or InternalFetch() updates this value. |
| 818 |
Response interface{} |
| 819 |
|
| 820 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 821 |
// It is not part of the stable interface of this package. |
| 822 |
// |
| 823 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 824 |
// The number of results is no greater than pageSize. |
| 825 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 826 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.Deployment, nextPageToken string, err error) |
| 827 |
} |
| 828 |
|
| 829 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 830 |
func (it *DeploymentIterator) PageInfo() *iterator.PageInfo { |
| 831 |
return it.pageInfo |
| 832 |
} |
| 833 |
|
| 834 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 835 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 836 |
func (it *DeploymentIterator) Next() (*apihubpb.Deployment, error) { |
| 837 |
var item *apihubpb.Deployment |
| 838 |
if err := it.nextFunc(); err != nil { |
| 839 |
return item, err |
| 840 |
} |
| 841 |
item = it.items[0] |
| 842 |
it.items = it.items[1:] |
| 843 |
return item, nil |
| 844 |
} |
| 845 |
|
| 846 |
func (it *DeploymentIterator) bufLen() int { |
| 847 |
return len(it.items) |
| 848 |
} |
| 849 |
|
| 850 |
func (it *DeploymentIterator) takeBuf() interface{} { |
| 851 |
b := it.items |
| 852 |
it.items = nil |
| 853 |
return b |
| 854 |
} |
| 855 |
|
| 856 |
// DiscoveredApiObservationIterator manages a stream of *apihubpb.DiscoveredApiObservation. |
| 857 |
type DiscoveredApiObservationIterator struct { |
| 858 |
items []*apihubpb.DiscoveredApiObservation |
| 859 |
pageInfo *iterator.PageInfo |
| 860 |
nextFunc func() error |
| 861 |
|
| 862 |
// Response is the raw response for the current page. |
| 863 |
// It must be cast to the RPC response type. |
| 864 |
// Calling Next() or InternalFetch() updates this value. |
| 865 |
Response interface{} |
| 866 |
|
| 867 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 868 |
// It is not part of the stable interface of this package. |
| 869 |
// |
| 870 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 871 |
// The number of results is no greater than pageSize. |
| 872 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 873 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.DiscoveredApiObservation, nextPageToken string, err error) |
| 874 |
} |
| 875 |
|
| 876 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 877 |
func (it *DiscoveredApiObservationIterator) PageInfo() *iterator.PageInfo { |
| 878 |
return it.pageInfo |
| 879 |
} |
| 880 |
|
| 881 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 882 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 883 |
func (it *DiscoveredApiObservationIterator) Next() (*apihubpb.DiscoveredApiObservation, error) { |
| 884 |
var item *apihubpb.DiscoveredApiObservation |
| 885 |
if err := it.nextFunc(); err != nil { |
| 886 |
return item, err |
| 887 |
} |
| 888 |
item = it.items[0] |
| 889 |
it.items = it.items[1:] |
| 890 |
return item, nil |
| 891 |
} |
| 892 |
|
| 893 |
func (it *DiscoveredApiObservationIterator) bufLen() int { |
| 894 |
return len(it.items) |
| 895 |
} |
| 896 |
|
| 897 |
func (it *DiscoveredApiObservationIterator) takeBuf() interface{} { |
| 898 |
b := it.items |
| 899 |
it.items = nil |
| 900 |
return b |
| 901 |
} |
| 902 |
|
| 903 |
// DiscoveredApiOperationIterator manages a stream of *apihubpb.DiscoveredApiOperation. |
| 904 |
type DiscoveredApiOperationIterator struct { |
| 905 |
items []*apihubpb.DiscoveredApiOperation |
| 906 |
pageInfo *iterator.PageInfo |
| 907 |
nextFunc func() error |
| 908 |
|
| 909 |
// Response is the raw response for the current page. |
| 910 |
// It must be cast to the RPC response type. |
| 911 |
// Calling Next() or InternalFetch() updates this value. |
| 912 |
Response interface{} |
| 913 |
|
| 914 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 915 |
// It is not part of the stable interface of this package. |
| 916 |
// |
| 917 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 918 |
// The number of results is no greater than pageSize. |
| 919 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 920 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.DiscoveredApiOperation, nextPageToken string, err error) |
| 921 |
} |
| 922 |
|
| 923 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 924 |
func (it *DiscoveredApiOperationIterator) PageInfo() *iterator.PageInfo { |
| 925 |
return it.pageInfo |
| 926 |
} |
| 927 |
|
| 928 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 929 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 930 |
func (it *DiscoveredApiOperationIterator) Next() (*apihubpb.DiscoveredApiOperation, error) { |
| 931 |
var item *apihubpb.DiscoveredApiOperation |
| 932 |
if err := it.nextFunc(); err != nil { |
| 933 |
return item, err |
| 934 |
} |
| 935 |
item = it.items[0] |
| 936 |
it.items = it.items[1:] |
| 937 |
return item, nil |
| 938 |
} |
| 939 |
|
| 940 |
func (it *DiscoveredApiOperationIterator) bufLen() int { |
| 941 |
return len(it.items) |
| 942 |
} |
| 943 |
|
| 944 |
func (it *DiscoveredApiOperationIterator) takeBuf() interface{} { |
| 945 |
b := it.items |
| 946 |
it.items = nil |
| 947 |
return b |
| 948 |
} |
| 949 |
|
| 950 |
// ExternalApiIterator manages a stream of *apihubpb.ExternalApi. |
| 951 |
type ExternalApiIterator struct { |
| 952 |
items []*apihubpb.ExternalApi |
| 953 |
pageInfo *iterator.PageInfo |
| 954 |
nextFunc func() error |
| 955 |
|
| 956 |
// Response is the raw response for the current page. |
| 957 |
// It must be cast to the RPC response type. |
| 958 |
// Calling Next() or InternalFetch() updates this value. |
| 959 |
Response interface{} |
| 960 |
|
| 961 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 962 |
// It is not part of the stable interface of this package. |
| 963 |
// |
| 964 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 965 |
// The number of results is no greater than pageSize. |
| 966 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 967 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.ExternalApi, nextPageToken string, err error) |
| 968 |
} |
| 969 |
|
| 970 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 971 |
func (it *ExternalApiIterator) PageInfo() *iterator.PageInfo { |
| 972 |
return it.pageInfo |
| 973 |
} |
| 974 |
|
| 975 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 976 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 977 |
func (it *ExternalApiIterator) Next() (*apihubpb.ExternalApi, error) { |
| 978 |
var item *apihubpb.ExternalApi |
| 979 |
if err := it.nextFunc(); err != nil { |
| 980 |
return item, err |
| 981 |
} |
| 982 |
item = it.items[0] |
| 983 |
it.items = it.items[1:] |
| 984 |
return item, nil |
| 985 |
} |
| 986 |
|
| 987 |
func (it *ExternalApiIterator) bufLen() int { |
| 988 |
return len(it.items) |
| 989 |
} |
| 990 |
|
| 991 |
func (it *ExternalApiIterator) takeBuf() interface{} { |
| 992 |
b := it.items |
| 993 |
it.items = nil |
| 994 |
return b |
| 995 |
} |
| 996 |
|
| 997 |
// HostProjectRegistrationIterator manages a stream of *apihubpb.HostProjectRegistration. |
| 998 |
type HostProjectRegistrationIterator struct { |
| 999 |
items []*apihubpb.HostProjectRegistration |
| 1000 |
pageInfo *iterator.PageInfo |
| 1001 |
nextFunc func() error |
| 1002 |
|
| 1003 |
// Response is the raw response for the current page. |
| 1004 |
// It must be cast to the RPC response type. |
| 1005 |
// Calling Next() or InternalFetch() updates this value. |
| 1006 |
Response interface{} |
| 1007 |
|
| 1008 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 1009 |
// It is not part of the stable interface of this package. |
| 1010 |
// |
| 1011 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 1012 |
// The number of results is no greater than pageSize. |
| 1013 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 1014 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.HostProjectRegistration, nextPageToken string, err error) |
| 1015 |
} |
| 1016 |
|
| 1017 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1018 |
func (it *HostProjectRegistrationIterator) PageInfo() *iterator.PageInfo { |
| 1019 |
return it.pageInfo |
| 1020 |
} |
| 1021 |
|
| 1022 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1023 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 1024 |
func (it *HostProjectRegistrationIterator) Next() (*apihubpb.HostProjectRegistration, error) { |
| 1025 |
var item *apihubpb.HostProjectRegistration |
| 1026 |
if err := it.nextFunc(); err != nil { |
| 1027 |
return item, err |
| 1028 |
} |
| 1029 |
item = it.items[0] |
| 1030 |
it.items = it.items[1:] |
| 1031 |
return item, nil |
| 1032 |
} |
| 1033 |
|
| 1034 |
func (it *HostProjectRegistrationIterator) bufLen() int { |
| 1035 |
return len(it.items) |
| 1036 |
} |
| 1037 |
|
| 1038 |
func (it *HostProjectRegistrationIterator) takeBuf() interface{} { |
| 1039 |
b := it.items |
| 1040 |
it.items = nil |
| 1041 |
return b |
| 1042 |
} |
| 1043 |
|
| 1044 |
// LocationIterator manages a stream of *locationpb.Location. |
| 1045 |
type LocationIterator struct { |
| 1046 |
items []*locationpb.Location |
| 1047 |
pageInfo *iterator.PageInfo |
| 1048 |
nextFunc func() error |
| 1049 |
|
| 1050 |
// Response is the raw response for the current page. |
| 1051 |
// It must be cast to the RPC response type. |
| 1052 |
// Calling Next() or InternalFetch() updates this value. |
| 1053 |
Response interface{} |
| 1054 |
|
| 1055 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 1056 |
// It is not part of the stable interface of this package. |
| 1057 |
// |
| 1058 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 1059 |
// The number of results is no greater than pageSize. |
| 1060 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 1061 |
InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error) |
| 1062 |
} |
| 1063 |
|
| 1064 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1065 |
func (it *LocationIterator) PageInfo() *iterator.PageInfo { |
| 1066 |
return it.pageInfo |
| 1067 |
} |
| 1068 |
|
| 1069 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1070 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 1071 |
func (it *LocationIterator) Next() (*locationpb.Location, error) { |
| 1072 |
var item *locationpb.Location |
| 1073 |
if err := it.nextFunc(); err != nil { |
| 1074 |
return item, err |
| 1075 |
} |
| 1076 |
item = it.items[0] |
| 1077 |
it.items = it.items[1:] |
| 1078 |
return item, nil |
| 1079 |
} |
| 1080 |
|
| 1081 |
func (it *LocationIterator) bufLen() int { |
| 1082 |
return len(it.items) |
| 1083 |
} |
| 1084 |
|
| 1085 |
func (it *LocationIterator) takeBuf() interface{} { |
| 1086 |
b := it.items |
| 1087 |
it.items = nil |
| 1088 |
return b |
| 1089 |
} |
| 1090 |
|
| 1091 |
// OperationIterator manages a stream of *longrunningpb.Operation. |
| 1092 |
type OperationIterator struct { |
| 1093 |
items []*longrunningpb.Operation |
| 1094 |
pageInfo *iterator.PageInfo |
| 1095 |
nextFunc func() error |
| 1096 |
|
| 1097 |
// Response is the raw response for the current page. |
| 1098 |
// It must be cast to the RPC response type. |
| 1099 |
// Calling Next() or InternalFetch() updates this value. |
| 1100 |
Response interface{} |
| 1101 |
|
| 1102 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 1103 |
// It is not part of the stable interface of this package. |
| 1104 |
// |
| 1105 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 1106 |
// The number of results is no greater than pageSize. |
| 1107 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 1108 |
InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) |
| 1109 |
} |
| 1110 |
|
| 1111 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1112 |
func (it *OperationIterator) PageInfo() *iterator.PageInfo { |
| 1113 |
return it.pageInfo |
| 1114 |
} |
| 1115 |
|
| 1116 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1117 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 1118 |
func (it *OperationIterator) Next() (*longrunningpb.Operation, error) { |
| 1119 |
var item *longrunningpb.Operation |
| 1120 |
if err := it.nextFunc(); err != nil { |
| 1121 |
return item, err |
| 1122 |
} |
| 1123 |
item = it.items[0] |
| 1124 |
it.items = it.items[1:] |
| 1125 |
return item, nil |
| 1126 |
} |
| 1127 |
|
| 1128 |
func (it *OperationIterator) bufLen() int { |
| 1129 |
return len(it.items) |
| 1130 |
} |
| 1131 |
|
| 1132 |
func (it *OperationIterator) takeBuf() interface{} { |
| 1133 |
b := it.items |
| 1134 |
it.items = nil |
| 1135 |
return b |
| 1136 |
} |
| 1137 |
|
| 1138 |
// PluginInstanceIterator manages a stream of *apihubpb.PluginInstance. |
| 1139 |
type PluginInstanceIterator struct { |
| 1140 |
items []*apihubpb.PluginInstance |
| 1141 |
pageInfo *iterator.PageInfo |
| 1142 |
nextFunc func() error |
| 1143 |
|
| 1144 |
// Response is the raw response for the current page. |
| 1145 |
// It must be cast to the RPC response type. |
| 1146 |
// Calling Next() or InternalFetch() updates this value. |
| 1147 |
Response interface{} |
| 1148 |
|
| 1149 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 1150 |
// It is not part of the stable interface of this package. |
| 1151 |
// |
| 1152 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 1153 |
// The number of results is no greater than pageSize. |
| 1154 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 1155 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.PluginInstance, nextPageToken string, err error) |
| 1156 |
} |
| 1157 |
|
| 1158 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1159 |
func (it *PluginInstanceIterator) PageInfo() *iterator.PageInfo { |
| 1160 |
return it.pageInfo |
| 1161 |
} |
| 1162 |
|
| 1163 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1164 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 1165 |
func (it *PluginInstanceIterator) Next() (*apihubpb.PluginInstance, error) { |
| 1166 |
var item *apihubpb.PluginInstance |
| 1167 |
if err := it.nextFunc(); err != nil { |
| 1168 |
return item, err |
| 1169 |
} |
| 1170 |
item = it.items[0] |
| 1171 |
it.items = it.items[1:] |
| 1172 |
return item, nil |
| 1173 |
} |
| 1174 |
|
| 1175 |
func (it *PluginInstanceIterator) bufLen() int { |
| 1176 |
return len(it.items) |
| 1177 |
} |
| 1178 |
|
| 1179 |
func (it *PluginInstanceIterator) takeBuf() interface{} { |
| 1180 |
b := it.items |
| 1181 |
it.items = nil |
| 1182 |
return b |
| 1183 |
} |
| 1184 |
|
| 1185 |
// PluginIterator manages a stream of *apihubpb.Plugin. |
| 1186 |
type PluginIterator struct { |
| 1187 |
items []*apihubpb.Plugin |
| 1188 |
pageInfo *iterator.PageInfo |
| 1189 |
nextFunc func() error |
| 1190 |
|
| 1191 |
// Response is the raw response for the current page. |
| 1192 |
// It must be cast to the RPC response type. |
| 1193 |
// Calling Next() or InternalFetch() updates this value. |
| 1194 |
Response interface{} |
| 1195 |
|
| 1196 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 1197 |
// It is not part of the stable interface of this package. |
| 1198 |
// |
| 1199 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 1200 |
// The number of results is no greater than pageSize. |
| 1201 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 1202 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.Plugin, nextPageToken string, err error) |
| 1203 |
} |
| 1204 |
|
| 1205 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1206 |
func (it *PluginIterator) PageInfo() *iterator.PageInfo { |
| 1207 |
return it.pageInfo |
| 1208 |
} |
| 1209 |
|
| 1210 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1211 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 1212 |
func (it *PluginIterator) Next() (*apihubpb.Plugin, error) { |
| 1213 |
var item *apihubpb.Plugin |
| 1214 |
if err := it.nextFunc(); err != nil { |
| 1215 |
return item, err |
| 1216 |
} |
| 1217 |
item = it.items[0] |
| 1218 |
it.items = it.items[1:] |
| 1219 |
return item, nil |
| 1220 |
} |
| 1221 |
|
| 1222 |
func (it *PluginIterator) bufLen() int { |
| 1223 |
return len(it.items) |
| 1224 |
} |
| 1225 |
|
| 1226 |
func (it *PluginIterator) takeBuf() interface{} { |
| 1227 |
b := it.items |
| 1228 |
it.items = nil |
| 1229 |
return b |
| 1230 |
} |
| 1231 |
|
| 1232 |
// RuntimeProjectAttachmentIterator manages a stream of *apihubpb.RuntimeProjectAttachment. |
| 1233 |
type RuntimeProjectAttachmentIterator struct { |
| 1234 |
items []*apihubpb.RuntimeProjectAttachment |
| 1235 |
pageInfo *iterator.PageInfo |
| 1236 |
nextFunc func() error |
| 1237 |
|
| 1238 |
// Response is the raw response for the current page. |
| 1239 |
// It must be cast to the RPC response type. |
| 1240 |
// Calling Next() or InternalFetch() updates this value. |
| 1241 |
Response interface{} |
| 1242 |
|
| 1243 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 1244 |
// It is not part of the stable interface of this package. |
| 1245 |
// |
| 1246 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 1247 |
// The number of results is no greater than pageSize. |
| 1248 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 1249 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.RuntimeProjectAttachment, nextPageToken string, err error) |
| 1250 |
} |
| 1251 |
|
| 1252 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1253 |
func (it *RuntimeProjectAttachmentIterator) PageInfo() *iterator.PageInfo { |
| 1254 |
return it.pageInfo |
| 1255 |
} |
| 1256 |
|
| 1257 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1258 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 1259 |
func (it *RuntimeProjectAttachmentIterator) Next() (*apihubpb.RuntimeProjectAttachment, error) { |
| 1260 |
var item *apihubpb.RuntimeProjectAttachment |
| 1261 |
if err := it.nextFunc(); err != nil { |
| 1262 |
return item, err |
| 1263 |
} |
| 1264 |
item = it.items[0] |
| 1265 |
it.items = it.items[1:] |
| 1266 |
return item, nil |
| 1267 |
} |
| 1268 |
|
| 1269 |
func (it *RuntimeProjectAttachmentIterator) bufLen() int { |
| 1270 |
return len(it.items) |
| 1271 |
} |
| 1272 |
|
| 1273 |
func (it *RuntimeProjectAttachmentIterator) takeBuf() interface{} { |
| 1274 |
b := it.items |
| 1275 |
it.items = nil |
| 1276 |
return b |
| 1277 |
} |
| 1278 |
|
| 1279 |
// SearchResultIterator manages a stream of *apihubpb.SearchResult. |
| 1280 |
type SearchResultIterator struct { |
| 1281 |
items []*apihubpb.SearchResult |
| 1282 |
pageInfo *iterator.PageInfo |
| 1283 |
nextFunc func() error |
| 1284 |
|
| 1285 |
// Response is the raw response for the current page. |
| 1286 |
// It must be cast to the RPC response type. |
| 1287 |
// Calling Next() or InternalFetch() updates this value. |
| 1288 |
Response interface{} |
| 1289 |
|
| 1290 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 1291 |
// It is not part of the stable interface of this package. |
| 1292 |
// |
| 1293 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 1294 |
// The number of results is no greater than pageSize. |
| 1295 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 1296 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.SearchResult, nextPageToken string, err error) |
| 1297 |
} |
| 1298 |
|
| 1299 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1300 |
func (it *SearchResultIterator) PageInfo() *iterator.PageInfo { |
| 1301 |
return it.pageInfo |
| 1302 |
} |
| 1303 |
|
| 1304 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1305 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 1306 |
func (it *SearchResultIterator) Next() (*apihubpb.SearchResult, error) { |
| 1307 |
var item *apihubpb.SearchResult |
| 1308 |
if err := it.nextFunc(); err != nil { |
| 1309 |
return item, err |
| 1310 |
} |
| 1311 |
item = it.items[0] |
| 1312 |
it.items = it.items[1:] |
| 1313 |
return item, nil |
| 1314 |
} |
| 1315 |
|
| 1316 |
func (it *SearchResultIterator) bufLen() int { |
| 1317 |
return len(it.items) |
| 1318 |
} |
| 1319 |
|
| 1320 |
func (it *SearchResultIterator) takeBuf() interface{} { |
| 1321 |
b := it.items |
| 1322 |
it.items = nil |
| 1323 |
return b |
| 1324 |
} |
| 1325 |
|
| 1326 |
// SpecIterator manages a stream of *apihubpb.Spec. |
| 1327 |
type SpecIterator struct { |
| 1328 |
items []*apihubpb.Spec |
| 1329 |
pageInfo *iterator.PageInfo |
| 1330 |
nextFunc func() error |
| 1331 |
|
| 1332 |
// Response is the raw response for the current page. |
| 1333 |
// It must be cast to the RPC response type. |
| 1334 |
// Calling Next() or InternalFetch() updates this value. |
| 1335 |
Response interface{} |
| 1336 |
|
| 1337 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 1338 |
// It is not part of the stable interface of this package. |
| 1339 |
// |
| 1340 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 1341 |
// The number of results is no greater than pageSize. |
| 1342 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 1343 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.Spec, nextPageToken string, err error) |
| 1344 |
} |
| 1345 |
|
| 1346 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1347 |
func (it *SpecIterator) PageInfo() *iterator.PageInfo { |
| 1348 |
return it.pageInfo |
| 1349 |
} |
| 1350 |
|
| 1351 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1352 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 1353 |
func (it *SpecIterator) Next() (*apihubpb.Spec, error) { |
| 1354 |
var item *apihubpb.Spec |
| 1355 |
if err := it.nextFunc(); err != nil { |
| 1356 |
return item, err |
| 1357 |
} |
| 1358 |
item = it.items[0] |
| 1359 |
it.items = it.items[1:] |
| 1360 |
return item, nil |
| 1361 |
} |
| 1362 |
|
| 1363 |
func (it *SpecIterator) bufLen() int { |
| 1364 |
return len(it.items) |
| 1365 |
} |
| 1366 |
|
| 1367 |
func (it *SpecIterator) takeBuf() interface{} { |
| 1368 |
b := it.items |
| 1369 |
it.items = nil |
| 1370 |
return b |
| 1371 |
} |
| 1372 |
|
| 1373 |
// VersionIterator manages a stream of *apihubpb.Version. |
| 1374 |
type VersionIterator struct { |
| 1375 |
items []*apihubpb.Version |
| 1376 |
pageInfo *iterator.PageInfo |
| 1377 |
nextFunc func() error |
| 1378 |
|
| 1379 |
// Response is the raw response for the current page. |
| 1380 |
// It must be cast to the RPC response type. |
| 1381 |
// Calling Next() or InternalFetch() updates this value. |
| 1382 |
Response interface{} |
| 1383 |
|
| 1384 |
// InternalFetch is for use by the Google Cloud Libraries only. |
| 1385 |
// It is not part of the stable interface of this package. |
| 1386 |
// |
| 1387 |
// InternalFetch returns results from a single call to the underlying RPC. |
| 1388 |
// The number of results is no greater than pageSize. |
| 1389 |
// If there are no more results, nextPageToken is empty and err is nil. |
| 1390 |
InternalFetch func(pageSize int, pageToken string) (results []*apihubpb.Version, nextPageToken string, err error) |
| 1391 |
} |
| 1392 |
|
| 1393 |
// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. |
| 1394 |
func (it *VersionIterator) PageInfo() *iterator.PageInfo { |
| 1395 |
return it.pageInfo |
| 1396 |
} |
| 1397 |
|
| 1398 |
// Next returns the next result. Its second return value is iterator.Done if there are no more |
| 1399 |
// results. Once Next returns Done, all subsequent calls will return Done. |
| 1400 |
func (it *VersionIterator) Next() (*apihubpb.Version, error) { |
| 1401 |
var item *apihubpb.Version |
| 1402 |
if err := it.nextFunc(); err != nil { |
| 1403 |
return item, err |
| 1404 |
} |
| 1405 |
item = it.items[0] |
| 1406 |
it.items = it.items[1:] |
| 1407 |
return item, nil |
| 1408 |
} |
| 1409 |
|
| 1410 |
func (it *VersionIterator) bufLen() int { |
| 1411 |
return len(it.items) |
| 1412 |
} |
| 1413 |
|
| 1414 |
func (it *VersionIterator) takeBuf() interface{} { |
| 1415 |
b := it.items |
| 1416 |
it.items = nil |
| 1417 |
return b |
| 1418 |
} |