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 
	monitoredrespb 
	monitoringpb 
	
	
	
)

var newGroupClientHook clientHook
GroupCallOptions contains the retry settings for each method of GroupClient.
type GroupCallOptions struct {
	ListGroups       []gax.CallOption
	GetGroup         []gax.CallOption
	CreateGroup      []gax.CallOption
	UpdateGroup      []gax.CallOption
	DeleteGroup      []gax.CallOption
	ListGroupMembers []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 () *GroupCallOptions {
	return &GroupCallOptions{
		ListGroups: []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,
				})
			}),
		},
		GetGroup: []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,
				})
			}),
		},
		CreateGroup: []gax.CallOption{},
		UpdateGroup: []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,
				})
			}),
		},
		DeleteGroup: []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,
				})
			}),
		},
		ListGroupMembers: []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,
				})
			}),
		},
	}
}
GroupClient 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.
NewGroupClient creates a new group service client. The Group API lets you inspect and manage your groups (at #google.monitoring.v3.Group). A group is a named filter that is used to identify a collection of monitored resources. Groups are typically used to mirror the physical and/or logical topology of the environment. Because group membership is computed dynamically, monitored resources that are started in the future are automatically placed in matching groups. By using a group to name monitored resources in, for example, an alert policy, the target of that alert policy is updated automatically as monitored resources are added and removed from the infrastructure.
func ( context.Context,  ...option.ClientOption) (*GroupClient, error) {
	 := defaultGroupClientOptions()

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

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

		groupClient: monitoringpb.NewGroupServiceClient(),
	}
	.setGoogleClientInfo()

	return , nil
}
Connection returns a connection to the API service. Deprecated.
func ( *GroupClient) () *grpc.ClientConn {
	return .connPool.Conn()
}
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func ( *GroupClient) () 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 ( *GroupClient) ( ...string) {
	 := append([]string{"gl-go", versionGo()}, ...)
	 = append(, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
	.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(...))
}
ListGroups lists the existing groups.
func ( *GroupClient) ( context.Context,  *monitoringpb.ListGroupsRequest,  ...gax.CallOption) *GroupIterator {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.ListGroups[0:len(.CallOptions.ListGroups):len(.CallOptions.ListGroups)], ...)
	 := &GroupIterator{}
	 = proto.Clone().(*monitoringpb.ListGroupsRequest)
	.InternalFetch = func( int,  string) ([]*monitoringpb.Group, string, error) {
		var  *monitoringpb.ListGroupsResponse
		.PageToken = 
		if  > math.MaxInt32 {
			.PageSize = math.MaxInt32
		} else {
			.PageSize = int32()
		}
		 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
			var  error
			,  = .groupClient.ListGroups(, , .GRPC...)
			return 
		}, ...)
		if  != nil {
			return nil, "", 
		}

		.Response = 
		return .Group, .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 
}
GetGroup gets a single group.
func ( *GroupClient) ( context.Context,  *monitoringpb.GetGroupRequest,  ...gax.CallOption) (*monitoringpb.Group, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.GetGroup[0:len(.CallOptions.GetGroup):len(.CallOptions.GetGroup)], ...)
	var  *monitoringpb.Group
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .groupClient.GetGroup(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
CreateGroup creates a new group.
func ( *GroupClient) ( context.Context,  *monitoringpb.CreateGroupRequest,  ...gax.CallOption) (*monitoringpb.Group, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.CreateGroup[0:len(.CallOptions.CreateGroup):len(.CallOptions.CreateGroup)], ...)
	var  *monitoringpb.Group
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .groupClient.CreateGroup(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
UpdateGroup updates an existing group. You can change any group attributes except name.
func ( *GroupClient) ( context.Context,  *monitoringpb.UpdateGroupRequest,  ...gax.CallOption) (*monitoringpb.Group, error) {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "group.name", url.QueryEscape(.GetGroup().GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.UpdateGroup[0:len(.CallOptions.UpdateGroup):len(.CallOptions.UpdateGroup)], ...)
	var  *monitoringpb.Group
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .groupClient.UpdateGroup(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
DeleteGroup deletes an existing group.
func ( *GroupClient) ( context.Context,  *monitoringpb.DeleteGroupRequest,  ...gax.CallOption) error {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.DeleteGroup[0:len(.CallOptions.DeleteGroup):len(.CallOptions.DeleteGroup)], ...)
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		_,  = .groupClient.DeleteGroup(, , .GRPC...)
		return 
	}, ...)
	return 
}
ListGroupMembers lists the monitored resources that are members of a group.
func ( *GroupClient) ( context.Context,  *monitoringpb.ListGroupMembersRequest,  ...gax.CallOption) *MonitoredResourceIterator {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(.GetName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.ListGroupMembers[0:len(.CallOptions.ListGroupMembers):len(.CallOptions.ListGroupMembers)], ...)
	 := &MonitoredResourceIterator{}
	 = proto.Clone().(*monitoringpb.ListGroupMembersRequest)
	.InternalFetch = func( int,  string) ([]*monitoredrespb.MonitoredResource, string, error) {
		var  *monitoringpb.ListGroupMembersResponse
		.PageToken = 
		if  > math.MaxInt32 {
			.PageSize = math.MaxInt32
		} else {
			.PageSize = int32()
		}
		 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
			var  error
			,  = .groupClient.ListGroupMembers(, , .GRPC...)
			return 
		}, ...)
		if  != nil {
			return nil, "", 
		}

		.Response = 
		return .Members, .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 
}
GroupIterator manages a stream of *monitoringpb.Group.
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.Group, nextPageToken string, err error)
}
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func ( *GroupIterator) () *iterator.PageInfo {
	return .pageInfo
}
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 ( *GroupIterator) () (*monitoringpb.Group, error) {
	var  *monitoringpb.Group
	if  := .nextFunc();  != nil {
		return , 
	}
	 = .items[0]
	.items = .items[1:]
	return , nil
}

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

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

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

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