Class CloudEvent

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.eventarc.publishing.v1.CloudEvent
All Implemented Interfaces:
CloudEventOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class CloudEvent extends com.google.protobuf.GeneratedMessage implements CloudEventOrBuilder
 CloudEvent represents a vendor-neutral specification for defining the format
 of event data.
 
Protobuf type google.cloud.eventarc.publishing.v1.CloudEvent
See Also:
  • Field Details

  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • getDataCase

      public CloudEvent.DataCase getDataCase()
      Specified by:
      getDataCase in interface CloudEventOrBuilder
    • getId

      public String getId()
       Required. Identifies the event. Producers MUST ensure that source + id is
       unique for each distinct event.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getId in interface CloudEventOrBuilder
      Returns:
      The id.
    • getIdBytes

      public com.google.protobuf.ByteString getIdBytes()
       Required. Identifies the event. Producers MUST ensure that source + id is
       unique for each distinct event.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getIdBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for id.
    • getSource

      public String getSource()
       Required. Identifies the context in which an event happened.
       URI-reference
       
      string source = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSource in interface CloudEventOrBuilder
      Returns:
      The source.
    • getSourceBytes

      public com.google.protobuf.ByteString getSourceBytes()
       Required. Identifies the context in which an event happened.
       URI-reference
       
      string source = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSourceBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for source.
    • getSpecVersion

      public String getSpecVersion()
       Required. The version of the CloudEvents specification which the event
       uses.
       
      string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSpecVersion in interface CloudEventOrBuilder
      Returns:
      The specVersion.
    • getSpecVersionBytes

      public com.google.protobuf.ByteString getSpecVersionBytes()
       Required. The version of the CloudEvents specification which the event
       uses.
       
      string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSpecVersionBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for specVersion.
    • getType

      public String getType()
       Required. This attribute contains a value describing the type of event
       related to the originating occurrence.
       
      string type = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getType in interface CloudEventOrBuilder
      Returns:
      The type.
    • getTypeBytes

      public com.google.protobuf.ByteString getTypeBytes()
       Required. This attribute contains a value describing the type of event
       related to the originating occurrence.
       
      string type = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTypeBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for type.
    • getAttributesCount

      public int getAttributesCount()
      Description copied from interface: CloudEventOrBuilder
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesCount in interface CloudEventOrBuilder
    • containsAttributes

      public boolean containsAttributes(String key)
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      containsAttributes in interface CloudEventOrBuilder
    • getAttributes

      Deprecated.
      Use getAttributesMap() instead.
      Specified by:
      getAttributes in interface CloudEventOrBuilder
    • getAttributesMap

      public Map<String,CloudEvent.CloudEventAttributeValue> getAttributesMap()
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesMap in interface CloudEventOrBuilder
    • getAttributesOrDefault

      public CloudEvent.CloudEventAttributeValue getAttributesOrDefault(String key, CloudEvent.CloudEventAttributeValue defaultValue)
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesOrDefault in interface CloudEventOrBuilder
    • getAttributesOrThrow

      public CloudEvent.CloudEventAttributeValue getAttributesOrThrow(String key)
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesOrThrow in interface CloudEventOrBuilder
    • hasBinaryData

      public boolean hasBinaryData()
       Optional. Binary data.
       
      bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasBinaryData in interface CloudEventOrBuilder
      Returns:
      Whether the binaryData field is set.
    • getBinaryData

      public com.google.protobuf.ByteString getBinaryData()
       Optional. Binary data.
       
      bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getBinaryData in interface CloudEventOrBuilder
      Returns:
      The binaryData.
    • hasTextData

      public boolean hasTextData()
       Optional. Text data.
       
      string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasTextData in interface CloudEventOrBuilder
      Returns:
      Whether the textData field is set.
    • getTextData

      public String getTextData()
       Optional. Text data.
       
      string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getTextData in interface CloudEventOrBuilder
      Returns:
      The textData.
    • getTextDataBytes

      public com.google.protobuf.ByteString getTextDataBytes()
       Optional. Text data.
       
      string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getTextDataBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for textData.
    • hasProtoData

      public boolean hasProtoData()
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasProtoData in interface CloudEventOrBuilder
      Returns:
      Whether the protoData field is set.
    • getProtoData

      public com.google.protobuf.Any getProtoData()
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getProtoData in interface CloudEventOrBuilder
      Returns:
      The protoData.
    • getProtoDataOrBuilder

      public com.google.protobuf.AnyOrBuilder getProtoDataOrBuilder()
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getProtoDataOrBuilder in interface CloudEventOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static CloudEvent parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CloudEvent parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CloudEvent parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CloudEvent parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CloudEvent parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CloudEvent parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CloudEvent parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static CloudEvent parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static CloudEvent parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static CloudEvent parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static CloudEvent parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static CloudEvent parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public CloudEvent.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static CloudEvent.Builder newBuilder()
    • newBuilder

      public static CloudEvent.Builder newBuilder(CloudEvent prototype)
    • toBuilder

      public CloudEvent.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected CloudEvent.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static CloudEvent getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<CloudEvent> parser()
    • getParserForType

      public com.google.protobuf.Parser<CloudEvent> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public CloudEvent getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder