Copyright 2020 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Code generated by protoc-gen-go_gapic. DO NOT EDIT.

package monitoring

import (
	
	
	
	
	

	
	gax 
	
	
	gtransport 
	monitoringpb 
	
	
	
)

var newUptimeCheckClientHook clientHook
UptimeCheckCallOptions contains the retry settings for each method of UptimeCheckClient.
type UptimeCheckCallOptions struct {
	ListUptimeCheckConfigs  []gax.CallOption
	GetUptimeCheckConfig    []gax.CallOption
	CreateUptimeCheckConfig []gax.CallOption
	UpdateUptimeCheckConfig []gax.CallOption
	DeleteUptimeCheckConfig []gax.CallOption
	ListUptimeCheckIps      []gax.CallOption
}

func () []option.ClientOption {
	return []option.ClientOption{
		option.WithEndpoint("monitoring.googleapis.com:443"),
		option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
		option.WithScopes(DefaultAuthScopes()...),
		option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
			grpc.MaxCallRecvMsgSize(math.MaxInt32))),
	}
}

func () *UptimeCheckCallOptions {
	return &UptimeCheckCallOptions{
		ListUptimeCheckConfigs: []gax.CallOption{
			gax.WithRetry(func() gax.Retryer {
				return gax.OnCodes([]codes.Code{
					codes.DeadlineExceeded,
					codes.Unavailable,
				}, gax.Backoff{
					Initial:    100 * time.Millisecond,
					Max:        30000 * time.Millisecond,
					Multiplier: 1.30,
				})
			}),
		},
		GetUptimeCheckConfig: []gax.CallOption{
			gax.WithRetry(func() gax.Retryer {
				return gax.OnCodes([]codes.Code{
					codes.DeadlineExceeded,
					codes.Unavailable,
				}, gax.Backoff{
					Initial:    100 * time.Millisecond,
					Max:        30000 * time.Millisecond,
					Multiplier: 1.30,
				})
			}),
		},
		CreateUptimeCheckConfig: []gax.CallOption{},
		UpdateUptimeCheckConfig: []gax.CallOption{},
		DeleteUptimeCheckConfig: []gax.CallOption{
			gax.WithRetry(func() gax.Retryer {
				return gax.OnCodes([]codes.Code{
					codes.DeadlineExceeded,
					codes.Unavailable,
				}, gax.Backoff{
					Initial:    100 * time.Millisecond,
					Max:        30000 * time.Millisecond,
					Multiplier: 1.30,
				})
			}),
		},
		ListUptimeCheckIps: []gax.CallOption{
			gax.WithRetry(func() gax.Retryer {
				return gax.OnCodes([]codes.Code{
					codes.DeadlineExceeded,
					codes.Unavailable,
				}, gax.Backoff{
					Initial:    100 * time.Millisecond,
					Max:        30000 * time.Millisecond,
					Multiplier: 1.30,
				})
			}),
		},
	}
}
UptimeCheckClient is a client for interacting with Cloud Monitoring API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Connection pool of gRPC connections to the service.
The call options for this service.
The x-goog-* metadata to be sent with each request.
NewUptimeCheckClient creates a new uptime check service client. The UptimeCheckService API is used to manage (list, create, delete, edit) Uptime check configurations in the Stackdriver Monitoring product. An Uptime check is a piece of configuration that determines which resources and services to monitor for availability. These configurations can also be configured interactively by navigating to the [Cloud Console] (http://console.cloud.google.com (at http://console.cloud.google.com)), selecting the appropriate project, clicking on “Monitoring” on the left-hand side to navigate to Stackdriver, and then clicking on “Uptime”.
func ( context.Context,  ...option.ClientOption) (*UptimeCheckClient, error) {
	 := defaultUptimeCheckClientOptions()

	if newUptimeCheckClientHook != nil {
		,  := newUptimeCheckClientHook(, clientHookParams{})
		if  != nil {
			return nil, 
		}
		 = append(, ...)
	}

	,  := gtransport.DialPool(, append(, ...)...)
	if  != nil {
		return nil, 
	}
	 := &UptimeCheckClient{
		connPool:    ,
		CallOptions: defaultUptimeCheckCallOptions(),

		uptimeCheckClient: monitoringpb.NewUptimeCheckServiceClient(),
	}
	.setGoogleClientInfo()

	return , nil
}
Connection returns a connection to the API service. Deprecated.
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func ( *UptimeCheckClient) () error {
	return .connPool.Close()
}
setGoogleClientInfo sets the name and version of the application in the `x-goog-api-client` header passed on each request. Intended for use by Google-written clients.
func ( *UptimeCheckClient) ( ...string) {
	 := append([]string{"gl-go", versionGo()}, ...)
	 = append(, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
	.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(...))
}
ListUptimeCheckConfigs lists the existing valid Uptime check configurations for the project (leaving out any invalid configurations).
func ( *UptimeCheckClient) ( context.Context,  *monitoringpb.ListUptimeCheckConfigsRequest,  ...gax.CallOption) *UptimeCheckConfigIterator {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(.GetParent())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.ListUptimeCheckConfigs[0:len(.CallOptions.ListUptimeCheckConfigs):len(.CallOptions.ListUptimeCheckConfigs)], ...)
	 := &UptimeCheckConfigIterator{}
	 = proto.Clone().(*monitoringpb.ListUptimeCheckConfigsRequest)
	.InternalFetch = func( int,  string) ([]*monitoringpb.UptimeCheckConfig, string, error) {
		var  *monitoringpb.ListUptimeCheckConfigsResponse
		.PageToken = 
		if  > math.MaxInt32 {
			.PageSize = math.MaxInt32
		} else {
			.PageSize = int32()
		}
		 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
			var  error
			,  = .uptimeCheckClient.ListUptimeCheckConfigs(, , .GRPC...)
			return 
		}, ...)
		if  != nil {
			return nil, "", 
		}

		.Response = 
		return .UptimeCheckConfigs, .NextPageToken, nil
	}
	 := func( int,  string) (string, error) {
		, ,  := .InternalFetch(, )
		if  != nil {
			return "", 
		}
		.items = append(.items, ...)
		return , nil
	}
	.pageInfo, .nextFunc = iterator.NewPageInfo(, .bufLen, .takeBuf)
	.pageInfo.MaxSize = int(.PageSize)
	.pageInfo.Token = .PageToken
	return 
}
GetUptimeCheckConfig gets a single Uptime check configuration.
func ( *UptimeCheckClient) ( context.Context,  *monitoringpb.GetUptimeCheckConfigRequest,  ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.GetUptimeCheckConfig[0:len(.CallOptions.GetUptimeCheckConfig):len(.CallOptions.GetUptimeCheckConfig)], ...)
	var  *monitoringpb.UptimeCheckConfig
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .uptimeCheckClient.GetUptimeCheckConfig(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
CreateUptimeCheckConfig creates a new Uptime check configuration.
func ( *UptimeCheckClient) ( context.Context,  *monitoringpb.CreateUptimeCheckConfigRequest,  ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(.GetParent())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.CreateUptimeCheckConfig[0:len(.CallOptions.CreateUptimeCheckConfig):len(.CallOptions.CreateUptimeCheckConfig)], ...)
	var  *monitoringpb.UptimeCheckConfig
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .uptimeCheckClient.CreateUptimeCheckConfig(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
UpdateUptimeCheckConfig updates an Uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via updateMask. Returns the updated configuration.
func ( *UptimeCheckClient) ( context.Context,  *monitoringpb.UpdateUptimeCheckConfigRequest,  ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "uptime_check_config.name", url.QueryEscape(.GetUptimeCheckConfig().GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.UpdateUptimeCheckConfig[0:len(.CallOptions.UpdateUptimeCheckConfig):len(.CallOptions.UpdateUptimeCheckConfig)], ...)
	var  *monitoringpb.UptimeCheckConfig
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .uptimeCheckClient.UpdateUptimeCheckConfig(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
DeleteUptimeCheckConfig deletes an Uptime check configuration. Note that this method will fail if the Uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion.
func ( *UptimeCheckClient) ( context.Context,  *monitoringpb.DeleteUptimeCheckConfigRequest,  ...gax.CallOption) error {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.DeleteUptimeCheckConfig[0:len(.CallOptions.DeleteUptimeCheckConfig):len(.CallOptions.DeleteUptimeCheckConfig)], ...)
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		_,  = .uptimeCheckClient.DeleteUptimeCheckConfig(, , .GRPC...)
		return 
	}, ...)
	return 
}
ListUptimeCheckIps returns the list of IP addresses that checkers run from
func ( *UptimeCheckClient) ( context.Context,  *monitoringpb.ListUptimeCheckIpsRequest,  ...gax.CallOption) *UptimeCheckIpIterator {
	 = insertMetadata(, .xGoogMetadata)
	 = append(.CallOptions.ListUptimeCheckIps[0:len(.CallOptions.ListUptimeCheckIps):len(.CallOptions.ListUptimeCheckIps)], ...)
	 := &UptimeCheckIpIterator{}
	 = proto.Clone().(*monitoringpb.ListUptimeCheckIpsRequest)
	.InternalFetch = func( int,  string) ([]*monitoringpb.UptimeCheckIp, string, error) {
		var  *monitoringpb.ListUptimeCheckIpsResponse
		.PageToken = 
		if  > math.MaxInt32 {
			.PageSize = math.MaxInt32
		} else {
			.PageSize = int32()
		}
		 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
			var  error
			,  = .uptimeCheckClient.ListUptimeCheckIps(, , .GRPC...)
			return 
		}, ...)
		if  != nil {
			return nil, "", 
		}

		.Response = 
		return .UptimeCheckIps, .NextPageToken, nil
	}
	 := func( int,  string) (string, error) {
		, ,  := .InternalFetch(, )
		if  != nil {
			return "", 
		}
		.items = append(.items, ...)
		return , nil
	}
	.pageInfo, .nextFunc = iterator.NewPageInfo(, .bufLen, .takeBuf)
	.pageInfo.MaxSize = int(.PageSize)
	.pageInfo.Token = .PageToken
	return 
}
UptimeCheckConfigIterator manages a stream of *monitoringpb.UptimeCheckConfig.
Response is the raw response for the current page. It must be cast to the RPC response type. Calling Next() or InternalFetch() updates this value.
	Response interface{}
