Skip to content

Commit

Permalink
Merge branch 'master' into grant_gen_postgen_refs
Browse files Browse the repository at this point in the history
  • Loading branch information
grant authored Nov 4, 2020
2 parents 63da610 + 083e313 commit 3167ddf
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 19 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ may change. Even the core `cloud_event_type` annotation may change.

This repository contains definitions for the following CloudEvents:

|Package|Event types|Data messages|
|-|-|-|
|[google.events.cloud.audit.v1](proto/google/events/cloud/audit/v1)|google.cloud.audit.log.v1.written|LogEntryData|
|[google.events.cloud.cloudbuild.v1](proto/google/events/cloud/cloudbuild/v1)|google.cloud.cloudbuild.build.v1.statusChanged|BuildEventData|
|[google.events.cloud.firestore.v1](proto/google/events/cloud/firestore/v1)|google.cloud.firestore.document.v1.created<br/>google.cloud.firestore.document.v1.deleted<br/>google.cloud.firestore.document.v1.updated<br/>google.cloud.firestore.document.v1.written|DocumentEventData|
|[google.events.cloud.pubsub.v1](proto/google/events/cloud/pubsub/v1)|google.cloud.pubsub.topic.v1.messagePublished|MessagePublishedData|
|[google.events.cloud.scheduler.v1](proto/google/events/cloud/scheduler/v1)|google.cloud.scheduler.job.v1.executed|SchedulerJobData|
|[google.events.cloud.storage.v1](proto/google/events/cloud/storage/v1)|google.cloud.storage.object.v1.archived<br/>google.cloud.storage.object.v1.deleted<br/>google.cloud.storage.object.v1.finalized<br/>google.cloud.storage.object.v1.metadataUpdated|StorageObjectData|
|[google.events.firebase.analytics.v1](proto/google/events/firebase/analytics/v1)|google.firebase.analytics.log.v1.written|AnalyticsLogData|
|[google.events.firebase.auth.v1](proto/google/events/firebase/auth/v1)|google.firebase.auth.user.v1.created<br/>google.firebase.auth.user.v1.deleted|AuthEventData|
|[google.events.firebase.database.v1](proto/google/events/firebase/database/v1)|google.firebase.database.ref.v1.created<br/>google.firebase.database.ref.v1.deleted<br/>google.firebase.database.ref.v1.updated<br/>google.firebase.database.ref.v1.written|ReferenceEventData|
|[google.events.firebase.remoteconfig.v1](proto/google/events/firebase/remoteconfig/v1)|google.firebase.remoteconfig.remoteConfig.v1.updated|RemoteConfigEventData|
|Product|Package|Event types|Data messages|
|-|-|-|-|
|Cloud Audit Logs|[google.events.cloud.audit.v1](proto/google/events/cloud/audit/v1)|google.cloud.audit.log.v1.written|LogEntryData|
|Cloud Build|[google.events.cloud.cloudbuild.v1](proto/google/events/cloud/cloudbuild/v1)|google.cloud.cloudbuild.build.v1.statusChanged|BuildEventData|
|Cloud Firestore|[google.events.cloud.firestore.v1](proto/google/events/cloud/firestore/v1)|google.cloud.firestore.document.v1.created<br/>google.cloud.firestore.document.v1.deleted<br/>google.cloud.firestore.document.v1.updated<br/>google.cloud.firestore.document.v1.written|DocumentEventData|
|Cloud Pub/Sub|[google.events.cloud.pubsub.v1](proto/google/events/cloud/pubsub/v1)|google.cloud.pubsub.topic.v1.messagePublished|MessagePublishedData|
|Cloud Scheduler|[google.events.cloud.scheduler.v1](proto/google/events/cloud/scheduler/v1)|google.cloud.scheduler.job.v1.executed|SchedulerJobData|
|Cloud Storage|[google.events.cloud.storage.v1](proto/google/events/cloud/storage/v1)|google.cloud.storage.object.v1.archived<br/>google.cloud.storage.object.v1.deleted<br/>google.cloud.storage.object.v1.finalized<br/>google.cloud.storage.object.v1.metadataUpdated|StorageObjectData|
|Google Analytics for Firebase|[google.events.firebase.analytics.v1](proto/google/events/firebase/analytics/v1)|google.firebase.analytics.log.v1.written|AnalyticsLogData|
|Firebase Authentication|[google.events.firebase.auth.v1](proto/google/events/firebase/auth/v1)|google.firebase.auth.user.v1.created<br/>google.firebase.auth.user.v1.deleted|AuthEventData|
|Firebase Realtime Database|[google.events.firebase.database.v1](proto/google/events/firebase/database/v1)|google.firebase.database.ref.v1.created<br/>google.firebase.database.ref.v1.deleted<br/>google.firebase.database.ref.v1.updated<br/>google.firebase.database.ref.v1.written|ReferenceEventData|
|Firebase Remote Config|[google.events.firebase.remoteconfig.v1](proto/google/events/firebase/remoteconfig/v1)|google.firebase.remoteconfig.remoteConfig.v1.updated|RemoteConfigEventData|

