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 newNotificationChannelClientHook clientHook
NotificationChannelCallOptions contains the retry settings for each method of NotificationChannelClient.
type NotificationChannelCallOptions struct {
	ListNotificationChannelDescriptors      []gax.CallOption
	GetNotificationChannelDescriptor        []gax.CallOption
	ListNotificationChannels                []gax.CallOption
	GetNotificationChannel                  []gax.CallOption
	CreateNotificationChannel               []gax.CallOption
	UpdateNotificationChannel               []gax.CallOption
	DeleteNotificationChannel               []gax.CallOption
	SendNotificationChannelVerificationCode []gax.CallOption
	GetNotificationChannelVerificationCode  []gax.CallOption
	VerifyNotificationChannel               []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 () *NotificationChannelCallOptions {
	return &NotificationChannelCallOptions{
		ListNotificationChannelDescriptors: []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,
				})
			}),
		},
		GetNotificationChannelDescriptor: []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,
				})
			}),
		},
		ListNotificationChannels: []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,
				})
			}),
		},
		GetNotificationChannel: []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,
				})
			}),
		},
		CreateNotificationChannel: []gax.CallOption{},
		UpdateNotificationChannel: []gax.CallOption{},
		DeleteNotificationChannel: []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,
				})
			}),
		},
		SendNotificationChannelVerificationCode: []gax.CallOption{},
		GetNotificationChannelVerificationCode: []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,
				})
			}),
		},
		VerifyNotificationChannel: []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,
				})
			}),
		},
	}
}
NotificationChannelClient 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.
NewNotificationChannelClient creates a new notification channel service client. The Notification Channel API provides access to configuration that controls how messages related to incidents are sent.
func ( context.Context,  ...option.ClientOption) (*NotificationChannelClient, error) {
	 := defaultNotificationChannelClientOptions()

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

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

		notificationChannelClient: monitoringpb.NewNotificationChannelServiceClient(),
	}
	.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 ( *NotificationChannelClient) () 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 ( *NotificationChannelClient) ( ...string) {
	 := append([]string{"gl-go", versionGo()}, ...)
	 = append(, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
	.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(...))
}
ListNotificationChannelDescriptors lists the descriptors for supported channel types. The use of descriptors makes it possible for new channel types to be dynamically added.
func ( *NotificationChannelClient) ( context.Context,  *monitoringpb.ListNotificationChannelDescriptorsRequest,  ...gax.CallOption) *NotificationChannelDescriptorIterator {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.ListNotificationChannelDescriptors[0:len(.CallOptions.ListNotificationChannelDescriptors):len(.CallOptions.ListNotificationChannelDescriptors)], ...)
	 := &NotificationChannelDescriptorIterator{}
	 = proto.Clone().(*monitoringpb.ListNotificationChannelDescriptorsRequest)
	.InternalFetch = func( int,  string) ([]*monitoringpb.NotificationChannelDescriptor, string, error) {
		var  *monitoringpb.ListNotificationChannelDescriptorsResponse
		.PageToken = 
		if  > math.MaxInt32 {
			.PageSize = math.MaxInt32
		} else {
			.PageSize = int32()
		}
		 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
			var  error
			,  = .notificationChannelClient.ListNotificationChannelDescriptors(, , .GRPC...)
			return 
		}, ...)
		if  != nil {
			return nil, "", 
		}

		.Response = 
		return .ChannelDescriptors, .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 
}
GetNotificationChannelDescriptor gets a single channel descriptor. The descriptor indicates which fields are expected / permitted for a notification channel of the given type.
ListNotificationChannels lists the notification channels that have been created for the project.
func ( *NotificationChannelClient) ( context.Context,  *monitoringpb.ListNotificationChannelsRequest,  ...gax.CallOption) *NotificationChannelIterator {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.ListNotificationChannels[0:len(.CallOptions.ListNotificationChannels):len(.CallOptions.ListNotificationChannels)], ...)
	 := &NotificationChannelIterator{}
	 = proto.Clone().(*monitoringpb.ListNotificationChannelsRequest)
	.InternalFetch = func( int,  string) ([]*monitoringpb.NotificationChannel, string, error) {
		var  *monitoringpb.ListNotificationChannelsResponse
		.PageToken = 
		if  > math.MaxInt32 {
			.PageSize = math.MaxInt32
		} else {
			.PageSize = int32()
		}
		 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
			var  error
			,  = .notificationChannelClient.ListNotificationChannels(, , .GRPC...)
			return 
		}, ...)
		if  != nil {
			return nil, "", 
		}

		.Response = 
		return .NotificationChannels, .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 
}
GetNotificationChannel gets a single notification channel. The channel includes the relevant configuration details with which the channel was created. However, the response may truncate or omit passwords, API keys, or other private key matter and thus the response may not be 100% identical to the information that was supplied in the call to the create method.
func ( *NotificationChannelClient) ( context.Context,  *monitoringpb.GetNotificationChannelRequest,  ...gax.CallOption) (*monitoringpb.NotificationChannel, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.GetNotificationChannel[0:len(.CallOptions.GetNotificationChannel):len(.CallOptions.GetNotificationChannel)], ...)
	var  *monitoringpb.NotificationChannel
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .notificationChannelClient.GetNotificationChannel(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
CreateNotificationChannel creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.
func ( *NotificationChannelClient) ( context.Context,  *monitoringpb.CreateNotificationChannelRequest,  ...gax.CallOption) (*monitoringpb.NotificationChannel, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.CreateNotificationChannel[0:len(.CallOptions.CreateNotificationChannel):len(.CallOptions.CreateNotificationChannel)], ...)
	var  *monitoringpb.NotificationChannel
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .notificationChannelClient.CreateNotificationChannel(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
UpdateNotificationChannel updates a notification channel. Fields not specified in the field mask remain unchanged.
func ( *NotificationChannelClient) ( context.Context,  *monitoringpb.UpdateNotificationChannelRequest,  ...gax.CallOption) (*monitoringpb.NotificationChannel, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "notification_channel.name", url.QueryEscape(.GetNotificationChannel().GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.UpdateNotificationChannel[0:len(.CallOptions.UpdateNotificationChannel):len(.CallOptions.UpdateNotificationChannel)], ...)
	var  *monitoringpb.NotificationChannel
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .notificationChannelClient.UpdateNotificationChannel(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
DeleteNotificationChannel deletes a notification channel.
func ( *NotificationChannelClient) ( context.Context,  *monitoringpb.DeleteNotificationChannelRequest,  ...gax.CallOption) error {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.DeleteNotificationChannel[0:len(.CallOptions.DeleteNotificationChannel):len(.CallOptions.DeleteNotificationChannel)], ...)
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		_,  = .notificationChannelClient.DeleteNotificationChannel(, , .GRPC...)
		return 
	}, ...)
	return 
}
SendNotificationChannelVerificationCode causes a verification code to be delivered to the channel. The code can then be supplied in VerifyNotificationChannel to verify the channel.
GetNotificationChannelVerificationCode requests a verification code for an already verified channel that can then be used in a call to VerifyNotificationChannel() on a different channel with an equivalent identity in the same or in a different project. This makes it possible to copy a channel between projects without requiring manual reverification of the channel. If the channel is not in the verified state, this method will fail (in other words, this may only be used if the SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been used to put the given channel into the verified state). There is no guarantee that the verification codes returned by this method will be of a similar structure or form as the ones that are delivered to the channel via SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both the codes delivered via SendNotificationChannelVerificationCode() and returned from GetNotificationChannelVerificationCode(), it is typically the case that the verification codes delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter expiration (e.g. codes such as “G-123456”) whereas GetVerificationCode() will typically return a much longer, websafe base 64 encoded string that has a longer expiration time.
VerifyNotificationChannel verifies a NotificationChannel by proving receipt of the code delivered to the channel as a result of calling SendNotificationChannelVerificationCode.
func ( *NotificationChannelClient) ( context.Context,  *monitoringpb.VerifyNotificationChannelRequest,  ...gax.CallOption) (*monitoringpb.NotificationChannel, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.VerifyNotificationChannel[0:len(.CallOptions.VerifyNotificationChannel):len(.CallOptions.VerifyNotificationChannel)], ...)
	var  *monitoringpb.NotificationChannel
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .notificationChannelClient.VerifyNotificationChannel(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
NotificationChannelDescriptorIterator manages a stream of *monitoringpb.NotificationChannelDescriptor.
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.NotificationChannelDescriptor, 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 ( *NotificationChannelDescriptorIterator) () (*monitoringpb.NotificationChannelDescriptor, error) {
	var  *monitoringpb.NotificationChannelDescriptor
	if  := .nextFunc();  != nil {
		return , 
	}
	 = .items[0]
	.items = .items[1:]
	return , nil
}

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

func ( *NotificationChannelDescriptorIterator) () interface{} {
	 := .items
	.items = nil
	return 
}
NotificationChannelIterator manages a stream of *monitoringpb.NotificationChannel.
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.NotificationChannel, 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 ( *NotificationChannelIterator) () (*monitoringpb.NotificationChannel, error) {
	var  *monitoringpb.NotificationChannel
	if  := .nextFunc();  != nil {
		return , 
	}
	 = .items[0]
	.items = .items[1:]
	return , nil
}

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

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