# Error Reporting V1beta1 API - Class Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client (v0.17.0)

0.17.0 (latest) 0.16.0 0.15.1 0.14.0 0.13.1 0.12.0 0.11.1 0.10.0 0.9.2 0.8.0 0.7.0 0.6.0 0.5.1 0.4.5 Reference documentation and code samples for the Error Reporting V1beta1 API class Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.

Client for the ReportErrorsService service.


<br />

An API for reporting error events.

## Inherits

- Object

## Includes

- [Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the ReportErrorsService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Client-Configuration "Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all ReportErrorsService clients
::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the ReportErrorsService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Client#Google__Cloud__ErrorReporting__V1beta1__ReportErrorsService__Client_configure_class_ "Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Client-Configuration "Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Client-Configuration))

### #initialize

    def initialize() { |config| ... } -> Client

Create a new ReportErrorsService client object.
**Yields**

- (config) --- Configure the ReportErrorsService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorsService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.new do |config|
  config.timeout = 10.0
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #report_error_event

    def report_error_event(request, options = nil) -> ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse
    def report_error_event(project_name: nil, event: nil) -> ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse

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

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

**Note:** [Error Reporting](https://cloud.google.com/error-reporting)
is a service built on Cloud Logging and can analyze log entries when all of
the following are true:

- Customer-managed encryption keys (CMEK) are disabled on the log bucket.
- The log bucket satisfies one of the following:
  - The log bucket is stored in the same project where the logs originated.
  - The logs were routed to a project, and then that project stored those logs in a log bucket that it owns.
**Overloads**

    def report_error_event(request, options = nil) -> ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse

Pass arguments to `report_error_event` via a request object, either of type [Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorEventRequest "Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorEventRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def report_error_event(project_name: nil, event: nil) -> ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse

Pass arguments to `report_error_event` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **project_name** (::String) --- Required. The resource name of the Google Cloud Platform project. Written as `projects/{projectId}`, where `{projectId}` is the [Google Cloud Platform project
  ID](https://support.google.com/cloud/answer/6158840).


  Example: // `projects/my-project-123`.
- **event** ([::Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportedErrorEvent), ::Hash) --- Required. The error event to be reported.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorEventResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-error_reporting-v1beta1/latest/Google-Cloud-ErrorReporting-V1beta1-ReportErrorEventResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/error_reporting/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest.new

# Call the report_error_event method.
result = client.report_error_event request

# The returned object is of type Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse.
p result
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)