InternalFetch is for use by the Google Cloud Libraries only. It is not part of the stable interface of this package. InternalFetch returns results from a single call to the underlying RPC. The number of results is no greater than pageSize. If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.UptimeCheckConfig, nextPageToken string, err error)
}
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func ( *UptimeCheckConfigIterator) () (*monitoringpb.UptimeCheckConfig, error) {
	var  *monitoringpb.UptimeCheckConfig
	if  := .nextFunc();  != nil {
		return , 
	}
	 = .items[0]
	.items = .items[1:]
	return , nil
}

func ( *UptimeCheckConfigIterator) () int {
	return len(.items)
}

func ( *UptimeCheckConfigIterator) () interface{} {
	 := .items
	.items = nil
	return 
}
UptimeCheckIpIterator manages a stream of *monitoringpb.UptimeCheckIp.
Response is the raw response for the current page. It must be cast to the RPC response type. Calling Next() or InternalFetch() updates this value.
	Response interface{}
InternalFetch is for use by the Google Cloud Libraries only. It is not part of the stable interface of this package. InternalFetch returns results from a single call to the underlying RPC. The number of results is no greater than pageSize. If there are no more results, nextPageToken is empty and err is nil.
	InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.UptimeCheckIp, nextPageToken string, err error)
}
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func ( *UptimeCheckIpIterator) () (*monitoringpb.UptimeCheckIp, error) {
	var  *monitoringpb.UptimeCheckIp
	if  := .nextFunc();  != nil {
		return , 
	}
	 = .items[0]
	.items = .items[1:]
	return , nil
}

func ( *UptimeCheckIpIterator) () int {
	return len(.items)
}

func ( *UptimeCheckIpIterator) () interface{} {
	 := .items
	.items = nil
	return