/** * * * <pre> * Service contexts with a non-zero error count for the given filter * criteria. This list can be truncated if multiple services are affected. * Refer to `num_affected_services` for the total count. * </pre> * * <code> * repeated .google.devtools.clouderrorreporting.v1beta1.ServiceContext affected_services = 7; * </code> */ public Builder addAffectedServices( int index, com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (affectedServicesBuilder_ == null) { ensureAffectedServicesIsMutable(); affectedServices_.add(index, builderForValue.build()); onChanged(); } else { affectedServicesBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Service contexts with a non-zero error count for the given filter * criteria. This list can be truncated if multiple services are affected. * Refer to `num_affected_services` for the total count. * </pre> * * <code> * repeated .google.devtools.clouderrorreporting.v1beta1.ServiceContext affected_services = 7; * </code> */ public Builder addAffectedServices( com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (affectedServicesBuilder_ == null) { ensureAffectedServicesIsMutable(); affectedServices_.add(builderForValue.build()); onChanged(); } else { affectedServicesBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * Service contexts with a non-zero error count for the given filter * criteria. This list can be truncated if multiple services are affected. * Refer to `num_affected_services` for the total count. * </pre> * * <code> * repeated .google.devtools.clouderrorreporting.v1beta1.ServiceContext affected_services = 7; * </code> */ public Builder setAffectedServices( int index, com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (affectedServicesBuilder_ == null) { ensureAffectedServicesIsMutable(); affectedServices_.set(index, builderForValue.build()); onChanged(); } else { affectedServicesBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Service contexts with a non-zero error count for the given filter * criteria. This list can be truncated if multiple services are affected. * Refer to `num_affected_services` for the total count. * </pre> * * <code> * repeated .google.devtools.clouderrorreporting.v1beta1.ServiceContext affected_services = 7; * </code> */ public Builder setAffectedServices( int index, com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (affectedServicesBuilder_ == null) { ensureAffectedServicesIsMutable(); affectedServices_.set(index, builderForValue.build()); onChanged(); } else { affectedServicesBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Service contexts with a non-zero error count for the given filter * criteria. This list can be truncated if multiple services are affected. * Refer to `num_affected_services` for the total count. * </pre> * * <code> * repeated .google.devtools.clouderrorreporting.v1beta1.ServiceContext affected_services = 7; * </code> */ public Builder addAffectedServices( int index, com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (affectedServicesBuilder_ == null) { ensureAffectedServicesIsMutable(); affectedServices_.add(index, builderForValue.build()); onChanged(); } else { affectedServicesBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Service contexts with a non-zero error count for the given filter * criteria. This list can be truncated if multiple services are affected. * Refer to `num_affected_services` for the total count. * </pre> * * <code> * repeated .google.devtools.clouderrorreporting.v1beta1.ServiceContext affected_services = 7; * </code> */ public Builder addAffectedServices( com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (affectedServicesBuilder_ == null) { ensureAffectedServicesIsMutable(); affectedServices_.add(builderForValue.build()); onChanged(); } else { affectedServicesBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * The `ServiceContext` for which this error was reported. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.ServiceContext service_context = 2;</code> */ public Builder setServiceContext( com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (serviceContextBuilder_ == null) { serviceContext_ = builderForValue.build(); onChanged(); } else { serviceContextBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * [Required] The service context in which this error has occurred. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.ServiceContext service_context = 2;</code> */ public Builder setServiceContext( com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (serviceContextBuilder_ == null) { serviceContext_ = builderForValue.build(); onChanged(); } else { serviceContextBuilder_.setMessage(builderForValue.build()); } return this; } /**
public static void executeNoCatch(String projectId) throws Exception { try (ReportErrorsServiceClient client = ReportErrorsServiceClient.create()) { ProjectName projectName = ProjectName.of(projectId); String message = "[MESSAGE]"; String service = "[SERVICE]"; ServiceContext serviceContext = ServiceContext.newBuilder().setService(service).build(); String filePath = "path/to/file.lang"; int lineNumber = 42; String functionName = "meaningOfLife"; SourceLocation reportLocation = SourceLocation.newBuilder() .setFilePath(filePath) .setLineNumber(lineNumber) .setFunctionName(functionName) .build(); ErrorContext context = ErrorContext.newBuilder().setReportLocation(reportLocation).build(); ReportedErrorEvent event = ReportedErrorEvent.newBuilder() .setMessage(message) .setServiceContext(serviceContext) .setContext(context) .build(); ReportErrorEventResponse response = client.reportErrorEvent(projectName, event); } }
/** * * * <pre> * The `ServiceContext` for which this error was reported. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.ServiceContext service_context = 2;</code> */ public Builder setServiceContext( com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (serviceContextBuilder_ == null) { serviceContext_ = builderForValue.build(); onChanged(); } else { serviceContextBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * [Required] The service context in which this error has occurred. * </pre> * * <code>.google.devtools.clouderrorreporting.v1beta1.ServiceContext service_context = 2;</code> */ public Builder setServiceContext( com.google.devtools.clouderrorreporting.v1beta1.ServiceContext.Builder builderForValue) { if (serviceContextBuilder_ == null) { serviceContext_ = builderForValue.build(); onChanged(); } else { serviceContextBuilder_.setMessage(builderForValue.build()); } return this; } /**