Skip to content

Commit

Permalink
Add the missing 'shares' property to streams.Object
Browse files Browse the repository at this point in the history
  • Loading branch information
cjslep committed Aug 21, 2018
1 parent befab36 commit bd6369d
Show file tree
Hide file tree
Showing 52 changed files with 1,976 additions and 0 deletions.
38 changes: 38 additions & 0 deletions streams/gen_accept.go
Expand Up @@ -2456,3 +2456,41 @@ func (t *Accept) SetSharedInbox(k *url.URL) {
t.raw.SetSharedInbox(k)

}

// ResolveShares passes the actual concrete type to the resolver for handing property shares. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Accept) ResolveShares(r *Resolver) (s Resolution, err error) {
s = Unresolved
handled := false
if t.raw.IsSharesCollection() {
handled, err = r.dispatch(t.raw.GetSharesCollection())
if handled {
s = Resolved
}
} else if t.raw.IsSharesOrderedCollection() {
s = RawResolutionNeeded
} else if t.raw.IsSharesAnyURI() {
s = RawResolutionNeeded
}
return

}

// HasShares returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Accept) HasShares() (p Presence) {
p = NoPresence
if t.raw.IsSharesCollection() {
p = ConvenientPresence
} else if t.raw.IsSharesOrderedCollection() {
p = RawPresence
} else if t.raw.IsSharesAnyURI() {
p = RawPresence
}
return

}

// SetShares sets this value to be a 'Collection' type.
func (t *Accept) SetShares(i vocab.CollectionType) {
t.raw.SetSharesCollection(i)

}
38 changes: 38 additions & 0 deletions streams/gen_activity.go
Expand Up @@ -2456,3 +2456,41 @@ func (t *Activity) SetSharedInbox(k *url.URL) {
t.raw.SetSharedInbox(k)

}

// ResolveShares passes the actual concrete type to the resolver for handing property shares. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Activity) ResolveShares(r *Resolver) (s Resolution, err error) {
s = Unresolved
handled := false
if t.raw.IsSharesCollection() {
handled, err = r.dispatch(t.raw.GetSharesCollection())
if handled {
s = Resolved
}
} else if t.raw.IsSharesOrderedCollection() {
s = RawResolutionNeeded
} else if t.raw.IsSharesAnyURI() {
s = RawResolutionNeeded
}
return

}

// HasShares returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Activity) HasShares() (p Presence) {
p = NoPresence
if t.raw.IsSharesCollection() {
p = ConvenientPresence
} else if t.raw.IsSharesOrderedCollection() {
p = RawPresence
} else if t.raw.IsSharesAnyURI() {
p = RawPresence
}
return

}

// SetShares sets this value to be a 'Collection' type.
func (t *Activity) SetShares(i vocab.CollectionType) {
t.raw.SetSharesCollection(i)

}
38 changes: 38 additions & 0 deletions streams/gen_add.go
Expand Up @@ -2456,3 +2456,41 @@ func (t *Add) SetSharedInbox(k *url.URL) {
t.raw.SetSharedInbox(k)

}

// ResolveShares passes the actual concrete type to the resolver for handing property shares. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Add) ResolveShares(r *Resolver) (s Resolution, err error) {
s = Unresolved
handled := false
if t.raw.IsSharesCollection() {
handled, err = r.dispatch(t.raw.GetSharesCollection())
if handled {
s = Resolved
}
} else if t.raw.IsSharesOrderedCollection() {
s = RawResolutionNeeded
} else if t.raw.IsSharesAnyURI() {
s = RawResolutionNeeded
}
return

}

// HasShares returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Add) HasShares() (p Presence) {
p = NoPresence
if t.raw.IsSharesCollection() {
p = ConvenientPresence
} else if t.raw.IsSharesOrderedCollection() {
p = RawPresence
} else if t.raw.IsSharesAnyURI() {
p = RawPresence
}
return

}

// SetShares sets this value to be a 'Collection' type.
func (t *Add) SetShares(i vocab.CollectionType) {
t.raw.SetSharesCollection(i)

}
38 changes: 38 additions & 0 deletions streams/gen_announce.go
Expand Up @@ -2456,3 +2456,41 @@ func (t *Announce) SetSharedInbox(k *url.URL) {
t.raw.SetSharedInbox(k)

}

// ResolveShares passes the actual concrete type to the resolver for handing property shares. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Announce) ResolveShares(r *Resolver) (s Resolution, err error) {
s = Unresolved
handled := false
if t.raw.IsSharesCollection() {
handled, err = r.dispatch(t.raw.GetSharesCollection())
if handled {
s = Resolved
}
} else if t.raw.IsSharesOrderedCollection() {
s = RawResolutionNeeded
} else if t.raw.IsSharesAnyURI() {
s = RawResolutionNeeded
}
return

}

// HasShares returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Announce) HasShares() (p Presence) {
p = NoPresence
if t.raw.IsSharesCollection() {
p = ConvenientPresence
} else if t.raw.IsSharesOrderedCollection() {
p = RawPresence
} else if t.raw.IsSharesAnyURI() {
p = RawPresence
}
return

}

// SetShares sets this value to be a 'Collection' type.
func (t *Announce) SetShares(i vocab.CollectionType) {
t.raw.SetSharesCollection(i)

}
38 changes: 38 additions & 0 deletions streams/gen_application.go
Expand Up @@ -2097,3 +2097,41 @@ func (t *Application) SetSharedInbox(k *url.URL) {
t.raw.SetSharedInbox(k)

}

