Table of Contents

Class ASObject

Namespace
ActivityPub.Types.AS
Assembly
ActivityPub.Types.dll

Describes an object of any kind. The Object type serves as the base type for most of the other kinds of objects defined in the Activity Vocabulary, including other Core types such as Activity, IntransitiveActivity, Collection and OrderedCollection.

public class ASObject : ASType, IASModel<ASType, ASTypeEntity>, IASModel<ASType>, IASModel<ASObject, ASObjectEntity, ASType>, IASModel<ASObject, ASObjectEntity>, IASModel<ASObject>
Inheritance
ASObject
Implements
Derived
Inherited Members

Constructors

ASObject()

Constructs a new instance and attaches it to a new, empty type graph.

public ASObject()

ASObject(ASType)

Constructs a new instance and extends an existing type graph from a provided model.

public ASObject(ASType existingGraph)

Parameters

existingGraph ASType
See Also
Extend<TModel, TEntity>()

ASObject(TypeMap, ASObjectEntity?)

public ASObject(TypeMap typeMap, ASObjectEntity? entity)

Parameters

typeMap TypeMap
entity ASObjectEntity

ASObject(TypeMap, bool)

Constructs a new instance from an existing type graph. The existing graph is either extended or wrapped, depending on the value of

isExtending
public ASObject(TypeMap typeMap, bool isExtending = true)

Parameters

typeMap TypeMap
isExtending bool

Remarks

All overrides MUST call this using

base(typeMap, false)

Exceptions

InvalidOperationException

If

extendGraph
is true and the entity type already exists in the graph
InvalidOperationException

If

extendGraph
is true and the entity requires another entity that is missing from the graph
InvalidCastException

If

extendGraph
is false and the object is not of type
TEntity
See Also
ProjectTo<TModel, TEntity>(bool)

Fields

ObjectType

ActivityStreams type name for "Object" types.

[PublicAPI]
public const string ObjectType = "Object"

Field Value

string

Properties

Attachment

Identifies a resource attached or related to an object that potentially requires special handling. The intent is to provide a model that is at least semantically similar to attachments in email.

public LinkableList<ASObject> Attachment { get; set; }

Property Value

LinkableList<ASObject>
See Also

Audience

Identifies one or more entities that represent the total population of entities for which the object can considered to be relevant.

public LinkableList<ASObject> Audience { get; set; }

Property Value

LinkableList<ASObject>
See Also

BCC

Identifies one or more Objects that are part of the private secondary audience of this Object.

public LinkableList<ASObject> BCC { get; set; }

Property Value

LinkableList<ASObject>
See Also

BTo

Identifies an Object that is part of the private primary audience of this Object.

public LinkableList<ASObject> BTo { get; set; }

Property Value

LinkableList<ASObject>
See Also

CC

Identifies an Object that is part of the public secondary audience of this Object.

public LinkableList<ASObject> CC { get; set; }

Property Value

LinkableList<ASObject>
See Also

Content

The content or textual representation of the Object encoded as a JSON string. By default, the value of content is HTML. The MediaType property can be used in the object to indicate a different content type.

public NaturalLanguageString? Content { get; set; }

Property Value

NaturalLanguageString

Remarks

In JSON, this property may be mapped to either or both of "content" and "contentMap".

See Also

Context

Identifies the context within which the object exists or an activity was performed. THIS IS NOT THE JSON-LD CONTEXT! For that, you need LDContext

public Linkable<ASObject>? Context { get; set; }

Property Value

Linkable<ASObject>

Remarks

The notion of "context" used is intentionally vague. The intended function is to serve as a means of grouping objects and activities that share a common originating context or purpose. An example could be all activities relating to a common project or event.

See Also

Duration

When the object describes a time-bound resource, such as an audio or video, a meeting, etc, the duration property indicates the object's approximate duration. The value MUST be expressed as an xsd:duration as defined by [xmlschema11-2], section 3.3.6 (e.g. a period of 5 seconds is represented as "PT5S").

public string? Duration { get; set; }

Property Value

string
See Also

EndTime

