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 newReportErrorsClientHook clientHook
ReportErrorsClient 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.
NewReportErrorsClient creates a new report errors service client. An API for reporting error events.
func ( context.Context,  ...option.ClientOption) (*ReportErrorsClient, error) {
	 := defaultReportErrorsClientOptions()

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

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

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

		reportErrorsClient: clouderrorreportingpb.NewReportErrorsServiceClient(),
	}
	.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 ( *ReportErrorsClient) () 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 ( *ReportErrorsClient) ( ...string) {
	 := append([]string{"gl-go", versionGo()}, ...)
	 = append(, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
	.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(...))
}
ReportErrorEvent report an individual error event. This endpoint accepts either an OAuth token, or an API key (at https://support.google.com/cloud/answer/6158862) for authentication. To use an API key, append it to the URL as the value of a key parameter. For example: POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456
func ( *ReportErrorsClient) ( context.Context,  *clouderrorreportingpb.ReportErrorEventRequest,  ...gax.CallOption) (*clouderrorreportingpb.ReportErrorEventResponse, 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.ReportErrorEvent[0:len(.CallOptions.ReportErrorEvent):len(.CallOptions.ReportErrorEvent)], ...)
	var  *clouderrorreportingpb.ReportErrorEventResponse
	 := gax.Invoke(, func( context.Context,  gax.CallSettings) error {
		var  error
		,  = .reportErrorsClient.ReportErrorEvent(, , .GRPC...)
		return 
	}, ...)
	if  != nil {
		return nil, 
	}
	return , nil