Add string derives for objects and links

This commit is contained in:
asonix 2019-05-18 12:49:45 -05:00
parent 35040b68f2
commit e038096179
5 changed files with 55 additions and 55 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "activitystreams-types"
description = "Base types from the Activity Streams spec"
version = "0.2.2"
version = "0.2.3"
license = "GPL-3.0"
authors = ["asonix <asonix@asonix.dog>"]
repository = "https://git.asonix.dog/Aardwolf/activitystreams"

View file

@ -75,7 +75,7 @@ pub struct ActivityProperties {
/// - Range: `Object` | `Link`
/// - Funcitonal: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub result: Option<serde_json::Value>,
/// Identifies one or more objects used (or to be used) in the completion of an `Activity`.
@ -83,7 +83,7 @@ pub struct ActivityProperties {
/// - Range: `Object` | `Link`
/// - Funcitonal: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub instrument: Option<serde_json::Value>,
}
@ -99,7 +99,7 @@ pub struct ActorOptOriginAndTarget {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub actor: serde_json::Value,
/// Describes an indirect object of the activity from which the activity is directed.
@ -111,7 +111,7 @@ pub struct ActorOptOriginAndTarget {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub origin: Option<serde_json::Value>,
/// Describes the indirect object, or target, of the activity.
@ -124,7 +124,7 @@ pub struct ActorOptOriginAndTarget {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub target: Option<serde_json::Value>,
}
@ -140,7 +140,7 @@ pub struct ActorAndObject {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub actor: serde_json::Value,
/// When used within an Activity, describes the direct object of the activity.
@ -150,7 +150,7 @@ pub struct ActorAndObject {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub object: serde_json::Value,
}
@ -166,7 +166,7 @@ pub struct ActorObjectAndTarget {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub actor: serde_json::Value,
/// When used within an Activity, describes the direct object of the activity.
@ -176,7 +176,7 @@ pub struct ActorObjectAndTarget {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub object: serde_json::Value,
/// Describes the indirect object, or target, of the activity.
@ -188,7 +188,7 @@ pub struct ActorObjectAndTarget {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub target: serde_json::Value,
}
@ -204,7 +204,7 @@ pub struct ActorAndObjectOptTarget {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub actor: serde_json::Value,
/// When used within an Activity, describes the direct object of the activity.
@ -214,7 +214,7 @@ pub struct ActorAndObjectOptTarget {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub object: serde_json::Value,
/// Describes the indirect object, or target, of the activity.
@ -227,7 +227,7 @@ pub struct ActorAndObjectOptTarget {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub target: Option<serde_json::Value>,
}
@ -243,7 +243,7 @@ pub struct ActorAndObjectOptOrigin {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub actor: serde_json::Value,
/// When used within an Activity, describes the direct object of the activity.
@ -253,7 +253,7 @@ pub struct ActorAndObjectOptOrigin {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub object: serde_json::Value,
/// Describes an indirect object of the activity from which the activity is directed.
@ -265,7 +265,7 @@ pub struct ActorAndObjectOptOrigin {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub origin: Option<serde_json::Value>,
}
@ -281,7 +281,7 @@ pub struct ActorAndObjectOptOthers {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub actor: serde_json::Value,
/// When used within an Activity, describes the direct object of the activity.
@ -291,7 +291,7 @@ pub struct ActorAndObjectOptOthers {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub object: serde_json::Value,
/// Describes an indirect object of the activity from which the activity is directed.
@ -303,7 +303,7 @@ pub struct ActorAndObjectOptOthers {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub origin: Option<serde_json::Value>,
/// Describes the indirect object, or target, of the activity.
@ -316,7 +316,7 @@ pub struct ActorAndObjectOptOthers {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub target: Option<serde_json::Value>,
}
@ -332,7 +332,7 @@ pub struct ActorAndOrigin {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub actor: serde_json::Value,
/// Describes an indirect object of the activity from which the activity is directed.
@ -343,7 +343,7 @@ pub struct ActorAndOrigin {
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub origin: serde_json::Value,
}
@ -413,7 +413,7 @@ pub struct QuestionProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub one_of: Option<serde_json::Value>,
/// Identifies an inclusive option for a Question.
@ -424,7 +424,7 @@ pub struct QuestionProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub any_of: Option<serde_json::Value>,
}

View file

@ -73,7 +73,7 @@ pub struct CollectionProperties {
///
/// - Range: `Object` | `Link` | Ordered List of [ `Object` | `Link` ]
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub items: serde_json::Value,
/// A non-negative integer specifying the total number of objects contained by the logical view
@ -94,7 +94,7 @@ pub struct CollectionProperties {
/// - Range: `CollectionPage` | `Link`
/// - Functional: true
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Link, CollectionPage), functional)]
#[activitystreams(ab(Link, CollectionPage), concrete(String), functional)]
pub current: Option<serde_json::Value>,
/// In a paged `Collection`, indicates the furthest preceeding page of items in the collection.
@ -102,7 +102,7 @@ pub struct CollectionProperties {
/// - Range: `CollectionPage` | `Link`
/// - Functional: true
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Link, CollectionPage), functional)]
#[activitystreams(ab(Link, CollectionPage), concrete(String), functional)]
pub first: Option<serde_json::Value>,
/// In a paged `Collection`, indicates the furthest proceeding page of the collection.
@ -110,7 +110,7 @@ pub struct CollectionProperties {
/// - Range: `CollectionPage` | `Link`
/// - Functional: true
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Link, CollectionPage), functional)]
#[activitystreams(ab(Link, CollectionPage), concrete(String), functional)]
pub last: Option<serde_json::Value>,
}
@ -124,7 +124,7 @@ pub struct CollectionPageProperties {
/// Range: `Collection` | `Link`
/// Functional: true
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Link, Collection), functional)]
#[activitystreams(ab(Link, Collection), concrete(String), functional)]
pub part_of: Option<serde_json::Value>,
/// In a paged `Collection`, indicates the next page of items.
@ -132,7 +132,7 @@ pub struct CollectionPageProperties {
/// - Range: `CollectionPage` | `Link`
/// - Functional: true
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Link, CollectionPage), functional)]
#[activitystreams(ab(Link, CollectionPage), concrete(String), functional)]
pub next: Option<serde_json::Value>,
/// In a paged `Collection`, identifies the previous page of items.
@ -140,7 +140,7 @@ pub struct CollectionPageProperties {
/// - Range: `CollectionPage` | `Link`
/// - Functional: true
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Link, CollectionPage), functional)]
#[activitystreams(ab(Link, CollectionPage), concrete(String), functional)]
pub prev: Option<serde_json::Value>,
}

