/// <summary>Snippet for ReportErrorEventAsync</summary>
        public async Task ReportErrorEventAsync_ResourceNames()
        {
            // Snippet: ReportErrorEventAsync(ProjectName, ReportedErrorEvent, CallSettings)
            // Additional: ReportErrorEventAsync(ProjectName, ReportedErrorEvent, CancellationToken)
            // Create client
            ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();

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

            // End snippet
        }
        public async Task ReportErrorEventAsync_RequestObject()
        {
            // Snippet: ReportErrorEventAsync(ReportErrorEventRequest,CallSettings)
            // Create client
            ReportErrorsServiceClient reportErrorsServiceClient = await ReportErrorsServiceClient.CreateAsync();

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

            // End snippet
        }
Esempio n. 3
0
 /// <summary>
 /// Creates an instance of <see cref="ErrorReportingExceptionFilter"/> using credentials as
 /// defined by <see cref="GoogleCredential.GetApplicationDefaultAsync"/>.
 /// </summary>
 /// <param name="projectId">The Google Cloud Platform project ID. Cannot be null.</param>
 /// <param name="serviceName">An identifier of the service, such as the name of the executable or job.
 ///     Cannot be null.</param>
 /// <param name="version">Represents the source code version that the developer provided. Cannot be null.</param>
 public static ErrorReportingExceptionFilter Create(string projectId, string serviceName, string version) =>
 new ErrorReportingExceptionFilter(ReportErrorsServiceClient.CreateAsync(), projectId, serviceName, version);