Class ReportErrorsServiceClient (2.0.0-beta05)

public abstract class ReportErrorsServiceClient

ReportErrorsService client wrapper, for convenient use.

Inheritance

Object > ReportErrorsServiceClient

Namespace

Google.Cloud.ErrorReporting.V1Beta1

Assembly

Google.Cloud.ErrorReporting.V1Beta1.dll

Remarks

An API for reporting error events.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ReportErrorsService service, which is a host of "clouderrorreporting.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ReportErrorsService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default ReportErrorsService scopes are:

GrpcClient

public virtual ReportErrorsService.ReportErrorsServiceClient GrpcClient { get; }

The underlying gRPC ReportErrorsService client

Property Value
TypeDescription
ReportErrorsService.ReportErrorsServiceClient

Methods

Create()

public static ReportErrorsServiceClient Create()

Synchronously creates a ReportErrorsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ReportErrorsServiceClientBuilder.

Returns
TypeDescription
ReportErrorsServiceClient

The created ReportErrorsServiceClient.

CreateAsync(CancellationToken)

public static Task<ReportErrorsServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a ReportErrorsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ReportErrorsServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ReportErrorsServiceClient>

The task representing the created ReportErrorsServiceClient.

ReportErrorEvent(ProjectName, ReportedErrorEvent, CallSettings)

public virtual ReportErrorEventResponse ReportErrorEvent(ProjectName projectName, ReportedErrorEvent event, CallSettings callSettings = null)

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key 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/{projectName}/events:report?key=123ABC456

Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

For more information, see Using Error Reporting with regionalized logs.

Parameters
NameDescription
projectNameProjectName

Required. The resource name of the Google Cloud Platform project. Written as projects/{projectId}, where {projectId} is the Google Cloud Platform project ID.

Example: // projects/my-project-123.

eventReportedErrorEvent

Required. The error event to be reported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReportErrorEventResponse

The RPC response.

Example
ReportErrorsServiceClient client = ReportErrorsServiceClient.Create();
ProjectName projectName = new ProjectName(projectId);
ReportedErrorEvent error = new ReportedErrorEvent
{
    Context = new ErrorContext
    {
        ReportLocation = new SourceLocation
        {
            FilePath = "SampleApp.BusinessLogic/ComplexLogic.cs",
            FunctionName = "ComputeTrickyAnswer",
            LineNumber = 100
        },
        User = "userid"                    
    },

    // If this is a stack trace, the service will parse it.
    Message = "Computation failed",

    EventTime = Timestamp.FromDateTime(DateTime.UtcNow),
    ServiceContext = new ServiceContext
    {
        Service = "SampleApp",
        Version = "1.0.0"
    }
};
client.ReportErrorEvent(projectName, error);

ReportErrorEvent(ReportErrorEventRequest, CallSettings)

public virtual ReportErrorEventResponse ReportErrorEvent(ReportErrorEventRequest request, CallSettings callSettings = null)

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key 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/{projectName}/events:report?key=123ABC456

Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

For more information, see Using Error Reporting with regionalized logs.

Parameters
NameDescription
requestReportErrorEventRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReportErrorEventResponse

The RPC response.

Example
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = ReportErrorsServiceClient.Create();
// Initialize request argument(s)
ReportErrorEventRequest request = new ReportErrorEventRequest
{
    ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Event = new ReportedErrorEvent(),
};
// Make the request
ReportErrorEventResponse response = reportErrorsServiceClient.ReportErrorEvent(request);

ReportErrorEvent(String, ReportedErrorEvent, CallSettings)

public virtual ReportErrorEventResponse ReportErrorEvent(string projectName, ReportedErrorEvent event, CallSettings callSettings = null)

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key 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/{projectName}/events:report?key=123ABC456

Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

For more information, see Using Error Reporting with regionalized logs.

Parameters
NameDescription
projectNameString

Required. The resource name of the Google Cloud Platform project. Written as projects/{projectId}, where {projectId} is the Google Cloud Platform project ID.

Example: // projects/my-project-123.

eventReportedErrorEvent

Required. The error event to be reported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReportErrorEventResponse

The RPC response.

Example
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = ReportErrorsServiceClient.Create();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = reportErrorsServiceClient.ReportErrorEvent(projectName, @event);

