xref: /aosp_15_r20/external/googleapis/google/cloud/eventarc/v1/channel.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.eventarc.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/timestamp.proto";
22
23option csharp_namespace = "Google.Cloud.Eventarc.V1";
24option go_package = "cloud.google.com/go/eventarc/apiv1/eventarcpb;eventarcpb";
25option java_multiple_files = true;
26option java_outer_classname = "ChannelProto";
27option java_package = "com.google.cloud.eventarc.v1";
28option php_namespace = "Google\\Cloud\\Eventarc\\V1";
29option ruby_package = "Google::Cloud::Eventarc::V1";
30
31// A representation of the Channel resource.
32// A Channel is a resource on which event providers publish their events.
33// The published events are delivered through the transport associated with the
34// channel. Note that a channel is associated with exactly one event provider.
35message Channel {
36  option (google.api.resource) = {
37    type: "eventarc.googleapis.com/Channel"
38    pattern: "projects/{project}/locations/{location}/channels/{channel}"
39    plural: "channels"
40    singular: "channel"
41  };
42
43  // State lists all the possible states of a Channel
44  enum State {
45    // Default value. This value is unused.
46    STATE_UNSPECIFIED = 0;
47
48    // The PENDING state indicates that a Channel has been created successfully
49    // and there is a new activation token available for the subscriber to use
50    // to convey the Channel to the provider in order to create a Connection.
51    PENDING = 1;
52
53    // The ACTIVE state indicates that a Channel has been successfully
54    // connected with the event provider.
55    // An ACTIVE Channel is ready to receive and route events from the
56    // event provider.
57    ACTIVE = 2;
58
59    // The INACTIVE state indicates that the Channel cannot receive events
60    // permanently. There are two possible cases this state can happen:
61    //
62    // 1. The SaaS provider disconnected from this Channel.
63    // 2. The Channel activation token has expired but the SaaS provider
64    //    wasn't connected.
65    //
66    // To re-establish a Connection with a provider, the subscriber
67    // should create a new Channel and give it to the provider.
68    INACTIVE = 3;
69  }
70
71  // Required. The resource name of the channel. Must be unique within the
72  // location on the project and must be in
73  // `projects/{project}/locations/{location}/channels/{channel_id}` format.
74  string name = 1 [(google.api.field_behavior) = REQUIRED];
75
76  // Output only. Server assigned unique identifier for the channel. The value
77  // is a UUID4 string and guaranteed to remain unchanged until the resource is
78  // deleted.
79  string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
80
81  // Output only. The creation time.
82  google.protobuf.Timestamp create_time = 5
83      [(google.api.field_behavior) = OUTPUT_ONLY];
84
85  // Output only. The last-modified time.
86  google.protobuf.Timestamp update_time = 6
87      [(google.api.field_behavior) = OUTPUT_ONLY];
88
89  // The name of the event provider (e.g. Eventarc SaaS partner) associated
90  // with the channel. This provider will be granted permissions to publish
91  // events to the channel. Format:
92  // `projects/{project}/locations/{location}/providers/{provider_id}`.
93  string provider = 7;
94
95  oneof transport {
96    // Output only. The name of the Pub/Sub topic created and managed by
97    // Eventarc system as a transport for the event delivery. Format:
98    // `projects/{project}/topics/{topic_id}`.
99    string pubsub_topic = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
100  }
101
102  // Output only. The state of a Channel.
103  State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
104
105  // Output only. The activation token for the channel. The token must be used
106  // by the provider to register the channel for publishing.
107  string activation_token = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
108
109  // Optional. Resource name of a KMS crypto key (managed by the user) used to
110  // encrypt/decrypt their event data.
111  //
112  // It must match the pattern
113  // `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
114  string crypto_key_name = 11 [
115    (google.api.field_behavior) = OPTIONAL,
116    (google.api.resource_reference) = {
117      type: "cloudkms.googleapis.com/CryptoKey"
118    }
119  ];
120}
121