...

Source file src/cloud.google.com/go/monitoring/apiv3/v2/auxiliary.go

Documentation: cloud.google.com/go/monitoring/apiv3/v2

     1  // Copyright 2024 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 monitoring
    18  
    19  import (
    20  	monitoringpb "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
    21  	"google.golang.org/api/iterator"
    22  	metricpb "google.golang.org/genproto/googleapis/api/metric"
    23  	monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
    24  )
    25  
    26  // AlertPolicyIterator manages a stream of *monitoringpb.AlertPolicy.
    27  type AlertPolicyIterator struct {
    28  	items    []*monitoringpb.AlertPolicy
    29  	pageInfo *iterator.PageInfo
    30  	nextFunc func() error
    31  
    32  	// Response is the raw response for the current page.
    33  	// It must be cast to the RPC response type.
    34  	// Calling Next() or InternalFetch() updates this value.
    35  	Response interface{}
    36  
    37  	// InternalFetch is for use by the Google Cloud Libraries only.
    38  	// It is not part of the stable interface of this package.
    39  	//
    40  	// InternalFetch returns results from a single call to the underlying RPC.
    41  	// The number of results is no greater than pageSize.
    42  	// If there are no more results, nextPageToken is empty and err is nil.
    43  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.AlertPolicy, nextPageToken string, err error)
    44  }
    45  
    46  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
    47  func (it *AlertPolicyIterator) PageInfo() *iterator.PageInfo {
    48  	return it.pageInfo
    49  }
    50  
    51  // Next returns the next result. Its second return value is iterator.Done if there are no more
    52  // results. Once Next returns Done, all subsequent calls will return Done.
    53  func (it *AlertPolicyIterator) Next() (*monitoringpb.AlertPolicy, error) {
    54  	var item *monitoringpb.AlertPolicy
    55  	if err := it.nextFunc(); err != nil {
    56  		return item, err
    57  	}
    58  	item = it.items[0]
    59  	it.items = it.items[1:]
    60  	return item, nil
    61  }
    62  
    63  func (it *AlertPolicyIterator) bufLen() int {
    64  	return len(it.items)
    65  }
    66  
    67  func (it *AlertPolicyIterator) takeBuf() interface{} {
    68  	b := it.items
    69  	it.items = nil
    70  	return b
    71  }
    72  
    73  // GroupIterator manages a stream of *monitoringpb.Group.
    74  type GroupIterator struct {
    75  	items    []*monitoringpb.Group
    76  	pageInfo *iterator.PageInfo
    77  	nextFunc func() error
    78  
    79  	// Response is the raw response for the current page.
    80  	// It must be cast to the RPC response type.
    81  	// Calling Next() or InternalFetch() updates this value.
    82  	Response interface{}
    83  
    84  	// InternalFetch is for use by the Google Cloud Libraries only.
    85  	// It is not part of the stable interface of this package.
    86  	//
    87  	// InternalFetch returns results from a single call to the underlying RPC.
    88  	// The number of results is no greater than pageSize.
    89  	// If there are no more results, nextPageToken is empty and err is nil.
    90  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.Group, nextPageToken string, err error)
    91  }
    92  
    93  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
    94  func (it *GroupIterator) PageInfo() *iterator.PageInfo {
    95  	return it.pageInfo
    96  }
    97  
    98  // Next returns the next result. Its second return value is iterator.Done if there are no more
    99  // results. Once Next returns Done, all subsequent calls will return Done.
   100  func (it *GroupIterator) Next() (*monitoringpb.Group, error) {
   101  	var item *monitoringpb.Group
   102  	if err := it.nextFunc(); err != nil {
   103  		return item, err
   104  	}
   105  	item = it.items[0]
   106  	it.items = it.items[1:]
   107  	return item, nil
   108  }
   109  
   110  func (it *GroupIterator) bufLen() int {
   111  	return len(it.items)
   112  }
   113  
   114  func (it *GroupIterator) takeBuf() interface{} {
   115  	b := it.items
   116  	it.items = nil
   117  	return b
   118  }
   119  
   120  // MetricDescriptorIterator manages a stream of *metricpb.MetricDescriptor.
   121  type MetricDescriptorIterator struct {
   122  	items    []*metricpb.MetricDescriptor
   123  	pageInfo *iterator.PageInfo
   124  	nextFunc func() error
   125  
   126  	// Response is the raw response for the current page.
   127  	// It must be cast to the RPC response type.
   128  	// Calling Next() or InternalFetch() updates this value.
   129  	Response interface{}
   130  
   131  	// InternalFetch is for use by the Google Cloud Libraries only.
   132  	// It is not part of the stable interface of this package.
   133  	//
   134  	// InternalFetch returns results from a single call to the underlying RPC.
   135  	// The number of results is no greater than pageSize.
   136  	// If there are no more results, nextPageToken is empty and err is nil.
   137  	InternalFetch func(pageSize int, pageToken string) (results []*metricpb.MetricDescriptor, nextPageToken string, err error)
   138  }
   139  
   140  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   141  func (it *MetricDescriptorIterator) PageInfo() *iterator.PageInfo {
   142  	return it.pageInfo
   143  }
   144  
   145  // Next returns the next result. Its second return value is iterator.Done if there are no more
   146  // results. Once Next returns Done, all subsequent calls will return Done.
   147  func (it *MetricDescriptorIterator) Next() (*metricpb.MetricDescriptor, error) {
   148  	var item *metricpb.MetricDescriptor
   149  	if err := it.nextFunc(); err != nil {
   150  		return item, err
   151  	}
   152  	item = it.items[0]
   153  	it.items = it.items[1:]
   154  	return item, nil
   155  }
   156  
   157  func (it *MetricDescriptorIterator) bufLen() int {
   158  	return len(it.items)
   159  }
   160  
   161  func (it *MetricDescriptorIterator) takeBuf() interface{} {
   162  	b := it.items
   163  	it.items = nil
   164  	return b
   165  }
   166  
   167  // MonitoredResourceDescriptorIterator manages a stream of *monitoredrespb.MonitoredResourceDescriptor.
   168  type MonitoredResourceDescriptorIterator struct {
   169  	items    []*monitoredrespb.MonitoredResourceDescriptor
   170  	pageInfo *iterator.PageInfo
   171  	nextFunc func() error
   172  
   173  	// Response is the raw response for the current page.
   174  	// It must be cast to the RPC response type.
   175  	// Calling Next() or InternalFetch() updates this value.
   176  	Response interface{}
   177  
   178  	// InternalFetch is for use by the Google Cloud Libraries only.
   179  	// It is not part of the stable interface of this package.
   180  	//
   181  	// InternalFetch returns results from a single call to the underlying RPC.
   182  	// The number of results is no greater than pageSize.
   183  	// If there are no more results, nextPageToken is empty and err is nil.
   184  	InternalFetch func(pageSize int, pageToken string) (results []*monitoredrespb.MonitoredResourceDescriptor, nextPageToken string, err error)
   185  }
   186  
   187  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   188  func (it *MonitoredResourceDescriptorIterator) PageInfo() *iterator.PageInfo {
   189  	return it.pageInfo
   190  }
   191  
   192  // Next returns the next result. Its second return value is iterator.Done if there are no more
   193  // results. Once Next returns Done, all subsequent calls will return Done.
   194  func (it *MonitoredResourceDescriptorIterator) Next() (*monitoredrespb.MonitoredResourceDescriptor, error) {
   195  	var item *monitoredrespb.MonitoredResourceDescriptor
   196  	if err := it.nextFunc(); err != nil {
   197  		return item, err
   198  	}
   199  	item = it.items[0]
   200  	it.items = it.items[1:]
   201  	return item, nil
   202  }
   203  
   204  func (it *MonitoredResourceDescriptorIterator) bufLen() int {
   205  	return len(it.items)
   206  }
   207  
   208  func (it *MonitoredResourceDescriptorIterator) takeBuf() interface{} {
   209  	b := it.items
   210  	it.items = nil
   211  	return b
   212  }
   213  
   214  // MonitoredResourceIterator manages a stream of *monitoredrespb.MonitoredResource.
   215  type MonitoredResourceIterator struct {
   216  	items    []*monitoredrespb.MonitoredResource
   217  	pageInfo *iterator.PageInfo
   218  	nextFunc func() error
   219  
   220  	// Response is the raw response for the current page.
   221  	// It must be cast to the RPC response type.
   222  	// Calling Next() or InternalFetch() updates this value.
   223  	Response interface{}
   224  
   225  	// InternalFetch is for use by the Google Cloud Libraries only.
   226  	// It is not part of the stable interface of this package.
   227  	//
   228  	// InternalFetch returns results from a single call to the underlying RPC.
   229  	// The number of results is no greater than pageSize.
   230  	// If there are no more results, nextPageToken is empty and err is nil.
   231  	InternalFetch func(pageSize int, pageToken string) (results []*monitoredrespb.MonitoredResource, nextPageToken string, err error)
   232  }
   233  
   234  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   235  func (it *MonitoredResourceIterator) PageInfo() *iterator.PageInfo {
   236  	return it.pageInfo
   237  }
   238  
   239  // Next returns the next result. Its second return value is iterator.Done if there are no more
   240  // results. Once Next returns Done, all subsequent calls will return Done.
   241  func (it *MonitoredResourceIterator) Next() (*monitoredrespb.MonitoredResource, error) {
   242  	var item *monitoredrespb.MonitoredResource
   243  	if err := it.nextFunc(); err != nil {
   244  		return item, err
   245  	}
   246  	item = it.items[0]
   247  	it.items = it.items[1:]
   248  	return item, nil
   249  }
   250  
   251  func (it *MonitoredResourceIterator) bufLen() int {
   252  	return len(it.items)
   253  }
   254  
   255  func (it *MonitoredResourceIterator) takeBuf() interface{} {
   256  	b := it.items
   257  	it.items = nil
   258  	return b
   259  }
   260  
   261  // NotificationChannelDescriptorIterator manages a stream of *monitoringpb.NotificationChannelDescriptor.
   262  type NotificationChannelDescriptorIterator struct {
   263  	items    []*monitoringpb.NotificationChannelDescriptor
   264  	pageInfo *iterator.PageInfo
   265  	nextFunc func() error
   266  
   267  	// Response is the raw response for the current page.
   268  	// It must be cast to the RPC response type.
   269  	// Calling Next() or InternalFetch() updates this value.
   270  	Response interface{}
   271  
   272  	// InternalFetch is for use by the Google Cloud Libraries only.
   273  	// It is not part of the stable interface of this package.
   274  	//
   275  	// InternalFetch returns results from a single call to the underlying RPC.
   276  	// The number of results is no greater than pageSize.
   277  	// If there are no more results, nextPageToken is empty and err is nil.
   278  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.NotificationChannelDescriptor, nextPageToken string, err error)
   279  }
   280  
   281  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   282  func (it *NotificationChannelDescriptorIterator) PageInfo() *iterator.PageInfo {
   283  	return it.pageInfo
   284  }
   285  
   286  // Next returns the next result. Its second return value is iterator.Done if there are no more
   287  // results. Once Next returns Done, all subsequent calls will return Done.
   288  func (it *NotificationChannelDescriptorIterator) Next() (*monitoringpb.NotificationChannelDescriptor, error) {
   289  	var item *monitoringpb.NotificationChannelDescriptor
   290  	if err := it.nextFunc(); err != nil {
   291  		return item, err
   292  	}
   293  	item = it.items[0]
   294  	it.items = it.items[1:]
   295  	return item, nil
   296  }
   297  
   298  func (it *NotificationChannelDescriptorIterator) bufLen() int {
   299  	return len(it.items)
   300  }
   301  
   302  func (it *NotificationChannelDescriptorIterator) takeBuf() interface{} {
   303  	b := it.items
   304  	it.items = nil
   305  	return b
   306  }
   307  
   308  // NotificationChannelIterator manages a stream of *monitoringpb.NotificationChannel.
   309  type NotificationChannelIterator struct {
   310  	items    []*monitoringpb.NotificationChannel
   311  	pageInfo *iterator.PageInfo
   312  	nextFunc func() error
   313  
   314  	// Response is the raw response for the current page.
   315  	// It must be cast to the RPC response type.
   316  	// Calling Next() or InternalFetch() updates this value.
   317  	Response interface{}
   318  
   319  	// InternalFetch is for use by the Google Cloud Libraries only.
   320  	// It is not part of the stable interface of this package.
   321  	//
   322  	// InternalFetch returns results from a single call to the underlying RPC.
   323  	// The number of results is no greater than pageSize.
   324  	// If there are no more results, nextPageToken is empty and err is nil.
   325  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.NotificationChannel, nextPageToken string, err error)
   326  }
   327  
   328  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   329  func (it *NotificationChannelIterator) PageInfo() *iterator.PageInfo {
   330  	return it.pageInfo
   331  }
   332  
   333  // Next returns the next result. Its second return value is iterator.Done if there are no more
   334  // results. Once Next returns Done, all subsequent calls will return Done.
   335  func (it *NotificationChannelIterator) Next() (*monitoringpb.NotificationChannel, error) {
   336  	var item *monitoringpb.NotificationChannel
   337  	if err := it.nextFunc(); err != nil {
   338  		return item, err
   339  	}
   340  	item = it.items[0]
   341  	it.items = it.items[1:]
   342  	return item, nil
   343  }
   344  
   345  func (it *NotificationChannelIterator) bufLen() int {
   346  	return len(it.items)
   347  }
   348  
   349  func (it *NotificationChannelIterator) takeBuf() interface{} {
   350  	b := it.items
   351  	it.items = nil
   352  	return b
   353  }
   354  
   355  // ServiceIterator manages a stream of *monitoringpb.Service.
   356  type ServiceIterator struct {
   357  	items    []*monitoringpb.Service
   358  	pageInfo *iterator.PageInfo
   359  	nextFunc func() error
   360  
   361  	// Response is the raw response for the current page.
   362  	// It must be cast to the RPC response type.
   363  	// Calling Next() or InternalFetch() updates this value.
   364  	Response interface{}
   365  
   366  	// InternalFetch is for use by the Google Cloud Libraries only.
   367  	// It is not part of the stable interface of this package.
   368  	//
   369  	// InternalFetch returns results from a single call to the underlying RPC.
   370  	// The number of results is no greater than pageSize.
   371  	// If there are no more results, nextPageToken is empty and err is nil.
   372  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.Service, nextPageToken string, err error)
   373  }
   374  
   375  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   376  func (it *ServiceIterator) PageInfo() *iterator.PageInfo {
   377  	return it.pageInfo
   378  }
   379  
   380  // Next returns the next result. Its second return value is iterator.Done if there are no more
   381  // results. Once Next returns Done, all subsequent calls will return Done.
   382  func (it *ServiceIterator) Next() (*monitoringpb.Service, error) {
   383  	var item *monitoringpb.Service
   384  	if err := it.nextFunc(); err != nil {
   385  		return item, err
   386  	}
   387  	item = it.items[0]
   388  	it.items = it.items[1:]
   389  	return item, nil
   390  }
   391  
   392  func (it *ServiceIterator) bufLen() int {
   393  	return len(it.items)
   394  }
   395  
   396  func (it *ServiceIterator) takeBuf() interface{} {
   397  	b := it.items
   398  	it.items = nil
   399  	return b
   400  }
   401  
   402  // ServiceLevelObjectiveIterator manages a stream of *monitoringpb.ServiceLevelObjective.
   403  type ServiceLevelObjectiveIterator struct {
   404  	items    []*monitoringpb.ServiceLevelObjective
   405  	pageInfo *iterator.PageInfo
   406  	nextFunc func() error
   407  
   408  	// Response is the raw response for the current page.
   409  	// It must be cast to the RPC response type.
   410  	// Calling Next() or InternalFetch() updates this value.
   411  	Response interface{}
   412  
   413  	// InternalFetch is for use by the Google Cloud Libraries only.
   414  	// It is not part of the stable interface of this package.
   415  	//
   416  	// InternalFetch returns results from a single call to the underlying RPC.
   417  	// The number of results is no greater than pageSize.
   418  	// If there are no more results, nextPageToken is empty and err is nil.
   419  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.ServiceLevelObjective, nextPageToken string, err error)
   420  }
   421  
   422  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   423  func (it *ServiceLevelObjectiveIterator) PageInfo() *iterator.PageInfo {
   424  	return it.pageInfo
   425  }
   426  
   427  // Next returns the next result. Its second return value is iterator.Done if there are no more
   428  // results. Once Next returns Done, all subsequent calls will return Done.
   429  func (it *ServiceLevelObjectiveIterator) Next() (*monitoringpb.ServiceLevelObjective, error) {
   430  	var item *monitoringpb.ServiceLevelObjective
   431  	if err := it.nextFunc(); err != nil {
   432  		return item, err
   433  	}
   434  	item = it.items[0]
   435  	it.items = it.items[1:]
   436  	return item, nil
   437  }
   438  
   439  func (it *ServiceLevelObjectiveIterator) bufLen() int {
   440  	return len(it.items)
   441  }
   442  
   443  func (it *ServiceLevelObjectiveIterator) takeBuf() interface{} {
   444  	b := it.items
   445  	it.items = nil
   446  	return b
   447  }
   448  
   449  // SnoozeIterator manages a stream of *monitoringpb.Snooze.
   450  type SnoozeIterator struct {
   451  	items    []*monitoringpb.Snooze
   452  	pageInfo *iterator.PageInfo
   453  	nextFunc func() error
   454  
   455  	// Response is the raw response for the current page.
   456  	// It must be cast to the RPC response type.
   457  	// Calling Next() or InternalFetch() updates this value.
   458  	Response interface{}
   459  
   460  	// InternalFetch is for use by the Google Cloud Libraries only.
   461  	// It is not part of the stable interface of this package.
   462  	//
   463  	// InternalFetch returns results from a single call to the underlying RPC.
   464  	// The number of results is no greater than pageSize.
   465  	// If there are no more results, nextPageToken is empty and err is nil.
   466  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.Snooze, nextPageToken string, err error)
   467  }
   468  
   469  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   470  func (it *SnoozeIterator) PageInfo() *iterator.PageInfo {
   471  	return it.pageInfo
   472  }
   473  
   474  // Next returns the next result. Its second return value is iterator.Done if there are no more
   475  // results. Once Next returns Done, all subsequent calls will return Done.
   476  func (it *SnoozeIterator) Next() (*monitoringpb.Snooze, error) {
   477  	var item *monitoringpb.Snooze
   478  	if err := it.nextFunc(); err != nil {
   479  		return item, err
   480  	}
   481  	item = it.items[0]
   482  	it.items = it.items[1:]
   483  	return item, nil
   484  }
   485  
   486  func (it *SnoozeIterator) bufLen() int {
   487  	return len(it.items)
   488  }
   489  
   490  func (it *SnoozeIterator) takeBuf() interface{} {
   491  	b := it.items
   492  	it.items = nil
   493  	return b
   494  }
   495  
   496  // TimeSeriesDataIterator manages a stream of *monitoringpb.TimeSeriesData.
   497  type TimeSeriesDataIterator struct {
   498  	items    []*monitoringpb.TimeSeriesData
   499  	pageInfo *iterator.PageInfo
   500  	nextFunc func() error
   501  
   502  	// Response is the raw response for the current page.
   503  	// It must be cast to the RPC response type.
   504  	// Calling Next() or InternalFetch() updates this value.
   505  	Response interface{}
   506  
   507  	// InternalFetch is for use by the Google Cloud Libraries only.
   508  	// It is not part of the stable interface of this package.
   509  	//
   510  	// InternalFetch returns results from a single call to the underlying RPC.
   511  	// The number of results is no greater than pageSize.
   512  	// If there are no more results, nextPageToken is empty and err is nil.
   513  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.TimeSeriesData, nextPageToken string, err error)
   514  }
   515  
   516  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   517  func (it *TimeSeriesDataIterator) PageInfo() *iterator.PageInfo {
   518  	return it.pageInfo
   519  }
   520  
   521  // Next returns the next result. Its second return value is iterator.Done if there are no more
   522  // results. Once Next returns Done, all subsequent calls will return Done.
   523  func (it *TimeSeriesDataIterator) Next() (*monitoringpb.TimeSeriesData, error) {
   524  	var item *monitoringpb.TimeSeriesData
   525  	if err := it.nextFunc(); err != nil {
   526  		return item, err
   527  	}
   528  	item = it.items[0]
   529  	it.items = it.items[1:]
   530  	return item, nil
   531  }
   532  
   533  func (it *TimeSeriesDataIterator) bufLen() int {
   534  	return len(it.items)
   535  }
   536  
   537  func (it *TimeSeriesDataIterator) takeBuf() interface{} {
   538  	b := it.items
   539  	it.items = nil
   540  	return b
   541  }
   542  
   543  // TimeSeriesIterator manages a stream of *monitoringpb.TimeSeries.
   544  type TimeSeriesIterator struct {
   545  	items    []*monitoringpb.TimeSeries
   546  	pageInfo *iterator.PageInfo
   547  	nextFunc func() error
   548  
   549  	// Response is the raw response for the current page.
   550  	// It must be cast to the RPC response type.
   551  	// Calling Next() or InternalFetch() updates this value.
   552  	Response interface{}
   553  
   554  	// InternalFetch is for use by the Google Cloud Libraries only.
   555  	// It is not part of the stable interface of this package.
   556  	//
   557  	// InternalFetch returns results from a single call to the underlying RPC.
   558  	// The number of results is no greater than pageSize.
   559  	// If there are no more results, nextPageToken is empty and err is nil.
   560  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.TimeSeries, nextPageToken string, err error)
   561  }
   562  
   563  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   564  func (it *TimeSeriesIterator) PageInfo() *iterator.PageInfo {
   565  	return it.pageInfo
   566  }
   567  
   568  // Next returns the next result. Its second return value is iterator.Done if there are no more
   569  // results. Once Next returns Done, all subsequent calls will return Done.
   570  func (it *TimeSeriesIterator) Next() (*monitoringpb.TimeSeries, error) {
   571  	var item *monitoringpb.TimeSeries
   572  	if err := it.nextFunc(); err != nil {
   573  		return item, err
   574  	}
   575  	item = it.items[0]
   576  	it.items = it.items[1:]
   577  	return item, nil
   578  }
   579  
   580  func (it *TimeSeriesIterator) bufLen() int {
   581  	return len(it.items)
   582  }
   583  
   584  func (it *TimeSeriesIterator) takeBuf() interface{} {
   585  	b := it.items
   586  	it.items = nil
   587  	return b
   588  }
   589  
   590  // UptimeCheckConfigIterator manages a stream of *monitoringpb.UptimeCheckConfig.
   591  type UptimeCheckConfigIterator struct {
   592  	items    []*monitoringpb.UptimeCheckConfig
   593  	pageInfo *iterator.PageInfo
   594  	nextFunc func() error
   595  
   596  	// Response is the raw response for the current page.
   597  	// It must be cast to the RPC response type.
   598  	// Calling Next() or InternalFetch() updates this value.
   599  	Response interface{}
   600  
   601  	// InternalFetch is for use by the Google Cloud Libraries only.
   602  	// It is not part of the stable interface of this package.
   603  	//
   604  	// InternalFetch returns results from a single call to the underlying RPC.
   605  	// The number of results is no greater than pageSize.
   606  	// If there are no more results, nextPageToken is empty and err is nil.
   607  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.UptimeCheckConfig, nextPageToken string, err error)
   608  }
   609  
   610  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   611  func (it *UptimeCheckConfigIterator) PageInfo() *iterator.PageInfo {
   612  	return it.pageInfo
   613  }
   614  
   615  // Next returns the next result. Its second return value is iterator.Done if there are no more
   616  // results. Once Next returns Done, all subsequent calls will return Done.
   617  func (it *UptimeCheckConfigIterator) Next() (*monitoringpb.UptimeCheckConfig, error) {
   618  	var item *monitoringpb.UptimeCheckConfig
   619  	if err := it.nextFunc(); err != nil {
   620  		return item, err
   621  	}
   622  	item = it.items[0]
   623  	it.items = it.items[1:]
   624  	return item, nil
   625  }
   626  
   627  func (it *UptimeCheckConfigIterator) bufLen() int {
   628  	return len(it.items)
   629  }
   630  
   631  func (it *UptimeCheckConfigIterator) takeBuf() interface{} {
   632  	b := it.items
   633  	it.items = nil
   634  	return b
   635  }
   636  
   637  // UptimeCheckIpIterator manages a stream of *monitoringpb.UptimeCheckIp.
   638  type UptimeCheckIpIterator struct {
   639  	items    []*monitoringpb.UptimeCheckIp
   640  	pageInfo *iterator.PageInfo
   641  	nextFunc func() error
   642  
   643  	// Response is the raw response for the current page.
   644  	// It must be cast to the RPC response type.
   645  	// Calling Next() or InternalFetch() updates this value.
   646  	Response interface{}
   647  
   648  	// InternalFetch is for use by the Google Cloud Libraries only.
   649  	// It is not part of the stable interface of this package.
   650  	//
   651  	// InternalFetch returns results from a single call to the underlying RPC.
   652  	// The number of results is no greater than pageSize.
   653  	// If there are no more results, nextPageToken is empty and err is nil.
   654  	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.UptimeCheckIp, nextPageToken string, err error)
   655  }
   656  
   657  // PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
   658  func (it *UptimeCheckIpIterator) PageInfo() *iterator.PageInfo {
   659  	return it.pageInfo
   660  }
   661  
   662  // Next returns the next result. Its second return value is iterator.Done if there are no more
   663  // results. Once Next returns Done, all subsequent calls will return Done.
   664  func (it *UptimeCheckIpIterator) Next() (*monitoringpb.UptimeCheckIp, error) {
   665  	var item *monitoringpb.UptimeCheckIp
   666  	if err := it.nextFunc(); err != nil {
   667  		return item, err
   668  	}
   669  	item = it.items[0]
   670  	it.items = it.items[1:]
   671  	return item, nil
   672  }
   673  
   674  func (it *UptimeCheckIpIterator) bufLen() int {
   675  	return len(it.items)
   676  }
   677  
   678  func (it *UptimeCheckIpIterator) takeBuf() interface{} {
   679  	b := it.items
   680  	it.items = nil
   681  	return b
   682  }
   683  

View as plain text