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 errorreporting

import (
	
	
	
	
	

	
	gax 
	
	
	gtransport 
	clouderrorreportingpb 
	
	
	
)

var newErrorStatsClientHook clientHook
ErrorStatsClient is a client for interacting with Stackdriver Error Reporting 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.
flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
The call options for this service.
The x-goog-* metadata to be sent with each request.
NewErrorStatsClient creates a new error stats service client. An API for retrieving and managing error statistics as well as data for individual events.
func ( context.Context,  ...option.ClientOption) (*ErrorStatsClient, error) {
	 := defaultErrorStatsClientOptions()

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

	,  := checkDisableDeadlines()
	if  != nil {
		return nil, 
	}

	,  := gtransport.DialPool(, append(, ...)...)
	if  != nil {
		return nil, 
	}
	 := &ErrorStatsClient{
		connPool:         ,
		disableDeadlines: ,
		CallOptions:      defaultErrorStatsCallOptions(),

		errorStatsClient: clouderrorreportingpb.NewErrorStatsServiceClient(),
	}
	.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 ( *ErrorStatsClient) () 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 ( *ErrorStatsClient) ( ...string) {
	 := append([]string{"gl-go", versionGo()}, ...)
	 = append(, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
	.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(...))
}
ListGroupStats lists the specified groups.
func ( *ErrorStatsClient) ( context.Context,  *clouderrorreportingpb.ListGroupStatsRequest,  ...gax.CallOption) *ErrorGroupStatsIterator {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_name", url.QueryEscape(.GetProjectName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.ListGroupStats[0:len(.CallOptions.ListGroupStats):len(.CallOptions.ListGroupStats)], ...)
	 := &ErrorGroupStatsIterator{}
	 = proto.Clone().(*clouderrorreportingpb.ListGroupStatsRequest)
	.InternalFetch = func( int,  string) ([]*clouderrorreportingpb.ErrorGroupStats, string, error) {
		var  *clouderrorreportingpb.ListGroupStatsResponse
		.PageToken = 
		if  > math.MaxInt32 {
			.PageSize = math.MaxInt32
		} else {
			.PageSize = int32()
		}
		 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
			var  error
			,  = .errorStatsClient.ListGroupStats(, , .GRPC...)
			return 
		}, ...)
		if  != nil {
			return nil, "", 
		}

		.Response = 
		return .GetErrorGroupStats(), .GetNextPageToken(), nil
	}
	 := func( int,  string) (string, error) {
		, ,  := .InternalFetch(, )
		if  != nil {
			return "", 
		}
		.items = append(.items, ...)
		return , nil
	}
	.pageInfo, .nextFunc = iterator.NewPageInfo(, .bufLen, .takeBuf)
	.pageInfo.MaxSize = int(.GetPageSize())
	.pageInfo.Token = .GetPageToken()
	return 
}
ListEvents lists the specified events.
func ( *ErrorStatsClient) ( context.Context,  *clouderrorreportingpb.ListEventsRequest,  ...gax.CallOption) *ErrorEventIterator {
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_name", url.QueryEscape(.GetProjectName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.ListEvents[0:len(.CallOptions.ListEvents):len(.CallOptions.ListEvents)], ...)
	 := &ErrorEventIterator{}
	 = proto.Clone().(*clouderrorreportingpb.ListEventsRequest)
	.InternalFetch = func( int,  string) ([]*clouderrorreportingpb.ErrorEvent, string, error) {
		var  *clouderrorreportingpb.ListEventsResponse
		.PageToken = 
		if  > math.MaxInt32 {
			.PageSize = math.MaxInt32
		} else {
			.PageSize = int32()
		}
		 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
			var  error
			,  = .errorStatsClient.ListEvents(, , .GRPC...)
			return 
		}, ...)
		if  != nil {
			return nil, "", 
		}

		.Response = 
		return .GetErrorEvents(), .GetNextPageToken(), nil
	}
	 := func( int,  string) (string, error) {
		, ,  := .InternalFetch(, )
		if  != nil {
			return "", 
		}
		.items = append(.items, ...)
		return , nil
	}
	.pageInfo, .nextFunc = iterator.NewPageInfo(, .bufLen, .takeBuf)
	.pageInfo.MaxSize = int(.GetPageSize())
	.pageInfo.Token = .GetPageToken()
	return 
}
DeleteEvents deletes all error events of a given project.
func ( *ErrorStatsClient) ( context.Context,  *clouderrorreportingpb.DeleteEventsRequest,  ...gax.CallOption) (*clouderrorreportingpb.DeleteEventsResponse, error) {
	if ,  := .Deadline(); ! && !.disableDeadlines {
		,  := context.WithTimeout(, 600000*time.Millisecond)
		defer ()
		 = 
	}
	 := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "project_name", url.QueryEscape(.GetProjectName())))
	 = insertMetadata(, .xGoogMetadata, )
	 = append(.CallOptions.DeleteEvents[0:len(.CallOptions.DeleteEvents):len(.CallOptions.DeleteEvents)], ...)
	var  *clouderrorreportingpb.DeleteEventsResponse
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .errorStatsClient.DeleteEvents(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil
}
ErrorEventIterator manages a stream of *clouderrorreportingpb.ErrorEvent.
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 []*clouderrorreportingpb.ErrorEvent, 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 ( *ErrorEventIterator) () (*clouderrorreportingpb.ErrorEvent, error) {
	var  *clouderrorreportingpb.ErrorEvent
	if  := .nextFunc();  != nil {
		return , 
	}
	 = .items[0]
	.items = .items[1:]
	return , nil
}

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

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

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

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