Ruby Client for the Eventarc V1 API

Build event-driven applications on Google Cloud Platform.

Eventarc lets you asynchronously deliver events from Google services, SaaS, and your own apps using loosely coupled services that react to state changes. Eventarc requires no infrastructure management — you can optimize productivity and costs while building a modern, event-driven solution.

https://github.com/googleapis/google-cloud-ruby

This gem is aversioned client. It provides basic client classes for aspecific version of the Eventarc V1 API. Most users should consider usingthe main client gem,google-cloud-eventarc.See the section below titledWhich client should I use? for more information.

Installation

$ gem install google-cloud-eventarc-v1

Before You Begin

In order to use this library, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the API.
  4. Set up authentication.

Quick Start

require"google/cloud/eventarc/v1"client=::Google::Cloud::Eventarc::V1::Eventarc::Client.newrequest=::Google::Cloud::Eventarc::V1::GetTriggerRequest.new# (request fields as keyword arguments...)response=client.get_triggerrequest

View theClient Library Documentationfor class and method documentation.

See also theProduct Documentationfor general usage information.

Debug Logging

This library comes with opt-in Debug Logging that can help you troubleshootyour application's integration with the API. When logging is activated, keyevents such as requests and responses, along with data payloads and metadatasuch as headers and client configuration, are logged to the standard errorstream.

WARNING: Client Library Debug Logging includes your data payloads inplaintext, which could include sensitive data such as PII for yourself or yourcustomers, private keys, or other security data that could be compromising ifleaked. Always practice good data hygiene with your application logs, and followthe principle of least access. Google also recommends that Client Library DebugLogging be enabled only temporarily during active debugging, and not usedpermanently in production.

To enable logging, set the environment variableGOOGLE_SDK_RUBY_LOGGING_GEMSto the valueall. Alternatively, you can set the value to a comma-delimitedlist of client library gem names. This will select the default logging behavior,which writes logs to the standard error stream. On a local workstation, this mayresult in logs appearing on the console. When running on a Google Cloud hostingservice such asGoogle Cloud Run, this generallyresults in logs appearing alongside your application logs in theGoogle Cloud Logging service.

You can customize logging by modifying thelogger configuration whenconstructing a client object. For example:

require"google/cloud/eventarc/v1"require"logger"client=::Google::Cloud::Eventarc::V1::Eventarc::Client.newdo|config|config.logger=Logger.new"my-app.log"end

Google Cloud Samples

To browse ready to use code samples checkGoogle Cloud Samples.

Supported Ruby Versions

This library is supported on Ruby 3.0+.

Google provides official support for Ruby versions that are actively supportedby Ruby Core—that is, Ruby versions that are either in normal maintenance orin security maintenance, and not end of life. Older versions of Rubymaystill work, but are unsupported and not recommended. Seehttps://www.ruby-lang.org/en/downloads/branches/ for details about the Rubysupport schedule.

Which client should I use?

Most modern Ruby client libraries for Google APIs come in two flavors: the mainclient library with a name such asgoogle-cloud-eventarc,and lower-levelversioned client libraries with names such asgoogle-cloud-eventarc-v1.In most cases, you should install the main client.

What's the difference between the main client and a versioned client?

Aversioned client provides a basic set of data types and client classes forasingle version of a specific service. (That is, for a service with multipleversions, there might be a separate versioned client for each service version.)Most versioned clients are written and maintained by a code generator.

Themain client is designed to provide you with therecommended clientinterfaces for the service. There will be only one main client for any givenservice, even a service with multiple versions. The main client includesfactory methods for constructing the client objects we recommend for mostusers. In some cases, those will be classes provided by an underlying versionedclient; in other cases, they will be handwritten higher-level client objectswith additional capabilities, convenience methods, or best practices built in.Generally, the main client will default to a recommended service version,although in some cases you can override this if you need to talk to a specificservice version.

Why would I want to use the main client?

We recommend that most users install the main client gem for a service. You canidentify this gem as the onewithout a version in its name, e.g.google-cloud-eventarc.The main client is recommended because it will embody the best practices foraccessing the service, and may also provide more convenient interfaces ortighter integration into frameworks and third-party libraries. In addition, thedocumentation and samples published by Google will generally demonstrate use ofthe main client.

Why would I want to use a versioned client?

You can use a versioned client if you are content with a possibly lower-levelclass interface, you explicitly want to avoid features provided by the mainclient, or you want to access a specific service version not be covered by themain client. You can identify versioned client gems because the service versionis part of the name, e.g.google-cloud-eventarc-v1.

What about the google-apis-

Client library gems with names that begin withgoogle-apis- are based on anolder code generation technology. They talk to a REST/JSON backend (whereasmost modern clients talk to agRPC backend) and they maynot offer the same performance, features, and ease of use provided by moremodern clients.

Thegoogle-apis- clients have wide coverage across Google services, so youmight need to use one if there is no modern client available for the service.However, if a modern client is available, we generally recommend it over theoldergoogle-apis- clients.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.