Struct TopicId
Represents a topic identifier that defines the scope of a broadcast message. The agent runtime implements a publish-subscribe model through its broadcast API, where messages must be published with a specific topic.
See the Python equivalent: CloudEvents Type Specification.
- Inherited Members
Constructors
TopicId(string, string)
Initializes a new instance of the Topic
Parameters
type
stringThe type of the topic.
source
stringThe source of the event. Defaults to Default
Source if not specified.
TopicId((string Type, string Source))
Initializes a new instance of the Topic
Parameters
Fields
DefaultSource
The default source value used when no source is explicitly provided.
Field Value
Properties
Source
Gets the source that identifies the context in which an event happened. This adheres to the CloudEvents specification.
Learn more here: CloudEvents Source.
Property Value
Type
Gets the type of the event that this Topic
Must match the pattern: ^[\w-.:=]+$
.
Learn more here: CloudEvents Type.
Property Value
Methods
Equals(object?)
Determines whether the specified object is equal to the current Topic
Parameters
obj
objectThe object to compare with the current instance.
Returns
FromStr(string)
Converts a string in the format "type/source" into a Topic
Parameters
maybeTopicId
stringThe topic ID string.
Returns
Exceptions
- Format
Exception Thrown when the string is not in the valid "type/source" format.
GetHashCode()
Returns a hash code for this Topic
Returns
- int
A hash code for the current instance.
IsWildcardMatch(TopicId)
Determines whether the given Topic
Parameters
other
TopicId The topic ID to compare against.
Returns
- bool
true
if the topic types are equal; otherwise,false
.
ToString()
Returns the string representation of the Topic
Returns
- string
A string in the format "type/source".
Operators
explicit operator TopicId(string)
Explicitly converts a string to a Topic
Parameters
id
stringThe string representation of a topic ID.