// ResolveShares passes the actual concrete type to the resolver for handing property shares. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Application) ResolveShares(r *Resolver) (s Resolution, err error) {
s = Unresolved
handled := false
if t.raw.IsSharesCollection() {
handled, err = r.dispatch(t.raw.GetSharesCollection())
if handled {
s = Resolved
}
} else if t.raw.IsSharesOrderedCollection() {
s = RawResolutionNeeded
} else if t.raw.IsSharesAnyURI() {
s = RawResolutionNeeded
}
return

}

// HasShares returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Application) HasShares() (p Presence) {
p = NoPresence
if t.raw.IsSharesCollection() {
p = ConvenientPresence
} else if t.raw.IsSharesOrderedCollection() {
p = RawPresence
} else if t.raw.IsSharesAnyURI() {
p = RawPresence
}
return

}

// SetShares sets this value to be a 'Collection' type.
func (t *Application) SetShares(i vocab.CollectionType) {
t.raw.SetSharesCollection(i)

}
38 changes: 38 additions & 0 deletions streams/gen_arrive.go
Expand Up @@ -2404,3 +2404,41 @@ func (t *Arrive) SetSharedInbox(k *url.URL) {
t.raw.SetSharedInbox(k)

}

// ResolveShares passes the actual concrete type to the resolver for handing property shares. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Arrive) ResolveShares(r *Resolver) (s Resolution, err error) {
s = Unresolved
handled := false
if t.raw.IsSharesCollection() {
handled, err = r.dispatch(t.raw.GetSharesCollection())
if handled {
s = Resolved
}
} else if t.raw.IsSharesOrderedCollection() {
s = RawResolutionNeeded
} else if t.raw.IsSharesAnyURI() {
s = RawResolutionNeeded
}
return

}

// HasShares returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Arrive) HasShares() (p Presence) {
p = NoPresence
if t.raw.IsSharesCollection() {
p = ConvenientPresence
} else if t.raw.IsSharesOrderedCollection() {
p = RawPresence
} else if t.raw.IsSharesAnyURI() {
p = RawPresence
}
return

}

// SetShares sets this value to be a 'Collection' type.
func (t *Arrive) SetShares(i vocab.CollectionType) {
t.raw.SetSharesCollection(i)

}
38 changes: 38 additions & 0 deletions streams/gen_article.go
Expand Up @@ -2097,3 +2097,41 @@ func (t *Article) SetSharedInbox(k *url.URL) {
t.raw.SetSharedInbox(k)

}

// ResolveShares passes the actual concrete type to the resolver for handing property shares. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Article) ResolveShares(r *Resolver) (s Resolution, err error) {
s = Unresolved
handled := false
if t.raw.IsSharesCollection() {
handled, err = r.dispatch(t.raw.GetSharesCollection())
if handled {
s = Resolved
}
} else if t.raw.IsSharesOrderedCollection() {
s = RawResolutionNeeded
} else if t.raw.IsSharesAnyURI() {
s = RawResolutionNeeded
}
return

}

// HasShares returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Article) HasShares() (p Presence) {
p = NoPresence
if t.raw.IsSharesCollection() {
p = ConvenientPresence
} else if t.raw.IsSharesOrderedCollection() {
p = RawPresence
} else if t.raw.IsSharesAnyURI() {
p = RawPresence
}
return

}

// SetShares sets this value to be a 'Collection' type.
func (t *Article) SetShares(i vocab.CollectionType) {
t.raw.SetSharesCollection(i)

}
38 changes: 38 additions & 0 deletions streams/gen_audio.go
Expand Up @@ -2097,3 +2097,41 @@ func (t *Audio) SetSharedInbox(k *url.URL) {
t.raw.SetSharedInbox(k)

}

// ResolveShares passes the actual concrete type to the resolver for handing property shares. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Audio) ResolveShares(r *Resolver) (s Resolution, err error) {
s = Unresolved
handled := false
if t.raw.IsSharesCollection() {
handled, err = r.dispatch(t.raw.GetSharesCollection())
if handled {
s = Resolved
}
} else if t.raw.IsSharesOrderedCollection() {
s = RawResolutionNeeded
} else if t.raw.IsSharesAnyURI() {
s = RawResolutionNeeded
}
return

}

// HasShares returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Audio) HasShares() (p Presence) {
p = NoPresence
if t.raw.IsSharesCollection() {
p = ConvenientPresence
} else if t.raw.IsSharesOrderedCollection() {
p = RawPresence
} else if t.raw.IsSharesAnyURI() {
p = RawPresence
}
return

}

// SetShares sets this value to be a 'Collection' type.
func (t *Audio) SetShares(i vocab.CollectionType) {
t.raw.SetSharesCollection(i)

}
38 changes: 38 additions & 0 deletions streams/gen_block.go
Expand Up @@ -2456,3 +2456,41 @@ func (t *Block) SetSharedInbox(k *url.URL) {
t.raw.SetSharedInbox(k)

}

// ResolveShares passes the actual concrete type to the resolver for handing property shares. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Block) ResolveShares(r *Resolver) (s Resolution, err error) {
s = Unresolved
handled := false
if t.raw.IsSharesCollection() {
handled, err = r.dispatch(t.raw.GetSharesCollection())
if handled {
s = Resolved
}
} else if t.raw.IsSharesOrderedCollection() {
s = RawResolutionNeeded
} else if t.raw.IsSharesAnyURI() {
s = RawResolutionNeeded
}
return

}

// HasShares returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func (t *Block) HasShares() (p Presence) {
p = NoPresence
if t.raw.IsSharesCollection() {
p = ConvenientPresence
} else if t.raw.IsSharesOrderedCollection() {
p = RawPresence
} else if t.raw.IsSharesAnyURI() {
p = RawPresence
}
return

}

// SetShares sets this value to be a 'Collection' type.
func (t *Block) SetShares(i vocab.CollectionType) {
t.raw.SetSharesCollection(i)

}

0 comments on commit bd6369d

Please sign in to comment.