Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
feat: Add Channel and ChannelConnection resources (#51)
Browse files Browse the repository at this point in the history
* feat: Add Channel and ChannelConnection resources

PiperOrigin-RevId: 425975821

Source-Link: googleapis/googleapis@3766798

Source-Link: https://github.com/googleapis/googleapis-gen/commit/0332102d499db3d7d6e69551f2f595a9c08a30d9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDMzMjEwMmQ0OTlkYjNkN2Q2ZTY5NTUxZjJmNTk1YTljMDhhMzBkOSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Benjamin E. Coe <[email protected]>
  • Loading branch information
3 people authored Feb 14, 2022
1 parent 68843ad commit bfae8c3
Show file tree
Hide file tree
Showing 25 changed files with 12,382 additions and 1,487 deletions.
104 changes: 104 additions & 0 deletions protos/google/cloud/eventarc/v1/channel.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.eventarc.v1;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.Eventarc.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarc";
option java_multiple_files = true;
option java_outer_classname = "ChannelProto";
option java_package = "com.google.cloud.eventarc.v1";
option php_namespace = "Google\\Cloud\\Eventarc\\V1";
option ruby_package = "Google::Cloud::Eventarc::V1";

// A representation of the Channel resource.
// A Channel is a resource on which event providers publish their events.
// The published events are delivered through the transport associated with the
// channel. Note that a channel is associated with exactly one event provider.
message Channel {
option (google.api.resource) = {
type: "eventarc.googleapis.com/Channel"
pattern: "projects/{project}/locations/{location}/channels/{channel}"
plural: "channels"
singular: "channel"
};

// State lists all the possible states of a Channel
enum State {
// Default value. This value is unused.
STATE_UNSPECIFIED = 0;

// The PENDING state indicates that a Channel has been created successfully
// and there is a new activation token available for the subscriber to use
// to convey the Channel to the provider in order to create a Connection.
PENDING = 1;

// The ACTIVE state indicates that a Channel has been successfully
// connected with the event provider.
// An ACTIVE Channel is ready to receive and route events from the
// event provider.
ACTIVE = 2;

// The INACTIVE state means that the Channel cannot receive events
// permanently. There are two possible cases this state can happen:
// 1. The SaaS provider disconnected from this Channel.
// 2. The Channel activation token has expired but the SaaS provider
// wasn't connected.
// To re-establish a Connection with a provider, the subscriber
// should create a new Channel and give it to the provider.
INACTIVE = 3;
}

// Required. The resource name of the channel. Must be unique within the location
// on the project and must be in
// `projects/{project}/locations/{location}/channels/{channel_id}` format.
string name = 1 [(google.api.field_behavior) = REQUIRED];

// Output only. Server assigned unique identifier for the channel. The value is a UUID4
// string and guaranteed to remain unchanged until the resource is deleted.
string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The creation time.
google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The last-modified time.
google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// Required. The name of the event provider (e.g. Eventarc SaaS partner) associated
// with the channel. This provider will be granted permissions to publish
// events to the channel. Format:
// `projects/{project}/locations/{location}/providers/{provider_id}`.
string provider = 7 [(google.api.field_behavior) = REQUIRED];

oneof transport {
// Output only. The name of the Pub/Sub topic created and managed by Eventarc system as
// a transport for the event delivery. Format:
// `projects/{project}/topics/{topic_id}`.
string pubsub_topic = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Output only. The state of a Channel.
State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The activation token for the channel. The token must be used by the
// provider to register the channel for publishing.
string activation_token = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
}
74 changes: 74 additions & 0 deletions protos/google/cloud/eventarc/v1/channel_connection.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.eventarc.v1;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.Eventarc.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarc";
option java_multiple_files = true;
option java_outer_classname = "ChannelConnectionProto";
option java_package = "com.google.cloud.eventarc.v1";
option php_namespace = "Google\\Cloud\\Eventarc\\V1";
option ruby_package = "Google::Cloud::Eventarc::V1";

// A representation of the ChannelConnection resource.
// A ChannelConnection is a resource which event providers create during the
// activation process to establish a connection between the provider and the
// subscriber channel.
message ChannelConnection {
option (google.api.resource) = {
type: "eventarc.googleapis.com/ChannelConnection"
pattern: "projects/{project}/locations/{location}/channelConnections/{channel_connection}"
plural: "channelConnections"
singular: "channelConnection"
};

// Required. The name of the connection.
string name = 1 [(google.api.field_behavior) = REQUIRED];

// Output only. Server assigned ID of the resource.
// The server guarantees uniqueness and immutability until deleted.
string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Required. The name of the connected subscriber Channel.
// This is a weak reference to avoid cross project and cross accounts
// references. This must be in
// `projects/{project}/location/{location}/channels/{channel_id}` format.
string channel = 5 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "eventarc.googleapis.com/Channel"
}
];

// Output only. The creation time.
google.protobuf.Timestamp create_time = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The last-modified time.
google.protobuf.Timestamp update_time = 7
[(google.api.field_behavior) = OUTPUT_ONLY];

// Input only. Activation token for the channel. The token will be used
// during the creation of ChannelConnection to bind the channel with the
// provider project. This field will not be stored in the provider resource.
string activation_token = 8 [(google.api.field_behavior) = INPUT_ONLY];
}
Loading

0 comments on commit bfae8c3

Please sign in to comment.