diff --git a/streams/gen_accept.go b/streams/gen_accept.go index 15c34dc..dde1c20 100644 --- a/streams/gen_accept.go +++ b/streams/gen_accept.go @@ -2494,3 +2494,8 @@ func (t *Accept) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewAccept returns a new instance of Accept +func NewAccept() (n *Accept) { + return &Accept{raw: &vocab.Accept{}} +} diff --git a/streams/gen_activity.go b/streams/gen_activity.go index 141f0fa..37e4a6f 100644 --- a/streams/gen_activity.go +++ b/streams/gen_activity.go @@ -2494,3 +2494,8 @@ func (t *Activity) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewActivity returns a new instance of Activity +func NewActivity() (n *Activity) { + return &Activity{raw: &vocab.Activity{}} +} diff --git a/streams/gen_add.go b/streams/gen_add.go index 127af8e..9214612 100644 --- a/streams/gen_add.go +++ b/streams/gen_add.go @@ -2494,3 +2494,8 @@ func (t *Add) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewAdd returns a new instance of Add +func NewAdd() (n *Add) { + return &Add{raw: &vocab.Add{}} +} diff --git a/streams/gen_announce.go b/streams/gen_announce.go index 440f84c..f80280e 100644 --- a/streams/gen_announce.go +++ b/streams/gen_announce.go @@ -2494,3 +2494,8 @@ func (t *Announce) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewAnnounce returns a new instance of Announce +func NewAnnounce() (n *Announce) { + return &Announce{raw: &vocab.Announce{}} +} diff --git a/streams/gen_application.go b/streams/gen_application.go index c5405c7..b80c1c4 100644 --- a/streams/gen_application.go +++ b/streams/gen_application.go @@ -2135,3 +2135,8 @@ func (t *Application) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewApplication returns a new instance of Application +func NewApplication() (n *Application) { + return &Application{raw: &vocab.Application{}} +} diff --git a/streams/gen_arrive.go b/streams/gen_arrive.go index 10bf096..042fa39 100644 --- a/streams/gen_arrive.go +++ b/streams/gen_arrive.go @@ -2442,3 +2442,8 @@ func (t *Arrive) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewArrive returns a new instance of Arrive +func NewArrive() (n *Arrive) { + return &Arrive{raw: &vocab.Arrive{}} +} diff --git a/streams/gen_article.go b/streams/gen_article.go index ea4d8b8..c33d39b 100644 --- a/streams/gen_article.go +++ b/streams/gen_article.go @@ -2135,3 +2135,8 @@ func (t *Article) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewArticle returns a new instance of Article +func NewArticle() (n *Article) { + return &Article{raw: &vocab.Article{}} +} diff --git a/streams/gen_audio.go b/streams/gen_audio.go index 4566497..297cff4 100644 --- a/streams/gen_audio.go +++ b/streams/gen_audio.go @@ -2135,3 +2135,8 @@ func (t *Audio) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewAudio returns a new instance of Audio +func NewAudio() (n *Audio) { + return &Audio{raw: &vocab.Audio{}} +} diff --git a/streams/gen_block.go b/streams/gen_block.go index 5da8afa..361e081 100644 --- a/streams/gen_block.go +++ b/streams/gen_block.go @@ -2494,3 +2494,8 @@ func (t *Block) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewBlock returns a new instance of Block +func NewBlock() (n *Block) { + return &Block{raw: &vocab.Block{}} +} diff --git a/streams/gen_collection.go b/streams/gen_collection.go index 28cc981..44e6b8a 100644 --- a/streams/gen_collection.go +++ b/streams/gen_collection.go @@ -2348,3 +2348,8 @@ func (t *Collection) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewCollection returns a new instance of Collection +func NewCollection() (n *Collection) { + return &Collection{raw: &vocab.Collection{}} +} diff --git a/streams/gen_collectionpage.go b/streams/gen_collectionpage.go index 7f37273..8006516 100644 --- a/streams/gen_collectionpage.go +++ b/streams/gen_collectionpage.go @@ -2462,3 +2462,8 @@ func (t *CollectionPage) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewCollectionPage returns a new instance of CollectionPage +func NewCollectionPage() (n *CollectionPage) { + return &CollectionPage{raw: &vocab.CollectionPage{}} +} diff --git a/streams/gen_create.go b/streams/gen_create.go index 41dee70..92ff1d2 100644 --- a/streams/gen_create.go +++ b/streams/gen_create.go @@ -2494,3 +2494,8 @@ func (t *Create) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewCreate returns a new instance of Create +func NewCreate() (n *Create) { + return &Create{raw: &vocab.Create{}} +} diff --git a/streams/gen_delete.go b/streams/gen_delete.go index b4dd67d..e628e36 100644 --- a/streams/gen_delete.go +++ b/streams/gen_delete.go @@ -2494,3 +2494,8 @@ func (t *Delete) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewDelete returns a new instance of Delete +func NewDelete() (n *Delete) { + return &Delete{raw: &vocab.Delete{}} +} diff --git a/streams/gen_dislike.go b/streams/gen_dislike.go index e892646..7bf31be 100644 --- a/streams/gen_dislike.go +++ b/streams/gen_dislike.go @@ -2494,3 +2494,8 @@ func (t *Dislike) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewDislike returns a new instance of Dislike +func NewDislike() (n *Dislike) { + return &Dislike{raw: &vocab.Dislike{}} +} diff --git a/streams/gen_document.go b/streams/gen_document.go index d85930b..28227f5 100644 --- a/streams/gen_document.go +++ b/streams/gen_document.go @@ -2135,3 +2135,8 @@ func (t *Document) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewDocument returns a new instance of Document +func NewDocument() (n *Document) { + return &Document{raw: &vocab.Document{}} +} diff --git a/streams/gen_event.go b/streams/gen_event.go index 2c839cf..9d7e4b8 100644 --- a/streams/gen_event.go +++ b/streams/gen_event.go @@ -2135,3 +2135,8 @@ func (t *Event) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewEvent returns a new instance of Event +func NewEvent() (n *Event) { + return &Event{raw: &vocab.Event{}} +} diff --git a/streams/gen_flag.go b/streams/gen_flag.go index b931b70..07327f6 100644 --- a/streams/gen_flag.go +++ b/streams/gen_flag.go @@ -2494,3 +2494,8 @@ func (t *Flag) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewFlag returns a new instance of Flag +func NewFlag() (n *Flag) { + return &Flag{raw: &vocab.Flag{}} +} diff --git a/streams/gen_follow.go b/streams/gen_follow.go index 12a11de..e620cd3 100644 --- a/streams/gen_follow.go +++ b/streams/gen_follow.go @@ -2494,3 +2494,8 @@ func (t *Follow) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewFollow returns a new instance of Follow +func NewFollow() (n *Follow) { + return &Follow{raw: &vocab.Follow{}} +} diff --git a/streams/gen_group.go b/streams/gen_group.go index f32a338..8eabac8 100644 --- a/streams/gen_group.go +++ b/streams/gen_group.go @@ -2135,3 +2135,8 @@ func (t *Group) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewGroup returns a new instance of Group +func NewGroup() (n *Group) { + return &Group{raw: &vocab.Group{}} +} diff --git a/streams/gen_ignore.go b/streams/gen_ignore.go index 6ed2244..e192df4 100644 --- a/streams/gen_ignore.go +++ b/streams/gen_ignore.go @@ -2494,3 +2494,8 @@ func (t *Ignore) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewIgnore returns a new instance of Ignore +func NewIgnore() (n *Ignore) { + return &Ignore{raw: &vocab.Ignore{}} +} diff --git a/streams/gen_image.go b/streams/gen_image.go index 2d122e6..a68a8f4 100644 --- a/streams/gen_image.go +++ b/streams/gen_image.go @@ -2203,3 +2203,8 @@ func (t *Image) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewImage returns a new instance of Image +func NewImage() (n *Image) { + return &Image{raw: &vocab.Image{}} +} diff --git a/streams/gen_intransitiveactivity.go b/streams/gen_intransitiveactivity.go index 126f9dd..6fed514 100644 --- a/streams/gen_intransitiveactivity.go +++ b/streams/gen_intransitiveactivity.go @@ -2442,3 +2442,8 @@ func (t *IntransitiveActivity) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewIntransitiveActivity returns a new instance of IntransitiveActivity +func NewIntransitiveActivity() (n *IntransitiveActivity) { + return &IntransitiveActivity{raw: &vocab.IntransitiveActivity{}} +} diff --git a/streams/gen_invite.go b/streams/gen_invite.go index f366a40..1928de5 100644 --- a/streams/gen_invite.go +++ b/streams/gen_invite.go @@ -2494,3 +2494,8 @@ func (t *Invite) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewInvite returns a new instance of Invite +func NewInvite() (n *Invite) { + return &Invite{raw: &vocab.Invite{}} +} diff --git a/streams/gen_join.go b/streams/gen_join.go index e6000d9..9b6c7b3 100644 --- a/streams/gen_join.go +++ b/streams/gen_join.go @@ -2494,3 +2494,8 @@ func (t *Join) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewJoin returns a new instance of Join +func NewJoin() (n *Join) { + return &Join{raw: &vocab.Join{}} +} diff --git a/streams/gen_leave.go b/streams/gen_leave.go index 7976779..29c6c54 100644 --- a/streams/gen_leave.go +++ b/streams/gen_leave.go @@ -2494,3 +2494,8 @@ func (t *Leave) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewLeave returns a new instance of Leave +func NewLeave() (n *Leave) { + return &Leave{raw: &vocab.Leave{}} +} diff --git a/streams/gen_like.go b/streams/gen_like.go index 5e734ac..4af52aa 100644 --- a/streams/gen_like.go +++ b/streams/gen_like.go @@ -2494,3 +2494,8 @@ func (t *Like) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewLike returns a new instance of Like +func NewLike() (n *Like) { + return &Like{raw: &vocab.Like{}} +} diff --git a/streams/gen_link.go b/streams/gen_link.go index cac7af5..3ff4210 100644 --- a/streams/gen_link.go +++ b/streams/gen_link.go @@ -579,3 +579,8 @@ func (t *Link) PrependPreviewLink(i vocab.LinkType) { t.raw.PrependPreviewLink(i) } + +// NewLink returns a new instance of Link +func NewLink() (n *Link) { + return &Link{raw: &vocab.Link{}} +} diff --git a/streams/gen_listen.go b/streams/gen_listen.go index 4a2ac14..c6d17fe 100644 --- a/streams/gen_listen.go +++ b/streams/gen_listen.go @@ -2494,3 +2494,8 @@ func (t *Listen) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewListen returns a new instance of Listen +func NewListen() (n *Listen) { + return &Listen{raw: &vocab.Listen{}} +} diff --git a/streams/gen_mention.go b/streams/gen_mention.go index 59722ac..fe7d7e3 100644 --- a/streams/gen_mention.go +++ b/streams/gen_mention.go @@ -579,3 +579,8 @@ func (t *Mention) PrependPreviewLink(i vocab.LinkType) { t.raw.PrependPreviewLink(i) } + +// NewMention returns a new instance of Mention +func NewMention() (n *Mention) { + return &Mention{raw: &vocab.Mention{}} +} diff --git a/streams/gen_move.go b/streams/gen_move.go index ee476a7..ac26fb7 100644 --- a/streams/gen_move.go +++ b/streams/gen_move.go @@ -2494,3 +2494,8 @@ func (t *Move) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewMove returns a new instance of Move +func NewMove() (n *Move) { + return &Move{raw: &vocab.Move{}} +} diff --git a/streams/gen_note.go b/streams/gen_note.go index 0b79f9c..d0580b1 100644 --- a/streams/gen_note.go +++ b/streams/gen_note.go @@ -2135,3 +2135,8 @@ func (t *Note) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewNote returns a new instance of Note +func NewNote() (n *Note) { + return &Note{raw: &vocab.Note{}} +} diff --git a/streams/gen_object.go b/streams/gen_object.go index f065c3d..185f42d 100644 --- a/streams/gen_object.go +++ b/streams/gen_object.go @@ -2135,3 +2135,8 @@ func (t *Object) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewObject returns a new instance of Object +func NewObject() (n *Object) { + return &Object{raw: &vocab.Object{}} +} diff --git a/streams/gen_offer.go b/streams/gen_offer.go index eba4bae..2dd56bd 100644 --- a/streams/gen_offer.go +++ b/streams/gen_offer.go @@ -2494,3 +2494,8 @@ func (t *Offer) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewOffer returns a new instance of Offer +func NewOffer() (n *Offer) { + return &Offer{raw: &vocab.Offer{}} +} diff --git a/streams/gen_orderedcollection.go b/streams/gen_orderedcollection.go index 16dcaa7..e025879 100644 --- a/streams/gen_orderedcollection.go +++ b/streams/gen_orderedcollection.go @@ -2348,3 +2348,8 @@ func (t *OrderedCollection) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewOrderedCollection returns a new instance of OrderedCollection +func NewOrderedCollection() (n *OrderedCollection) { + return &OrderedCollection{raw: &vocab.OrderedCollection{}} +} diff --git a/streams/gen_orderedcollectionpage.go b/streams/gen_orderedcollectionpage.go index f872cd3..e7ab4ad 100644 --- a/streams/gen_orderedcollectionpage.go +++ b/streams/gen_orderedcollectionpage.go @@ -2496,3 +2496,8 @@ func (t *OrderedCollectionPage) SetPartOf(i vocab.LinkType) { t.raw.SetPartOfLink(i) } + +// NewOrderedCollectionPage returns a new instance of OrderedCollectionPage +func NewOrderedCollectionPage() (n *OrderedCollectionPage) { + return &OrderedCollectionPage{raw: &vocab.OrderedCollectionPage{}} +} diff --git a/streams/gen_organization.go b/streams/gen_organization.go index e9983fb..cb8145b 100644 --- a/streams/gen_organization.go +++ b/streams/gen_organization.go @@ -2135,3 +2135,8 @@ func (t *Organization) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewOrganization returns a new instance of Organization +func NewOrganization() (n *Organization) { + return &Organization{raw: &vocab.Organization{}} +} diff --git a/streams/gen_page.go b/streams/gen_page.go index 874416d..a0baba8 100644 --- a/streams/gen_page.go +++ b/streams/gen_page.go @@ -2135,3 +2135,8 @@ func (t *Page) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewPage returns a new instance of Page +func NewPage() (n *Page) { + return &Page{raw: &vocab.Page{}} +} diff --git a/streams/gen_person.go b/streams/gen_person.go index 1d8beb7..affebae 100644 --- a/streams/gen_person.go +++ b/streams/gen_person.go @@ -2135,3 +2135,8 @@ func (t *Person) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewPerson returns a new instance of Person +func NewPerson() (n *Person) { + return &Person{raw: &vocab.Person{}} +} diff --git a/streams/gen_place.go b/streams/gen_place.go index bfa8e08..bb881df 100644 --- a/streams/gen_place.go +++ b/streams/gen_place.go @@ -2305,3 +2305,8 @@ func (t *Place) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewPlace returns a new instance of Place +func NewPlace() (n *Place) { + return &Place{raw: &vocab.Place{}} +} diff --git a/streams/gen_profile.go b/streams/gen_profile.go index ee4f6a8..c958812 100644 --- a/streams/gen_profile.go +++ b/streams/gen_profile.go @@ -2169,3 +2169,8 @@ func (t *Profile) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewProfile returns a new instance of Profile +func NewProfile() (n *Profile) { + return &Profile{raw: &vocab.Profile{}} +} diff --git a/streams/gen_question.go b/streams/gen_question.go index 8d7dd65..a14a9eb 100644 --- a/streams/gen_question.go +++ b/streams/gen_question.go @@ -2636,3 +2636,8 @@ func (t *Question) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewQuestion returns a new instance of Question +func NewQuestion() (n *Question) { + return &Question{raw: &vocab.Question{}} +} diff --git a/streams/gen_read.go b/streams/gen_read.go index 5e17f0b..892d063 100644 --- a/streams/gen_read.go +++ b/streams/gen_read.go @@ -2494,3 +2494,8 @@ func (t *Read) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewRead returns a new instance of Read +func NewRead() (n *Read) { + return &Read{raw: &vocab.Read{}} +} diff --git a/streams/gen_reject.go b/streams/gen_reject.go index 6226219..157e445 100644 --- a/streams/gen_reject.go +++ b/streams/gen_reject.go @@ -2494,3 +2494,8 @@ func (t *Reject) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewReject returns a new instance of Reject +func NewReject() (n *Reject) { + return &Reject{raw: &vocab.Reject{}} +} diff --git a/streams/gen_relationship.go b/streams/gen_relationship.go index 0118782..628cfe3 100644 --- a/streams/gen_relationship.go +++ b/streams/gen_relationship.go @@ -2268,3 +2268,8 @@ func (t *Relationship) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewRelationship returns a new instance of Relationship +func NewRelationship() (n *Relationship) { + return &Relationship{raw: &vocab.Relationship{}} +} diff --git a/streams/gen_remove.go b/streams/gen_remove.go index 994b775..cf72e2e 100644 --- a/streams/gen_remove.go +++ b/streams/gen_remove.go @@ -2494,3 +2494,8 @@ func (t *Remove) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewRemove returns a new instance of Remove +func NewRemove() (n *Remove) { + return &Remove{raw: &vocab.Remove{}} +} diff --git a/streams/gen_service.go b/streams/gen_service.go index 8c54047..fd76c24 100644 --- a/streams/gen_service.go +++ b/streams/gen_service.go @@ -2135,3 +2135,8 @@ func (t *Service) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewService returns a new instance of Service +func NewService() (n *Service) { + return &Service{raw: &vocab.Service{}} +} diff --git a/streams/gen_tentativeaccept.go b/streams/gen_tentativeaccept.go index a862a28..e032235 100644 --- a/streams/gen_tentativeaccept.go +++ b/streams/gen_tentativeaccept.go @@ -2494,3 +2494,8 @@ func (t *TentativeAccept) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewTentativeAccept returns a new instance of TentativeAccept +func NewTentativeAccept() (n *TentativeAccept) { + return &TentativeAccept{raw: &vocab.TentativeAccept{}} +} diff --git a/streams/gen_tentativereject.go b/streams/gen_tentativereject.go index 8eef587..f08a7bd 100644 --- a/streams/gen_tentativereject.go +++ b/streams/gen_tentativereject.go @@ -2494,3 +2494,8 @@ func (t *TentativeReject) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewTentativeReject returns a new instance of TentativeReject +func NewTentativeReject() (n *TentativeReject) { + return &TentativeReject{raw: &vocab.TentativeReject{}} +} diff --git a/streams/gen_tombstone.go b/streams/gen_tombstone.go index 39c424c..4dbdea1 100644 --- a/streams/gen_tombstone.go +++ b/streams/gen_tombstone.go @@ -2225,3 +2225,8 @@ func (t *Tombstone) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewTombstone returns a new instance of Tombstone +func NewTombstone() (n *Tombstone) { + return &Tombstone{raw: &vocab.Tombstone{}} +} diff --git a/streams/gen_travel.go b/streams/gen_travel.go index bd6471f..d9e6d22 100644 --- a/streams/gen_travel.go +++ b/streams/gen_travel.go @@ -2442,3 +2442,8 @@ func (t *Travel) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewTravel returns a new instance of Travel +func NewTravel() (n *Travel) { + return &Travel{raw: &vocab.Travel{}} +} diff --git a/streams/gen_undo.go b/streams/gen_undo.go index d47b6f0..ed608ce 100644 --- a/streams/gen_undo.go +++ b/streams/gen_undo.go @@ -2494,3 +2494,8 @@ func (t *Undo) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewUndo returns a new instance of Undo +func NewUndo() (n *Undo) { + return &Undo{raw: &vocab.Undo{}} +} diff --git a/streams/gen_update.go b/streams/gen_update.go index 79d8d7d..9a3048d 100644 --- a/streams/gen_update.go +++ b/streams/gen_update.go @@ -2494,3 +2494,8 @@ func (t *Update) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewUpdate returns a new instance of Update +func NewUpdate() (n *Update) { + return &Update{raw: &vocab.Update{}} +} diff --git a/streams/gen_video.go b/streams/gen_video.go index 6cde7e5..780fe8e 100644 --- a/streams/gen_video.go +++ b/streams/gen_video.go @@ -2135,3 +2135,8 @@ func (t *Video) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewVideo returns a new instance of Video +func NewVideo() (n *Video) { + return &Video{raw: &vocab.Video{}} +} diff --git a/streams/gen_view.go b/streams/gen_view.go index 479ce64..d79fc24 100644 --- a/streams/gen_view.go +++ b/streams/gen_view.go @@ -2494,3 +2494,8 @@ func (t *View) SetShares(i vocab.CollectionType) { t.raw.SetSharesCollection(i) } + +// NewView returns a new instance of View +func NewView() (n *View) { + return &View{raw: &vocab.View{}} +} diff --git a/tools/streams/gen/as.go b/tools/streams/gen/as.go index 01336ba..c66bdd3 100644 --- a/tools/streams/gen/as.go +++ b/tools/streams/gen/as.go @@ -270,6 +270,16 @@ func generateDefinitions(t *defs.Type) (fd []*defs.FunctionDef, sd []*defs.Struc }, }, }...) + fd = append(fd, &defs.FunctionDef{ + Name: fmt.Sprintf("New%s", t.Name), + Comment: fmt.Sprintf("New%s returns a new instance of %s", t.Name, t.Name), + Return: []*defs.FunctionVarDef{{"n", "*" + t.Name}}, + Body: func() string { + var b bytes.Buffer + b.WriteString(fmt.Sprintf("return &%s{%s: &vocab.%s{}}", t.Name, rawMemberName, t.Name)) + return b.String() + }, + }) if t.GetTypeMetadata().HasIsPublicMethod { this.F = append(this.F, &defs.MemberFunctionDef{ Name: "IsPublic",