diff --git a/CHANGELOG b/CHANGELOG index 0cb23b39..d7428c26 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 e50f13dd..74abc3c3 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 0b49fb0d..39015807 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 4a1cfef5..b1d97c19 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 14a170ce..b6da751a 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 d012f5d4..eda6cc14 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 56e51542..141c2983 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 4fae7a06..a21cb447 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 bf6011f4..655c3fe6 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 fc63b91a..ef456b3e 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 3d4b286d..33abd42b 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 f435bc36..aa53800e 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 47bd88df..3c9ec5c9 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 428c2adf..da7754e8 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 1a43e0b2..815a317b 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 7d4584b0..73547132 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 7ba37c99..01242ccc 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 7cad8f51..bae434ea 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 0d012e65..80b911fd 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 166c2e4e..adf263db 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 18933db8..3d286f3e 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 fae19da3..a7273a6e 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 69fda37d..7f3ab3ef 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 7faba9f0..a608d085 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 3ac4bcdf..c42b139b 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 1ca731c1..cae133ab 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 331d6564..2d7e6fa2 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 1bc7bea4..8c0982fa 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 d5ec887d..c92ea94b 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 e9c68e36..6438530e 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 2fcd3b22..697186da 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 7c24d0f1..c19f2e26 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 e41b6018..1f361a2b 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 ded226e9..f5adde8a 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 0c6a76ef..9c0d43a8 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 181bb4d0..cefadcc0 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 1b5a4e66..73e7f08a 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 e0024c8e..3f50b4b9 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 8c9645e2..32969a67 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 1cc878cc..fa3ce050 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 9b482b6c..f07ad012 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 dda0e7c5..e4fdfee5 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 0e11ffdc..26c59a61 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 91bd7f3f..0d40ab8b 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 2af2ccd3..623c8da3 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 930cdbaf..7240ca6a 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 92369a8b..5e7cb9cf 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 fce4bcc4..867a116c 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 b33fa701..8fea4ff0 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 8ae98ba1..796d82ed 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 40c139f7..b8c67e5a 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 f81d53c4..64fe4952 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 41177f33..db0a0f95 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 bc99486a..01336ba8 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 {