ReportErrorEventAsync(ProjectName, ReportedErrorEvent, CallSettings)

public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(ProjectName projectName, ReportedErrorEvent event, CallSettings callSettings = null)

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key 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/{projectName}/events:report?key=123ABC456

Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

For more information, see Using Error Reporting with regionalized logs.

Parameters
NameDescription
projectNameProjectName

Required. The resource name of the Google Cloud Platform project. Written as projects/{projectId}, where {projectId} is the Google Cloud Platform project ID.

Example: // projects/my-project-123.

eventReportedErrorEvent

Required. The error event to be reported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReportErrorEventResponse>

A Task containing the RPC response.

Example
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(projectName, @event);

ReportErrorEventAsync(ProjectName, ReportedErrorEvent, CancellationToken)

public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(ProjectName projectName, ReportedErrorEvent event, CancellationToken cancellationToken)

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key 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/{projectName}/events:report?key=123ABC456

Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

For more information, see Using Error Reporting with regionalized logs.

Parameters
NameDescription
projectNameProjectName

Required. The resource name of the Google Cloud Platform project. Written as projects/{projectId}, where {projectId} is the Google Cloud Platform project ID.

Example: // projects/my-project-123.

eventReportedErrorEvent

Required. The error event to be reported.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReportErrorEventResponse>

A Task containing the RPC response.

Example
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName projectName = ProjectName.FromProject("[PROJECT]");
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(projectName, @event);

ReportErrorEventAsync(ReportErrorEventRequest, CallSettings)

public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(ReportErrorEventRequest request, CallSettings callSettings = null)

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key 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/{projectName}/events:report?key=123ABC456

Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

For more information, see Using Error Reporting with regionalized logs.

Parameters
NameDescription
requestReportErrorEventRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReportErrorEventResponse>

A Task containing the RPC response.

Example
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
ReportErrorEventRequest request = new ReportErrorEventRequest
{
    ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Event = new ReportedErrorEvent(),
};
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(request);

ReportErrorEventAsync(ReportErrorEventRequest, CancellationToken)

public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(ReportErrorEventRequest request, CancellationToken cancellationToken)

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key 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/{projectName}/events:report?key=123ABC456

Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

For more information, see Using Error Reporting with regionalized logs.

Parameters
NameDescription
requestReportErrorEventRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReportErrorEventResponse>

A Task containing the RPC response.

Example
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
ReportErrorEventRequest request = new ReportErrorEventRequest
{
    ProjectNameAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Event = new ReportedErrorEvent(),
};
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(request);

ReportErrorEventAsync(String, ReportedErrorEvent, CallSettings)

public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(string projectName, ReportedErrorEvent event, CallSettings callSettings = null)

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key 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/{projectName}/events:report?key=123ABC456

Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

For more information, see Using Error Reporting with regionalized logs.

Parameters
NameDescription
projectNameString

Required. The resource name of the Google Cloud Platform project. Written as projects/{projectId}, where {projectId} is the Google Cloud Platform project ID.

Example: // projects/my-project-123.

eventReportedErrorEvent

Required. The error event to be reported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReportErrorEventResponse>

A Task containing the RPC response.

Example
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(projectName, @event);

ReportErrorEventAsync(String, ReportedErrorEvent, CancellationToken)

public virtual Task<ReportErrorEventResponse> ReportErrorEventAsync(string projectName, ReportedErrorEvent event, CancellationToken cancellationToken)

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key 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/{projectName}/events:report?key=123ABC456

Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

For more information, see Using Error Reporting with regionalized logs.

Parameters
NameDescription
projectNameString

Required. The resource name of the Google Cloud Platform project. Written as projects/{projectId}, where {projectId} is the Google Cloud Platform project ID.

Example: // projects/my-project-123.

eventReportedErrorEvent

Required. The error event to be reported.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReportErrorEventResponse>

A Task containing the RPC response.

Example
// Create client
ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();
// Initialize request argument(s)
string projectName = "projects/[PROJECT]";
ReportedErrorEvent @event = new ReportedErrorEvent();
// Make the request
ReportErrorEventResponse response = await reportErrorsServiceClient.ReportErrorEventAsync(projectName, @event);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.