## CloudEvent Type Repos

Expand Down
4 changes: 2 additions & 2 deletions tools/quicktype-wrapper/src/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -26,7 +26,7 @@ ${C} Licensed under the Apache License, Version 2.0 (the "License");
${C} you may not use this file except in compliance with the License.
${C} You may obtain a copy of the License at
${C}
${C} http://www.apache.org/licenses/LICENSE-2.0
${C} https://www.apache.org/licenses/LICENSE-2.0
${C}
${C} Unless required by applicable law or agreed to in writing, software
${C} distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
46 changes: 41 additions & 5 deletions tools/registry/Google.Events.Tools.GenerateRegistry/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal static class Program
/// The Markdown header for the table at the start of the event registry. This string is used
/// to find the table within the README.
/// </summary>
private const string TableHeader = "|Package|Event types|Data messages|";
private const string TableHeader = "|Product|Package|Event types|Data messages|";

/// <summary>
/// The line between the table header and the table content. This is the same number of | characters
Expand Down Expand Up @@ -158,6 +158,39 @@ static IEnumerable<TableRow> CreateTableRows(string descriptorFile)
/// </summary>
class TableRow
{
/// <summary>
/// The product represented in this row.
/// </summary>
public string Product {
get {
switch (Package)
{
case "google.events.cloud.audit.v1":
return "Cloud Audit Logs";
case "google.events.cloud.cloudbuild.v1":
return "Cloud Build";
case "google.events.cloud.firestore.v1":
return "Cloud Firestore";
case "google.events.cloud.pubsub.v1":
return "Cloud Pub/Sub";
case "google.events.cloud.scheduler.v1":
return "Cloud Scheduler";
case "google.events.cloud.storage.v1":
return "Cloud Storage";
case "google.events.firebase.analytics.v1":
return "Google Analytics for Firebase";
case "google.events.firebase.auth.v1":
return "Firebase Authentication";
case "google.events.firebase.database.v1":
return "Firebase Realtime Database";
case "google.events.firebase.remoteconfig.v1":
return "Firebase Remote Config";
default:
throw new ArgumentException("Unknown product. Please add corresponding product name.");
}
}
}

/// <summary>
/// The protobuf package represented in this row.
/// </summary>
Expand All @@ -183,17 +216,20 @@ public TableRow(string package) =>
/// </summary>
public string ToMarkdown()
{
// The first column is the package name, with a link to the directory containing the protos.
// Product name / API name
var productColumn = Product;

// Package name with a link to the directory containing the protos.
var packageColumn = $"[{Package}](proto/{string.Join("/", Package.Split('.'))})";

// The second column is the event types, in lexicographic order, separated by HTML line breaks.
// Event types in lexicographic order, separated by HTML line breaks.
var eventTypesColumn = string.Join("<br/>", EventTypes.OrderBy(type => type, StringComparer.Ordinal));

// The third column is the data messages, in lexicographic order, separated by HTML line breaks.
// Data messages, in lexicographic order, separated by HTML line breaks.
var dataMessagesColumn = string.Join("<br/>", DataMessages.OrderBy(type => type, StringComparer.Ordinal));

// Join the columns together, using | as the delimiter.
return $"|{packageColumn}|{eventTypesColumn}|{dataMessagesColumn}|";
return $"|{productColumn}|{packageColumn}|{eventTypesColumn}|{dataMessagesColumn}|";
}
}
}

0 comments on commit 3167ddf

Please sign in to comment.