channel.proto 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. syntax = "proto3";
  15. package google.cloud.eventarc.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option csharp_namespace = "Google.Cloud.Eventarc.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarc";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "ChannelProto";
  23. option java_package = "com.google.cloud.eventarc.v1";
  24. option php_namespace = "Google\\Cloud\\Eventarc\\V1";
  25. option ruby_package = "Google::Cloud::Eventarc::V1";
  26. // A representation of the Channel resource.
  27. // A Channel is a resource on which event providers publish their events.
  28. // The published events are delivered through the transport associated with the
  29. // channel. Note that a channel is associated with exactly one event provider.
  30. message Channel {
  31. option (google.api.resource) = {
  32. type: "eventarc.googleapis.com/Channel"
  33. pattern: "projects/{project}/locations/{location}/channels/{channel}"
  34. plural: "channels"
  35. singular: "channel"
  36. };
  37. // State lists all the possible states of a Channel
  38. enum State {
  39. // Default value. This value is unused.
  40. STATE_UNSPECIFIED = 0;
  41. // The PENDING state indicates that a Channel has been created successfully
  42. // and there is a new activation token available for the subscriber to use
  43. // to convey the Channel to the provider in order to create a Connection.
  44. PENDING = 1;
  45. // The ACTIVE state indicates that a Channel has been successfully
  46. // connected with the event provider.
  47. // An ACTIVE Channel is ready to receive and route events from the
  48. // event provider.
  49. ACTIVE = 2;
  50. // The INACTIVE state indicates that the Channel cannot receive events
  51. // permanently. There are two possible cases this state can happen:
  52. //
  53. // 1. The SaaS provider disconnected from this Channel.
  54. // 2. The Channel activation token has expired but the SaaS provider
  55. // wasn't connected.
  56. //
  57. // To re-establish a Connection with a provider, the subscriber
  58. // should create a new Channel and give it to the provider.
  59. INACTIVE = 3;
  60. }
  61. // Required. The resource name of the channel. Must be unique within the
  62. // location on the project and must be in
  63. // `projects/{project}/locations/{location}/channels/{channel_id}` format.
  64. string name = 1 [(google.api.field_behavior) = REQUIRED];
  65. // Output only. Server assigned unique identifier for the channel. The value
  66. // is a UUID4 string and guaranteed to remain unchanged until the resource is
  67. // deleted.
  68. string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  69. // Output only. The creation time.
  70. google.protobuf.Timestamp create_time = 5
  71. [(google.api.field_behavior) = OUTPUT_ONLY];
  72. // Output only. The last-modified time.
  73. google.protobuf.Timestamp update_time = 6
  74. [(google.api.field_behavior) = OUTPUT_ONLY];
  75. // The name of the event provider (e.g. Eventarc SaaS partner) associated
  76. // with the channel. This provider will be granted permissions to publish
  77. // events to the channel. Format:
  78. // `projects/{project}/locations/{location}/providers/{provider_id}`.
  79. string provider = 7;
  80. oneof transport {
  81. // Output only. The name of the Pub/Sub topic created and managed by
  82. // Eventarc system as a transport for the event delivery. Format:
  83. // `projects/{project}/topics/{topic_id}`.
  84. string pubsub_topic = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  85. }
  86. // Output only. The state of a Channel.
  87. State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  88. // Output only. The activation token for the channel. The token must be used
  89. // by the provider to register the channel for publishing.
  90. string activation_token = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  91. // Optional. Resource name of a KMS crypto key (managed by the user) used to
  92. // encrypt/decrypt their event data.
  93. //
  94. // It must match the pattern
  95. // `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
  96. string crypto_key_name = 11 [
  97. (google.api.field_behavior) = OPTIONAL,
  98. (google.api.resource_reference) = {
  99. type: "cloudkms.googleapis.com/CryptoKey"
  100. }
  101. ];
  102. }