The date and time describing the actual or expected ending time of the object. When used with an Activity object, for instance, the endTime property specifies the moment the activity concluded or is expected to conclude.

public DateTime? EndTime { get; set; }

Property Value

DateTime?
See Also

Entity

private ASObjectEntity Entity { get; }

Property Value

ASObjectEntity

Generator

Identifies the entity (e.g. an application) that generated the object.

public Linkable<ASObject>? Generator { get; set; }

Property Value

Linkable<ASObject>
See Also

Icon

Indicates an entity that describes an icon for this object. The image should have an aspect ratio of one (horizontal) to one (vertical) and should be suitable for presentation at a small size.

public Linkable<ImageObject>? Icon { get; set; }

Property Value

Linkable<ImageObject>
See Also

Image

Indicates an entity that describes an image for this object. Unlike the icon property, there are no aspect ratio or display size limitations assumed.

public Linkable<ImageObject>? Image { get; set; }

Property Value

Linkable<ImageObject>
See Also

InReplyTo

Indicates one or more entities for which this object is considered a response.

public LinkableList<ASObject>? InReplyTo { get; set; }

Property Value

LinkableList<ASObject>
See Also

Likes

This is a list of all Like activities with this object as the object property, added as a side effect.

public Linkable<ASCollection>? Likes { get; set; }

Property Value

Linkable<ASCollection>

Remarks

Care should be taken to not confuse the the likes collection with the similarly named but different Liked collection.

See Also

Location

Indicates one or more physical or logical locations associated with the object.

public Linkable<ASObject>? Location { get; set; }

Property Value

Linkable<ASObject>
See Also

Published

The date and time at which the object was published.

public DateTime? Published { get; set; }

Property Value

DateTime?
See Also

Replies

Identifies a Collection containing objects considered to be responses to this object.

public ASCollection? Replies { get; set; }

Property Value

ASCollection
See Also

Shares

This is a list of all Announce activities with this object as the object property, added as a side effect.

public Linkable<ASCollection>? Shares { get; set; }

Property Value

Linkable<ASCollection>
See Also

Source

The source property is intended to convey some sort of source from which the content markup was derived, as a form of provenance, or to support future editing by clients. In general, clients do the conversion from source to content, not the other way around.

public ASObject? Source { get; set; }

Property Value

ASObject

Remarks

This property is defined by ActivityPub, not ActivityStreams.

See Also

StartTime

The date and time describing the actual or expected starting time of the object. When used with an Activity object, for instance, the startTime property specifies the moment the activity began or is scheduled to begin.

public DateTime? StartTime { get; set; }

Property Value

DateTime?
See Also

Summary

A natural language summarization of the object encoded as HTML.

public NaturalLanguageString? Summary { get; set; }

Property Value

NaturalLanguageString
See Also

Tag

One or more "tags" that have been associated with an objects. A tag can be any kind of Object. The key difference between attachment and tag is that the former implies association by inclusion, while the latter implies associated by reference.

public LinkableList<ASObject> Tag { get; set; }

Property Value

LinkableList<ASObject>
See Also

To

Identifies an entity considered to be part of the public primary audience of an Object

public LinkableList<ASObject> To { get; set; }

Property Value

LinkableList<ASObject>
See Also

Updated

The date and time at which the object was updated.

public DateTime? Updated { get; set; }

Property Value

DateTime?
See Also

Url

Identifies one or more links to representations of the object

public List<ASLink> Url { get; set; }

Property Value

List<ASLink>
See Also

Explicit Interface Implementations

IASModel<ASObject>.ASTypeName

AS type name of this entity. For the full list of names in the object graph, use ASTypes.

static string IASModel<ASObject>.ASTypeName { get; }

Returns

string

IASModel<ASObject>.FromGraph(TypeMap)

Constructs an instance from this type from a pre-populated type graph. The provided TypeMap instance is guaranteed to include an instance of type EntityType.

static ASObject IASModel<ASObject>.FromGraph(TypeMap typeMap)

Parameters

typeMap TypeMap

Returns

ASObject

See Also