View file

@ -93,7 +93,7 @@ pub struct LinkProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none", rename = "@context")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub context: Option<serde_json::Value>,
// TODO: rdf:langString
@ -180,7 +180,7 @@ pub struct LinkProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub preview: Option<serde_json::Value>,
}

View file

@ -96,7 +96,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub attachment: Option<serde_json::Value>,
/// Identifies one or more entities to which this object is attributed.
@ -107,7 +107,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub attributed_to: Option<serde_json::Value>,
/// Identifies one or more entities that represent the total population of entities for which
@ -116,7 +116,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub audience: Option<serde_json::Value>,
// TODO: rdf:langString
@ -142,7 +142,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none", rename = "@context")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub context: Option<serde_json::Value>,
// TODO: rdf:langString
@ -174,7 +174,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub generator: Option<serde_json::Value>,
/// Indicates an entity that describes an icon for this object.
@ -185,7 +185,7 @@ pub struct ObjectProperties {
/// - Range: `Image` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link), concrete(Image))]
#[activitystreams(ab(Object, Link), concrete(Image, String))]
pub icon: Option<serde_json::Value>,
/// Indicates an entity that describes an image for this object.
@ -195,7 +195,7 @@ pub struct ObjectProperties {
/// - Range: `Image` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link), concrete(Image))]
#[activitystreams(ab(Object, Link), concrete(Image, String))]
pub image: Option<serde_json::Value>,
/// Indicates one or more entities for which this object is considered a response.
@ -203,7 +203,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub in_reply_to: Option<serde_json::Value>,
/// Indicates one or more physical or logical locations associated with the object.
@ -211,7 +211,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub location: Option<serde_json::Value>,
/// Identifies an entity that provides a preview of this object.
@ -219,7 +219,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub preview: Option<serde_json::Value>,
/// The date and time at which the object was published.
@ -235,7 +235,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Collection), functional)]
#[activitystreams(ab(Collection), concrete(String), functional)]
pub replies: Option<serde_json::Value>,
/// The date and time describing the actual or expected starting time of the object.
@ -269,7 +269,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub tag: Option<serde_json::Value>,
/// The date and time at which the object was updated,
@ -293,7 +293,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub to: Option<serde_json::Value>,
/// Identifies an `Object` that is part of the private primary audience of this `Object`.
@ -301,7 +301,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub bto: Option<serde_json::Value>,
/// Identifies an `Object` that is part of the public secondary audience of this `Object`.
@ -309,7 +309,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub cc: Option<serde_json::Value>,
/// Identifies one or more `Objects` that are part of the private secondary audience of this
@ -318,7 +318,7 @@ pub struct ObjectProperties {
/// - Range: `Object` | `Link`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
pub bcc: Option<serde_json::Value>,
/// When used on an `Object`, identifies the MIME media type of the value of the content
@ -427,7 +427,7 @@ pub struct ProfileProperties {
///
/// - Range: `Object`
/// - Functional: true
#[activitystreams(ab(Object), functional)]
#[activitystreams(ab(Object), concrete(String), functional)]
pub describes: serde_json::Value,
}
@ -444,14 +444,14 @@ pub struct RelationshipProperties {
///
/// - Range: `Object` | `Link`
/// - Functional: true
#[activitystreams(ab(Object, Link), functional)]
#[activitystreams(ab(Object, Link), concrete(String), functional)]
subject: serde_json::Value,
/// When used within a `Relationship` describes the entity to which the subject is related.
///
/// - Range: `Object` | `Link`
/// - Functional: false
#[activitystreams(ab(Object, Link))]
#[activitystreams(ab(Object, Link), concrete(String))]
object: serde_json::Value,
/// On a `Relationship` object, the relationship property identifies the kind of relationship
@ -459,7 +459,7 @@ pub struct RelationshipProperties {
///
/// - Range: `Object`
/// - Functional: false
#[activitystreams(ab(Object))]
#[activitystreams(ab(Object), concrete(String))]
relationship: serde_json::Value,
}
@ -473,7 +473,7 @@ pub struct TombstoneProperties {
/// - Range: `Object`
/// - Functional: false
#[serde(skip_serializing_if = "Option::is_none")]
#[activitystreams(ab(Object))]
#[activitystreams(ab(Object), concrete(String))]
pub former_type: Option<serde_json::Value>,
/// On a `Tombstone` object, the deleted property is a timestamp for when the object was