diff --git a/CHANGELOG b/CHANGELOG index 0cb23b3..d7428c2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,7 +3,8 @@ master (Release Candidate for v0.2.0) * Begin FederateAPI unofficial implementation report. * All 'vocab.Object' types and types extending from 'vocab.Object' now have an 'IsPublic' method that will return true if the 'to', 'bto', 'cc', or 'bcc' - properties have the ActivityPub special Public collection IRI. + properties have the ActivityPub special Public collection IRI. The + 'streams' types also have a corresponding 'IsPublic' method. * Use 'OrderedCollection' as the default type for 'likes', 'liked', 'following', and 'followers' properties if the actor or object does not have an IRI, 'Collection', or 'OrderedCollection' set for these diff --git a/streams/gen_accept.go b/streams/gen_accept.go index e50f13d..74abc3c 100644 --- a/streams/gen_accept.go +++ b/streams/gen_accept.go @@ -25,6 +25,12 @@ func (t *Accept) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Accept) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Accept) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_activity.go b/streams/gen_activity.go index 0b49fb0..3901580 100644 --- a/streams/gen_activity.go +++ b/streams/gen_activity.go @@ -25,6 +25,12 @@ func (t *Activity) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Activity) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Activity) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_add.go b/streams/gen_add.go index 4a1cfef..b1d97c1 100644 --- a/streams/gen_add.go +++ b/streams/gen_add.go @@ -25,6 +25,12 @@ func (t *Add) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Add) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Add) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_announce.go b/streams/gen_announce.go index 14a170c..b6da751 100644 --- a/streams/gen_announce.go +++ b/streams/gen_announce.go @@ -25,6 +25,12 @@ func (t *Announce) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Announce) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Announce) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_application.go b/streams/gen_application.go index d012f5d..eda6cc1 100644 --- a/streams/gen_application.go +++ b/streams/gen_application.go @@ -25,6 +25,12 @@ func (t *Application) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Application) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Application) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_arrive.go b/streams/gen_arrive.go index 56e5154..141c298 100644 --- a/streams/gen_arrive.go +++ b/streams/gen_arrive.go @@ -25,6 +25,12 @@ func (t *Arrive) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Arrive) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Arrive) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_article.go b/streams/gen_article.go index 4fae7a0..a21cb44 100644 --- a/streams/gen_article.go +++ b/streams/gen_article.go @@ -25,6 +25,12 @@ func (t *Article) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Article) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Article) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_audio.go b/streams/gen_audio.go index bf6011f..655c3fe 100644 --- a/streams/gen_audio.go +++ b/streams/gen_audio.go @@ -25,6 +25,12 @@ func (t *Audio) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Audio) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Audio) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_block.go b/streams/gen_block.go index fc63b91..ef456b3 100644 --- a/streams/gen_block.go +++ b/streams/gen_block.go @@ -25,6 +25,12 @@ func (t *Block) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Block) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Block) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_collection.go b/streams/gen_collection.go index 3d4b286..33abd42 100644 --- a/streams/gen_collection.go +++ b/streams/gen_collection.go @@ -25,6 +25,12 @@ func (t *Collection) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Collection) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetTotalItems attempts to get this 'totalItems' property as a int64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Collection) GetTotalItems() (r Resolution, k int64) { r = Unresolved diff --git a/streams/gen_collectionpage.go b/streams/gen_collectionpage.go index f435bc3..aa53800 100644 --- a/streams/gen_collectionpage.go +++ b/streams/gen_collectionpage.go @@ -25,6 +25,12 @@ func (t *CollectionPage) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *CollectionPage) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // ResolvePartOf passes the actual concrete type to the resolver for handing property partOf. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. func (t *CollectionPage) ResolvePartOf(r *Resolver) (s Resolution, err error) { s = Unresolved diff --git a/streams/gen_create.go b/streams/gen_create.go index 47bd88d..3c9ec5c 100644 --- a/streams/gen_create.go +++ b/streams/gen_create.go @@ -25,6 +25,12 @@ func (t *Create) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Create) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Create) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_delete.go b/streams/gen_delete.go index 428c2ad..da7754e 100644 --- a/streams/gen_delete.go +++ b/streams/gen_delete.go @@ -25,6 +25,12 @@ func (t *Delete) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Delete) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Delete) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_dislike.go b/streams/gen_dislike.go index 1a43e0b..815a317 100644 --- a/streams/gen_dislike.go +++ b/streams/gen_dislike.go @@ -25,6 +25,12 @@ func (t *Dislike) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Dislike) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Dislike) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_document.go b/streams/gen_document.go index 7d4584b..7354713 100644 --- a/streams/gen_document.go +++ b/streams/gen_document.go @@ -25,6 +25,12 @@ func (t *Document) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Document) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Document) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_event.go b/streams/gen_event.go index 7ba37c9..01242cc 100644 --- a/streams/gen_event.go +++ b/streams/gen_event.go @@ -25,6 +25,12 @@ func (t *Event) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Event) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Event) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_flag.go b/streams/gen_flag.go index 7cad8f5..bae434e 100644 --- a/streams/gen_flag.go +++ b/streams/gen_flag.go @@ -25,6 +25,12 @@ func (t *Flag) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Flag) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Flag) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_follow.go b/streams/gen_follow.go index 0d012e6..80b911f 100644 --- a/streams/gen_follow.go +++ b/streams/gen_follow.go @@ -25,6 +25,12 @@ func (t *Follow) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Follow) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Follow) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_group.go b/streams/gen_group.go index 166c2e4..adf263d 100644 --- a/streams/gen_group.go +++ b/streams/gen_group.go @@ -25,6 +25,12 @@ func (t *Group) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Group) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Group) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_ignore.go b/streams/gen_ignore.go index 18933db..3d286f3 100644 --- a/streams/gen_ignore.go +++ b/streams/gen_ignore.go @@ -25,6 +25,12 @@ func (t *Ignore) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Ignore) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Ignore) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_image.go b/streams/gen_image.go index fae19da..a7273a6 100644 --- a/streams/gen_image.go +++ b/streams/gen_image.go @@ -25,6 +25,12 @@ func (t *Image) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Image) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetHeight attempts to get this 'height' property as a int64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Image) GetHeight() (r Resolution, k int64) { r = Unresolved diff --git a/streams/gen_intransitiveactivity.go b/streams/gen_intransitiveactivity.go index 69fda37..7f3ab3e 100644 --- a/streams/gen_intransitiveactivity.go +++ b/streams/gen_intransitiveactivity.go @@ -25,6 +25,12 @@ func (t *IntransitiveActivity) Serialize() (m map[string]interface{}, err error) } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *IntransitiveActivity) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *IntransitiveActivity) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_invite.go b/streams/gen_invite.go index 7faba9f..a608d08 100644 --- a/streams/gen_invite.go +++ b/streams/gen_invite.go @@ -25,6 +25,12 @@ func (t *Invite) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Invite) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Invite) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_join.go b/streams/gen_join.go index 3ac4bcd..c42b139 100644 --- a/streams/gen_join.go +++ b/streams/gen_join.go @@ -25,6 +25,12 @@ func (t *Join) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Join) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Join) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_leave.go b/streams/gen_leave.go index 1ca731c..cae133a 100644 --- a/streams/gen_leave.go +++ b/streams/gen_leave.go @@ -25,6 +25,12 @@ func (t *Leave) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Leave) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Leave) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_like.go b/streams/gen_like.go index 331d656..2d7e6fa 100644 --- a/streams/gen_like.go +++ b/streams/gen_like.go @@ -25,6 +25,12 @@ func (t *Like) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Like) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Like) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_listen.go b/streams/gen_listen.go index 1bc7bea..8c0982f 100644 --- a/streams/gen_listen.go +++ b/streams/gen_listen.go @@ -25,6 +25,12 @@ func (t *Listen) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Listen) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Listen) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_move.go b/streams/gen_move.go index d5ec887..c92ea94 100644 --- a/streams/gen_move.go +++ b/streams/gen_move.go @@ -25,6 +25,12 @@ func (t *Move) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Move) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Move) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_note.go b/streams/gen_note.go index e9c68e3..6438530 100644 --- a/streams/gen_note.go +++ b/streams/gen_note.go @@ -25,6 +25,12 @@ func (t *Note) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Note) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Note) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_object.go b/streams/gen_object.go index 2fcd3b2..697186d 100644 --- a/streams/gen_object.go +++ b/streams/gen_object.go @@ -25,6 +25,12 @@ func (t *Object) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Object) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Object) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_offer.go b/streams/gen_offer.go index 7c24d0f..c19f2e2 100644 --- a/streams/gen_offer.go +++ b/streams/gen_offer.go @@ -25,6 +25,12 @@ func (t *Offer) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Offer) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Offer) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_orderedcollection.go b/streams/gen_orderedcollection.go index e41b601..1f361a2 100644 --- a/streams/gen_orderedcollection.go +++ b/streams/gen_orderedcollection.go @@ -25,6 +25,12 @@ func (t *OrderedCollection) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *OrderedCollection) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenOrderedItems returns the number of values this property contains. Each index be used with HasOrderedItems to determine if ResolveOrderedItems is safe to call or if raw handling would be needed. func (t *OrderedCollection) LenOrderedItems() (idx int) { return t.raw.OrderedItemsLen() diff --git a/streams/gen_orderedcollectionpage.go b/streams/gen_orderedcollectionpage.go index ded226e..f5adde8 100644 --- a/streams/gen_orderedcollectionpage.go +++ b/streams/gen_orderedcollectionpage.go @@ -25,6 +25,12 @@ func (t *OrderedCollectionPage) Serialize() (m map[string]interface{}, err error } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *OrderedCollectionPage) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetStartIndex attempts to get this 'startIndex' property as a int64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *OrderedCollectionPage) GetStartIndex() (r Resolution, k int64) { r = Unresolved diff --git a/streams/gen_organization.go b/streams/gen_organization.go index 0c6a76e..9c0d43a 100644 --- a/streams/gen_organization.go +++ b/streams/gen_organization.go @@ -25,6 +25,12 @@ func (t *Organization) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Organization) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Organization) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_page.go b/streams/gen_page.go index 181bb4d..cefadcc 100644 --- a/streams/gen_page.go +++ b/streams/gen_page.go @@ -25,6 +25,12 @@ func (t *Page) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Page) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Page) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_person.go b/streams/gen_person.go index 1b5a4e6..73e7f08 100644 --- a/streams/gen_person.go +++ b/streams/gen_person.go @@ -25,6 +25,12 @@ func (t *Person) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Person) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Person) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_place.go b/streams/gen_place.go index e0024c8..3f50b4b 100644 --- a/streams/gen_place.go +++ b/streams/gen_place.go @@ -25,6 +25,12 @@ func (t *Place) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Place) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAccuracy attempts to get this 'accuracy' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Place) GetAccuracy() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_profile.go b/streams/gen_profile.go index 8c9645e..32969a6 100644 --- a/streams/gen_profile.go +++ b/streams/gen_profile.go @@ -25,6 +25,12 @@ func (t *Profile) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Profile) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // ResolveDescribes passes the actual concrete type to the resolver for handing property describes. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. func (t *Profile) ResolveDescribes(r *Resolver) (s Resolution, err error) { s = Unresolved diff --git a/streams/gen_question.go b/streams/gen_question.go index 1cc878c..fa3ce05 100644 --- a/streams/gen_question.go +++ b/streams/gen_question.go @@ -25,6 +25,12 @@ func (t *Question) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Question) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenOneOf returns the number of values this property contains. Each index be used with HasOneOf to determine if ResolveOneOf is safe to call or if raw handling would be needed. func (t *Question) LenOneOf() (idx int) { return t.raw.OneOfLen() diff --git a/streams/gen_read.go b/streams/gen_read.go index 9b482b6..f07ad01 100644 --- a/streams/gen_read.go +++ b/streams/gen_read.go @@ -25,6 +25,12 @@ func (t *Read) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Read) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Read) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_reject.go b/streams/gen_reject.go index dda0e7c..e4fdfee 100644 --- a/streams/gen_reject.go +++ b/streams/gen_reject.go @@ -25,6 +25,12 @@ func (t *Reject) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Reject) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Reject) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_relationship.go b/streams/gen_relationship.go index 0e11ffd..26c59a6 100644 --- a/streams/gen_relationship.go +++ b/streams/gen_relationship.go @@ -25,6 +25,12 @@ func (t *Relationship) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Relationship) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // ResolveSubject passes the actual concrete type to the resolver for handing property subject. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. func (t *Relationship) ResolveSubject(r *Resolver) (s Resolution, err error) { s = Unresolved diff --git a/streams/gen_remove.go b/streams/gen_remove.go index 91bd7f3..0d40ab8 100644 --- a/streams/gen_remove.go +++ b/streams/gen_remove.go @@ -25,6 +25,12 @@ func (t *Remove) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Remove) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Remove) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_service.go b/streams/gen_service.go index 2af2ccd..623c8da 100644 --- a/streams/gen_service.go +++ b/streams/gen_service.go @@ -25,6 +25,12 @@ func (t *Service) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Service) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Service) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_tentativeaccept.go b/streams/gen_tentativeaccept.go index 930cdba..7240ca6 100644 --- a/streams/gen_tentativeaccept.go +++ b/streams/gen_tentativeaccept.go @@ -25,6 +25,12 @@ func (t *TentativeAccept) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *TentativeAccept) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *TentativeAccept) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_tentativereject.go b/streams/gen_tentativereject.go index 92369a8..5e7cb9c 100644 --- a/streams/gen_tentativereject.go +++ b/streams/gen_tentativereject.go @@ -25,6 +25,12 @@ func (t *TentativeReject) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *TentativeReject) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *TentativeReject) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_tombstone.go b/streams/gen_tombstone.go index fce4bcc..867a116 100644 --- a/streams/gen_tombstone.go +++ b/streams/gen_tombstone.go @@ -25,6 +25,12 @@ func (t *Tombstone) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Tombstone) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenFormerType returns the number of values this property contains. Each index be used with HasFormerType to determine if GetFormerType is safe to call or if raw handling would be needed. func (t *Tombstone) LenFormerType() (idx int) { return t.raw.FormerTypeLen() diff --git a/streams/gen_travel.go b/streams/gen_travel.go index b33fa70..8fea4ff 100644 --- a/streams/gen_travel.go +++ b/streams/gen_travel.go @@ -25,6 +25,12 @@ func (t *Travel) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Travel) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Travel) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_undo.go b/streams/gen_undo.go index 8ae98ba..796d82e 100644 --- a/streams/gen_undo.go +++ b/streams/gen_undo.go @@ -25,6 +25,12 @@ func (t *Undo) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Undo) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Undo) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_update.go b/streams/gen_update.go index 40c139f..b8c67e5 100644 --- a/streams/gen_update.go +++ b/streams/gen_update.go @@ -25,6 +25,12 @@ func (t *Update) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Update) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *Update) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/streams/gen_video.go b/streams/gen_video.go index f81d53c..64fe495 100644 --- a/streams/gen_video.go +++ b/streams/gen_video.go @@ -25,6 +25,12 @@ func (t *Video) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *Video) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. func (t *Video) GetAltitude() (r Resolution, k float64) { r = Unresolved diff --git a/streams/gen_view.go b/streams/gen_view.go index 41177f3..db0a0f9 100644 --- a/streams/gen_view.go +++ b/streams/gen_view.go @@ -25,6 +25,12 @@ func (t *View) Serialize() (m map[string]interface{}, err error) { } +// IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection +func (t *View) IsPublic() (b bool) { + return t.raw.IsPublic() + +} + // LenActor returns the number of values this property contains. Each index be used with HasActor to determine if GetActor is safe to call or if raw handling would be needed. func (t *View) LenActor() (idx int) { return t.raw.ActorLen() diff --git a/tools/streams/gen/as.go b/tools/streams/gen/as.go index bc99486..01336ba 100644 --- a/tools/streams/gen/as.go +++ b/tools/streams/gen/as.go @@ -270,6 +270,19 @@ func generateDefinitions(t *defs.Type) (fd []*defs.FunctionDef, sd []*defs.Struc }, }, }...) + if t.GetTypeMetadata().HasIsPublicMethod { + this.F = append(this.F, &defs.MemberFunctionDef{ + Name: "IsPublic", + Comment: "IsPublic returns true if the 'to', 'bto', 'cc', or 'bcc' properties address the special Public ActivityPub collection", + P: this, + Return: []*defs.FunctionVarDef{{"b", "bool"}}, + Body: func() string { + var b bytes.Buffer + b.WriteString(fmt.Sprintf("return t.%s.IsPublic()\n", rawMemberName)) + return b.String() + }, + }) + } for _, p := range t.GetProperties() { generatePropertyHelpers(p, this) for _, r := range p.Range {