[feature] Enable federation in/out of profile PropertyValue fields (#1722)

Co-authored-by: kim <grufwub@gmail.com>
Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
This commit is contained in:
tobi 2023-05-09 12:16:10 +02:00 committed by GitHub
parent cbb9e2d3f0
commit 0e29f1f5bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
180 changed files with 9278 additions and 1550 deletions

View file

@ -324,3 +324,59 @@ When a GoToSocial instance receives a `Delete`, it will attempt to derive the de
Then, GoToSocial will check if it has a post stored with the given URI. If it does, it will be completely deleted from the database and all user timelines.
GoToSocial will only delete a post if it can be sure that the original post was owned by the `actor` that the `Delete` is attributed to.
## Profile Fields
Like Mastodon and other fediverse softwares, GoToSocial lets users set key/value pairs on their profile; useful for conveying short pieces of information like links, pronouns, age, etc.
For the sake of compatibility with other implementations, GoToSocial uses the same schema.org PropertyValue extension that Mastodon uses, present as an `attachment` array value on `actor`s that have fields set. For example, the below JSON shows an account with two PropertyValue fields:
```json
{
"@context": [
"http://joinmastodon.org/ns",
"https://w3id.org/security/v1",
"https://www.w3.org/ns/activitystreams",
"http://schema.org"
],
"attachment": [
{
"name": "should you follow me?",
"type": "PropertyValue",
"value": "maybe!"
},
{
"name": "age",
"type": "PropertyValue",
"value": "120"
}
],
"discoverable": false,
"featured": "http://example.org/users/1happyturtle/collections/featured",
"followers": "http://example.org/users/1happyturtle/followers",
"following": "http://example.org/users/1happyturtle/following",
"id": "http://example.org/users/1happyturtle",
"inbox": "http://example.org/users/1happyturtle/inbox",
"manuallyApprovesFollowers": true,
"name": "happy little turtle :3",
"outbox": "http://example.org/users/1happyturtle/outbox",
"preferredUsername": "1happyturtle",
"publicKey": {
"id": "http://example.org/users/1happyturtle#main-key",
"owner": "http://example.org/users/1happyturtle",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtTc6Jpg6LrRPhVQG4KLz\n2+YqEUUtZPd4YR+TKXuCnwEG9ZNGhgP046xa9h3EWzrZXaOhXvkUQgJuRqPrAcfN\nvc8jBHV2xrUeD8pu/MWKEabAsA/tgCv3nUC47HQ3/c12aHfYoPz3ufWsGGnrkhci\nv8PaveJ3LohO5vjCn1yZ00v6osMJMViEZvZQaazyE9A8FwraIexXabDpoy7tkHRg\nA1fvSkg4FeSG1XMcIz2NN7xyUuFACD+XkuOk7UqzRd4cjPUPLxiDwIsTlcgGOd3E\nUFMWVlPxSGjY2hIKa3lEHytaYK9IMYdSuyCsJshd3/yYC9LqxZY2KdlKJ80VOVyh\nyQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"summary": "\u003cp\u003ei post about things that concern me\u003c/p\u003e",
"tag": [],
"type": "Person",
"url": "http://example.org/@1happyturtle"
}
```
For `actor`s that have no `PropertyValue` fields set, the `attachment` property will not be set at all. That is, the `attachment` key value will not be present on the `actor` (not even as an empty array or null value).
While `attachment` is not technically an ordered collection, GoToSocial--again, in line with what other implementations do--does present `attachment` `PropertyValue` fields in the order in which they should to be displayed.
GoToSocial will also parse PropertyValue fields from remote `actor`s discovered by the GoToSocial instance, to allow them to be displayed to users on the GoToSocial instance.
GoToSocial allows up to 6 `PropertyValue` fields by default, as opposed to Mastodon's default 4.

2
go.mod
View file

@ -41,7 +41,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.2
github.com/superseriousbusiness/activity v1.2.2-gts
github.com/superseriousbusiness/activity v1.3.0-gts
github.com/superseriousbusiness/exif-terminator v0.5.0
github.com/superseriousbusiness/oauth2/v4 v4.3.2-SSB.0.20230227143000-f4900831d6c8
github.com/tdewolff/minify/v2 v2.12.5

4
go.sum
View file

@ -541,8 +541,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/sunfish-shogi/bufseekio v0.0.0-20210207115823-a4185644b365/go.mod h1:dEzdXgvImkQ3WLI+0KQpmEx8T/C/ma9KeS3AfmU899I=
github.com/superseriousbusiness/activity v1.2.2-gts h1:7duR8MCbYIKyM4UkeSkze2S/2+ve1XHs8kVfaFg58UI=
github.com/superseriousbusiness/activity v1.2.2-gts/go.mod h1:AZw0Xb4Oju8rmaJCZ21gc5CPg47MmNgyac+Hx5jo8VM=
github.com/superseriousbusiness/activity v1.3.0-gts h1:59H3gQIIUK5xefloMmBKCRbl/YUJFzWcy1Qx4zEZkS4=
github.com/superseriousbusiness/activity v1.3.0-gts/go.mod h1:AZw0Xb4Oju8rmaJCZ21gc5CPg47MmNgyac+Hx5jo8VM=
github.com/superseriousbusiness/exif-terminator v0.5.0 h1:57SO/geyaOl2v/lJSQLVcQbdghpyFuK8ZTtaHL81fUQ=
github.com/superseriousbusiness/exif-terminator v0.5.0/go.mod h1:d5IkskXco/3XRXzOrI73uGYn+wahJEqPlQSSqn6jxSw=
github.com/superseriousbusiness/go-jpeg-image-structure/v2 v2.0.0-20220321154430-d89a106fdabe h1:ksl2oCx/Qo8sNDc3Grb8WGKBM9nkvhCm25uvlT86azE=

View file

@ -266,6 +266,59 @@ func ExtractSummary(i WithSummary) string {
return ""
}
func ExtractFields(i WithAttachment) []*gtsmodel.Field {
attachmentProp := i.GetActivityStreamsAttachment()
if attachmentProp == nil {
// Nothing to do.
return nil
}
l := attachmentProp.Len()
if l == 0 {
// Nothing to do.
return nil
}
fields := make([]*gtsmodel.Field, 0, l)
for iter := attachmentProp.Begin(); iter != attachmentProp.End(); iter = iter.Next() {
if !iter.IsSchemaPropertyValue() {
continue
}
propertyValue := iter.GetSchemaPropertyValue()
if propertyValue == nil {
continue
}
nameProp := propertyValue.GetActivityStreamsName()
if nameProp == nil || nameProp.Len() != 1 {
continue
}
name := nameProp.At(0).GetXMLSchemaString()
if name == "" {
continue
}
valueProp := propertyValue.GetSchemaValue()
if valueProp == nil || !valueProp.IsXMLSchemaString() {
continue
}
value := valueProp.Get()
if value == "" {
continue
}
fields = append(fields, &gtsmodel.Field{
Name: name,
Value: value,
})
}
return fields
}
// ExtractDiscoverable extracts the Discoverable boolean of an interface.
func ExtractDiscoverable(i WithDiscoverable) (bool, error) {
if i.GetTootDiscoverable() == nil {

View file

@ -30,6 +30,7 @@ type Accountable interface {
WithName
WithImage
WithSummary
WithAttachment
WithSetSummary
WithDiscoverable
WithURL

View file

@ -22,14 +22,23 @@
"github.com/superseriousbusiness/activity/streams"
)
// NormalizeActivityObject normalizes the 'object'.'content' field of the given Activity.
/*
NORMALIZE INCOMING
The below functions should be called to normalize the content
of messages *COMING INTO* GoToSocial via the federation API,
either as the result of delivery from a remote instance to this
instance, or as a result of this instance doing an http call to
another instance to dereference something.
*/
// NormalizeIncomingActivityObject normalizes the 'object'.'content' field of the given Activity.
//
// The rawActivity map should the freshly deserialized json representation of the Activity.
//
// This function is a noop if the type passed in is anything except a Create with a Statusable as its Object.
func NormalizeActivityObject(activity pub.Activity, rawJSON map[string]interface{}) {
if activity.GetTypeName() != ActivityCreate {
// Only interested in Create right now.
// This function is a noop if the type passed in is anything except a Create or Update with a Statusable or Accountable as its Object.
func NormalizeIncomingActivityObject(activity pub.Activity, rawJSON map[string]interface{}) {
if typeName := activity.GetTypeName(); typeName != ActivityCreate && typeName != ActivityUpdate {
// Only interested in Create or Update right now.
return
}
@ -51,8 +60,8 @@ func NormalizeActivityObject(activity pub.Activity, rawJSON map[string]interface
}
// We now know length is 1 so get the first
// item from the iter. We need this to be
// a Statusable if we're to continue.
// item from the iter. We need this to be
// a Statusable or Accountable if we're to continue.
i := createObject.At(0)
if i == nil {
// This is awkward.
@ -65,38 +74,63 @@ func NormalizeActivityObject(activity pub.Activity, rawJSON map[string]interface
return
}
statusable, ok := t.(Statusable)
if !ok {
// Object is not Statusable;
// we're not interested.
return
}
switch t.GetTypeName() {
case ObjectArticle, ObjectDocument, ObjectImage, ObjectVideo, ObjectNote, ObjectPage, ObjectEvent, ObjectPlace, ObjectProfile:
statusable, ok := t.(Statusable)
if !ok {
// Object is not Statusable;
// we're not interested.
return
}
rawObject, ok := rawJSON["object"]
if !ok {
// No object in raw map.
return
}
rawObject, ok := rawJSON["object"]
if !ok {
// No object in raw map.
return
}
rawStatusableJSON, ok := rawObject.(map[string]interface{})
if !ok {
// Object wasn't a json object.
return
}
rawStatusableJSON, ok := rawObject.(map[string]interface{})
if !ok {
// Object wasn't a json object.
return
}
// Normalize everything we can on the statusable.
NormalizeContent(statusable, rawStatusableJSON)
NormalizeAttachments(statusable, rawStatusableJSON)
NormalizeSummary(statusable, rawStatusableJSON)
NormalizeName(statusable, rawStatusableJSON)
// Normalize everything we can on the statusable.
NormalizeIncomingContent(statusable, rawStatusableJSON)
NormalizeIncomingAttachments(statusable, rawStatusableJSON)
NormalizeIncomingSummary(statusable, rawStatusableJSON)
NormalizeIncomingName(statusable, rawStatusableJSON)
case ActorApplication, ActorGroup, ActorOrganization, ActorPerson, ActorService:
accountable, ok := t.(Accountable)
if !ok {
// Object is not Accountable;
// we're not interested.
return
}
rawObject, ok := rawJSON["object"]
if !ok {
// No object in raw map.
return
}
rawAccountableJSON, ok := rawObject.(map[string]interface{})
if !ok {
// Object wasn't a json object.
return
}
// Normalize everything we can on the accountable.
NormalizeIncomingSummary(accountable, rawAccountableJSON)
}
}
// NormalizeContent replaces the Content of the given item
// NormalizeIncomingContent replaces the Content of the given item
// with the raw 'content' value from the raw json object map.
//
// noop if there was no content in the json object map or the
// content was not a plain string.
func NormalizeContent(item WithSetContent, rawJSON map[string]interface{}) {
func NormalizeIncomingContent(item WithSetContent, rawJSON map[string]interface{}) {
rawContent, ok := rawJSON["content"]
if !ok {
// No content in rawJSON.
@ -118,13 +152,13 @@ func NormalizeContent(item WithSetContent, rawJSON map[string]interface{}) {
item.SetActivityStreamsContent(contentProp)
}
// NormalizeAttachments normalizes all attachments (if any) of the given
// itm, replacing the 'name' (aka content warning) field of each attachment
// NormalizeIncomingAttachments normalizes all attachments (if any) of the given
// item, replacing the 'name' (aka content warning) field of each attachment
// with the raw 'name' value from the raw json object map.
//
// noop if there are no attachments; noop if attachment is not a format
// we can understand.
func NormalizeAttachments(item WithAttachment, rawJSON map[string]interface{}) {
func NormalizeIncomingAttachments(item WithAttachment, rawJSON map[string]interface{}) {
rawAttachments, ok := rawJSON["attachment"]
if !ok {
// No attachments in rawJSON.
@ -173,16 +207,16 @@ func NormalizeAttachments(item WithAttachment, rawJSON map[string]interface{}) {
continue
}
NormalizeName(attachmentable, rawAttachment)
NormalizeIncomingName(attachmentable, rawAttachment)
}
}
// NormalizeSummary replaces the Summary of the given item
// NormalizeIncomingSummary replaces the Summary of the given item
// with the raw 'summary' value from the raw json object map.
//
// noop if there was no summary in the json object map or the
// summary was not a plain string.
func NormalizeSummary(item WithSetSummary, rawJSON map[string]interface{}) {
func NormalizeIncomingSummary(item WithSetSummary, rawJSON map[string]interface{}) {
rawSummary, ok := rawJSON["summary"]
if !ok {
// No summary in rawJSON.
@ -202,12 +236,12 @@ func NormalizeSummary(item WithSetSummary, rawJSON map[string]interface{}) {
item.SetActivityStreamsSummary(summaryProp)
}
// NormalizeName replaces the Name of the given item
// NormalizeIncomingName replaces the Name of the given item
// with the raw 'name' value from the raw json object map.
//
// noop if there was no name in the json object map or the
// name was not a plain string.
func NormalizeName(item WithSetName, rawJSON map[string]interface{}) {
func NormalizeIncomingName(item WithSetName, rawJSON map[string]interface{}) {
rawName, ok := rawJSON["name"]
if !ok {
// No name in rawJSON.

View file

@ -49,7 +49,7 @@ func (suite *NormalizeTestSuite) jsonToType(rawJson string) (vocab.Type, map[str
}
func (suite *NormalizeTestSuite) typeToJson(t vocab.Type) string {
m, err := streams.Serialize(t)
m, err := ap.Serialize(t)
if err != nil {
suite.FailNow(err.Error())
}
@ -223,7 +223,7 @@ func (suite *NormalizeTestSuite) TestNormalizeActivityObject() {
note,
)
ap.NormalizeActivityObject(create, map[string]interface{}{"object": rawNote})
ap.NormalizeIncomingActivityObject(create, map[string]interface{}{"object": rawNote})
suite.Equal(`UPDATE: As of this morning there are now more than 7 million Mastodon users, most from the <a class="hashtag" data-tag="twittermigration" href="https://example.org/tag/twittermigration" rel="tag ugc">#TwitterMigration</a>.<br><br>In fact, 100,000 new accounts have been created since last night.<br><br>Since last night&#39;s spike 8,000-12,000 new accounts are being created every hour.<br><br>Yesterday, I estimated that Mastodon would have 8 million users by the end of the week. That might happen a lot sooner if this trend continues.`, ap.ExtractContent(note))
}
@ -248,7 +248,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableAttachmentsOneAttachment
}`, suite.typeToJson(note))
// Normalize it!
ap.NormalizeAttachments(note, rawNote)
ap.NormalizeIncomingAttachments(note, rawNote)
// After normalization, the 'name' field of the
// attachment should no longer be all jacked up.
@ -289,7 +289,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableAttachmentsOneAttachment
}`, suite.typeToJson(note))
// Normalize it!
ap.NormalizeAttachments(note, rawNote)
ap.NormalizeIncomingAttachments(note, rawNote)
// After normalization, the 'name' field of the
// attachment should no longer be all jacked up.
@ -349,7 +349,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableAttachmentsMultipleAttac
}`, suite.typeToJson(note))
// Normalize it!
ap.NormalizeAttachments(note, rawNote)
ap.NormalizeIncomingAttachments(note, rawNote)
// After normalization, the 'name' field of the
// attachment should no longer be all jacked up.
@ -392,7 +392,7 @@ func (suite *NormalizeTestSuite) TestNormalizeAccountableSummary() {
accountable, rawAccount := suite.getAccountable()
suite.Equal(`about: I'm a #Barbie%20%23girl%20in%20a%20%23Barbie%20%23world%0ALife%20in%20plastic,%20it%27s%20fantastic%0AYou%20can%20brush%20my%20hair,%20undress%20me%20everywhere%0AImagination,%20life%20is%20your%20creation%0AI%27m%20a%20blonde%20bimbo%20girl%0AIn%20a%20fantasy%20world%0ADress%20me%20up,%20make%20it%20tight%0AI%27m%20your%20dolly%0AYou%27re%20my%20doll,%20rock%20and%20roll%0AFeel%20the%20glamour%20in%20pink%0AKiss%20me%20here,%20touch%20me%20there%0AHanky%20panky`, ap.ExtractSummary(accountable))
ap.NormalizeSummary(accountable, rawAccount)
ap.NormalizeIncomingSummary(accountable, rawAccount)
suite.Equal(`about: I'm a #Barbie #girl in a #Barbie #world
Life in plastic, it's fantastic
You can brush my hair, undress me everywhere
@ -411,7 +411,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableSummary() {
statusable, rawAccount := suite.getStatusableWithWeirdSummaryAndName()
suite.Equal(`warning: #WEIRD%20%23SUMMARY%20;;;;a;;a;asv%20%20%20%20khop8273987(*%5E&%5E)`, ap.ExtractSummary(statusable))
ap.NormalizeSummary(statusable, rawAccount)
ap.NormalizeIncomingSummary(statusable, rawAccount)
suite.Equal(`warning: #WEIRD #SUMMARY ;;;;a;;a;asv khop8273987(*^&^)`, ap.ExtractSummary(statusable))
}
@ -419,7 +419,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableName() {
statusable, rawAccount := suite.getStatusableWithWeirdSummaryAndName()
suite.Equal(`warning: #WEIRD%20%23nameEE%20;;;;a;;a;asv%20%20%20%20khop8273987(*%5E&%5E)`, ap.ExtractName(statusable))
ap.NormalizeName(statusable, rawAccount)
ap.NormalizeIncomingName(statusable, rawAccount)
suite.Equal(`WARNING: #WEIRD #nameEE ;;;;a;;a;asv khop8273987(*^&^)`, ap.ExtractName(statusable))
}

View file

@ -72,10 +72,10 @@ func ResolveStatusable(ctx context.Context, b []byte) (Statusable, error) {
return nil, newErrWrongType(err)
}
NormalizeContent(statusable, rawStatusable)
NormalizeAttachments(statusable, rawStatusable)
NormalizeSummary(statusable, rawStatusable)
NormalizeName(statusable, rawStatusable)
NormalizeIncomingContent(statusable, rawStatusable)
NormalizeIncomingAttachments(statusable, rawStatusable)
NormalizeIncomingSummary(statusable, rawStatusable)
NormalizeIncomingName(statusable, rawStatusable)
return statusable, nil
}
@ -118,7 +118,7 @@ func ResolveAccountable(ctx context.Context, b []byte) (Accountable, error) {
return nil, newErrWrongType(err)
}
NormalizeSummary(accountable, rawAccountable)
NormalizeIncomingSummary(accountable, rawAccountable)
return accountable, nil
}

View file

@ -18,13 +18,41 @@
package ap
import (
"errors"
"fmt"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/activity/streams/vocab"
)
// SerializeOrderedCollection is a custom serializer for an ActivityStreamsOrderedCollection.
// Serialize is a custom serializer for ActivityStreams types.
//
// In most cases, it will simply call the go-fed streams.Serialize function under the hood.
// However, if custom serialization is required on a specific type (eg for inter-implementation
// compatibility), it can be inserted into the switch as necessary.
//
// Callers should always call this function instead of streams.Serialize, unless there's a
// very good reason to do otherwise.
//
// Currently, the following things will be custom serialized:
//
// - OrderedCollection: 'orderedItems' property will always be made into an array.
// - Any Accountable type: 'attachment' property will always be made into an array.
// - Update: any Accountable 'object's set on an update will be custom serialized as above.
func Serialize(t vocab.Type) (m map[string]interface{}, e error) {
switch t.GetTypeName() {
case ObjectOrderedCollection:
return serializeOrderedCollection(t)
case ActorApplication, ActorGroup, ActorOrganization, ActorPerson, ActorService:
return serializeAccountable(t, true)
case ActivityUpdate:
return serializeWithObject(t)
default:
// No custom serializer necessary.
return streams.Serialize(t)
}
}
// serializeOrderedCollection is a custom serializer for an ActivityStreamsOrderedCollection.
// Unlike the standard streams.Serialize function, this serializer normalizes the orderedItems
// value to always be an array/slice, regardless of how many items are contained therein.
//
@ -33,32 +61,146 @@
// See:
// - https://github.com/go-fed/activity/issues/139
// - https://github.com/mastodon/mastodon/issues/24225
func SerializeOrderedCollection(orderedCollection vocab.ActivityStreamsOrderedCollection) (map[string]interface{}, error) {
func serializeOrderedCollection(orderedCollection vocab.Type) (map[string]interface{}, error) {
data, err := streams.Serialize(orderedCollection)
if err != nil {
return nil, err
}
return data, normalizeOrderedCollectionData(data)
}
func normalizeOrderedCollectionData(rawOrderedCollection map[string]interface{}) error {
orderedItems, ok := rawOrderedCollection["orderedItems"]
orderedItems, ok := data["orderedItems"]
if !ok {
return errors.New("no orderedItems set on OrderedCollection")
// No 'orderedItems', nothing to change.
return data, nil
}
if _, ok := orderedItems.([]interface{}); ok {
// Already slice.
return nil
return data, nil
}
orderedItemsString, ok := orderedItems.(string)
if !ok {
return errors.New("orderedItems was neither slice nor string")
}
// Coerce single-object to slice.
data["orderedItems"] = []interface{}{orderedItems}
rawOrderedCollection["orderedItems"] = []string{orderedItemsString}
return nil
return data, nil
}
// SerializeAccountable is a custom serializer for any Accountable type.
// This serializer rewrites the 'attachment' value of the Accountable, if
// present, to always be an array/slice.
//
// While this is not strictly necessary in json-ld terms, most other fedi
// implementations look for attachment to be an array of PropertyValue (field)
// entries, and will not parse single-entry, non-array attachments on accounts
// properly.
//
// If the accountable is being serialized as a top-level object (eg., for serving
// in response to an account dereference request), then includeContext should be
// set to true, so as to include the json-ld '@context' entries in the data.
// If the accountable is being serialized as part of another object (eg., as the
// object of an activity), then includeContext should be set to false, as the
// @context entry should be included on the top-level/wrapping activity/object.
func serializeAccountable(accountable vocab.Type, includeContext bool) (map[string]interface{}, error) {
var (
data map[string]interface{}
err error
)
if includeContext {
data, err = streams.Serialize(accountable)
} else {
data, err = accountable.Serialize()
}
if err != nil {
return nil, err
}
attachment, ok := data["attachment"]
if !ok {
// No 'attachment', nothing to change.
return data, nil
}
if _, ok := attachment.([]interface{}); ok {
// Already slice.
return data, nil
}
// Coerce single-object to slice.
data["attachment"] = []interface{}{attachment}
return data, nil
}
func serializeWithObject(t vocab.Type) (map[string]interface{}, error) {
withObject, ok := t.(WithObject)
if !ok {
return nil, fmt.Errorf("serializeWithObject: could not resolve %T to WithObject", t)
}
data, err := streams.Serialize(t)
if err != nil {
return nil, err
}
object := withObject.GetActivityStreamsObject()
if object == nil {
// Nothing to do, bail early.
return data, nil
}
objectLen := object.Len()
if objectLen == 0 {
// Nothing to do, bail early.
return data, nil
}
// The thing we already serialized has objects
// on it, so we should see if we need to custom
// serialize any of those objects, and replace
// them on the data map as necessary.
objects := make([]interface{}, 0, objectLen)
for iter := object.Begin(); iter != object.End(); iter = iter.Next() {
if iter.IsIRI() {
// Plain IRIs don't need custom serialization.
objects = append(objects, iter.GetIRI().String())
continue
}
var (
objectType = iter.GetType()
objectSer map[string]interface{}
)
if objectType == nil {
// This is awkward.
return nil, fmt.Errorf("serializeWithObject: could not resolve object iter %T to vocab.Type", iter)
}
switch objectType.GetTypeName() {
case ActorApplication, ActorGroup, ActorOrganization, ActorPerson, ActorService:
// @context will be included in wrapping type already,
// we don't need to include it in the object itself.
objectSer, err = serializeAccountable(objectType, false)
default:
// No custom serializer for this type; serialize as normal.
objectSer, err = objectType.Serialize()
}
if err != nil {
return nil, err
}
objects = append(objects, objectSer)
}
if objectLen == 1 {
// Unnest single object.
data["object"] = objects[0]
} else {
// Array of objects.
data["object"] = objects
}
return data, nil
}

View file

@ -32,6 +32,7 @@
"github.com/superseriousbusiness/activity/pub"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/activity/streams/vocab"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/api/activitypub/users"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
@ -76,7 +77,7 @@ func (suite *InboxPostTestSuite) TestPostBlock() {
targetURI := testrig.URLMustParse(blockedAccount.InboxURI)
signature, digestHeader, dateHeader := testrig.GetSignatureForActivity(block, blockingAccount.PublicKeyURI, blockingAccount.PrivateKey, targetURI)
bodyI, err := streams.Serialize(block)
bodyI, err := ap.Serialize(block)
suite.NoError(err)
bodyJson, err := json.Marshal(bodyI)
@ -177,7 +178,7 @@ func (suite *InboxPostTestSuite) TestPostUnblock() {
targetURI := testrig.URLMustParse(blockedAccount.InboxURI)
signature, digestHeader, dateHeader := testrig.GetSignatureForActivity(undo, blockingAccount.PublicKeyURI, blockingAccount.PrivateKey, targetURI)
bodyI, err := streams.Serialize(undo)
bodyI, err := ap.Serialize(undo)
suite.NoError(err)
bodyJson, err := json.Marshal(bodyI)
@ -275,7 +276,7 @@ func (suite *InboxPostTestSuite) TestPostUpdate() {
targetURI := testrig.URLMustParse(receivingAccount.InboxURI)
signature, digestHeader, dateHeader := testrig.GetSignatureForActivity(update, updatedAccount.PublicKeyURI, updatedAccount.PrivateKey, targetURI)
bodyI, err := streams.Serialize(update)
bodyI, err := ap.Serialize(update)
suite.NoError(err)
bodyJson, err := json.Marshal(bodyI)
@ -412,7 +413,7 @@ func (suite *InboxPostTestSuite) TestPostDelete() {
targetURI := testrig.URLMustParse(receivingAccount.InboxURI)
signature, digestHeader, dateHeader := testrig.GetSignatureForActivity(delete, deletedAccount.PublicKeyURI, deletedAccount.PrivateKey, targetURI)
bodyI, err := streams.Serialize(delete)
bodyI, err := ap.Serialize(delete)
suite.NoError(err)
bodyJson, err := json.Marshal(bodyI)

View file

@ -224,7 +224,18 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
"statuses_count": 7,
"last_status_at": "2021-10-20T10:40:37.000Z",
"emojis": [],
"fields": [],
"fields": [
{
"name": "should you follow me?",
"value": "maybe!",
"verified_at": null
},
{
"name": "age",
"value": "120",
"verified_at": null
}
],
"role": {
"name": "user"
}
@ -374,7 +385,18 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
"statuses_count": 7,
"last_status_at": "2021-10-20T10:40:37.000Z",
"emojis": [],
"fields": [],
"fields": [
{
"name": "should you follow me?",
"value": "maybe!",
"verified_at": null
},
{
"name": "age",
"value": "120",
"verified_at": null
}
],
"role": {
"name": "user"
}
@ -575,7 +597,18 @@ func (suite *ReportsGetTestSuite) TestReportsGetCreatedByAccount() {
"statuses_count": 7,
"last_status_at": "2021-10-20T10:40:37.000Z",
"emojis": [],
"fields": [],
"fields": [
{
"name": "should you follow me?",
"value": "maybe!",
"verified_at": null
},
{
"name": "age",
"value": "120",
"verified_at": null
}
],
"role": {
"name": "user"
}
@ -776,7 +809,18 @@ func (suite *ReportsGetTestSuite) TestReportsGetTargetAccount() {
"statuses_count": 7,
"last_status_at": "2021-10-20T10:40:37.000Z",
"emojis": [],
"fields": [],
"fields": [
{
"name": "should you follow me?",
"value": "maybe!",
"verified_at": null
},
{
"name": "age",
"value": "120",
"verified_at": null
}
],
"role": {
"name": "user"
}

View file

@ -29,5 +29,5 @@ type Field struct {
Value string `json:"value"`
// If this field has been verified, when did this occur? (ISO 8601 Datetime).
// example: 2021-07-30T09:20:25+00:00
VerifiedAt string `json:"verified_at,omitempty"`
VerifiedAt *string `json:"verified_at"`
}

View file

@ -0,0 +1,56 @@
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package migrations
import (
"context"
"strings"
"github.com/uptrace/bun"
"github.com/uptrace/bun/dialect"
)
func init() {
up := func(ctx context.Context, db *bun.DB) error {
var err error
switch db.Dialect().Name() {
case dialect.SQLite:
_, err = db.ExecContext(ctx, "ALTER TABLE ? ADD COLUMN ? VARCHAR", bun.Ident("accounts"), bun.Ident("fields_raw"))
case dialect.PG:
_, err = db.ExecContext(ctx, "ALTER TABLE ? ADD COLUMN ? JSONB", bun.Ident("accounts"), bun.Ident("fields_raw"))
default:
panic("db conn was neither pg not sqlite")
}
if err != nil && !(strings.Contains(err.Error(), "already exists") || strings.Contains(err.Error(), "duplicate column name") || strings.Contains(err.Error(), "SQLSTATE 42701")) {
return err
}
return nil
}
down := func(ctx context.Context, db *bun.DB) error {
return db.RunInTx(ctx, nil, func(ctx context.Context, tx bun.Tx) error {
return nil
})
}
if err := Migrations.Register(up, down); err != nil {
panic(err)
}
}

View file

@ -38,7 +38,7 @@
"github.com/superseriousbusiness/gotosocial/internal/transport"
)
func (d *deref) GetAccountByURI(ctx context.Context, requestUser string, uri *url.URL, block bool) (*gtsmodel.Account, error) {
func (d *deref) GetAccountByURI(ctx context.Context, requestUser string, uri *url.URL) (*gtsmodel.Account, error) {
var (
account *gtsmodel.Account
uriStr = uri.String()
@ -70,11 +70,11 @@ func (d *deref) GetAccountByURI(ctx context.Context, requestUser string, uri *ur
ID: id.NewULID(),
Domain: uri.Host,
URI: uriStr,
}, false, true)
}, d.defaultFetchLatest, false)
}
// Try to update existing account model
enriched, err := d.enrichAccount(ctx, requestUser, uri, account, false, block)
enriched, err := d.enrichAccount(ctx, requestUser, uri, account, d.defaultFetchLatest, false)
if err != nil {
log.Errorf(ctx, "error enriching remote account: %v", err)
return account, nil // fall back to returning existing
@ -83,7 +83,7 @@ func (d *deref) GetAccountByURI(ctx context.Context, requestUser string, uri *ur
return enriched, nil
}
func (d *deref) GetAccountByUsernameDomain(ctx context.Context, requestUser string, username string, domain string, block bool) (*gtsmodel.Account, error) {
func (d *deref) GetAccountByUsernameDomain(ctx context.Context, requestUser string, username string, domain string) (*gtsmodel.Account, error) {
if domain == config.GetHost() || domain == config.GetAccountDomain() {
// We do local lookups using an empty domain,
// else it will fail the db search below.
@ -99,19 +99,24 @@ func (d *deref) GetAccountByUsernameDomain(ctx context.Context, requestUser stri
if account == nil {
// Check for failed local lookup.
if domain == "" {
return nil, NewErrNotRetrievable(err) // will be db.ErrNoEntries
return nil, NewErrNotRetrievable(err) // wrapped err will be db.ErrNoEntries
}
// Create and pass-through a new bare-bones model for dereferencing.
return d.enrichAccount(ctx, requestUser, nil, &gtsmodel.Account{
account = &gtsmodel.Account{
ID: id.NewULID(),
Username: username,
Domain: domain,
}, false, true)
}
// There's no known account to fall back on,
// so return error if we can't enrich account.
return d.enrichAccount(ctx, requestUser, nil, account, d.defaultFetchLatest, false)
}
// Try to update existing account model
enriched, err := d.enrichAccount(ctx, requestUser, nil, account, false, block)
// We knew about this account already;
// try to update existing account model.
enriched, err := d.enrichAccount(ctx, requestUser, nil, account, d.defaultFetchLatest, false)
if err != nil {
log.Errorf(ctx, "error enriching account from remote: %v", err)
return account, nil // fall back to returning unchanged existing account model
@ -120,12 +125,62 @@ func (d *deref) GetAccountByUsernameDomain(ctx context.Context, requestUser stri
return enriched, nil
}
func (d *deref) UpdateAccount(ctx context.Context, requestUser string, account *gtsmodel.Account, force bool) (*gtsmodel.Account, error) {
return d.enrichAccount(ctx, requestUser, nil, account, force, false)
func (d *deref) RefreshAccount(ctx context.Context, requestUser string, accountable ap.Accountable, account *gtsmodel.Account) (*gtsmodel.Account, error) {
// To avoid unnecessarily refetching multiple times from remote,
// we can just pass in the Accountable object that we received,
// if it was defined. If not, fall back to default fetch func.
var f fetchLatest
if accountable != nil {
f = func(
_ context.Context,
_ transport.Transport,
_ *url.URL,
_ string,
) (ap.Accountable, *gtsmodel.Account, error) {
return accountable, account, nil
}
} else {
f = d.defaultFetchLatest
}
// Set 'force' to 'true' to always fetch latest media etc.
return d.enrichAccount(ctx, requestUser, nil, account, f, true)
}
// fetchLatest defines a function for using a transport and uri to fetch the fetchLatest
// version of an account (and its AP representation) from a remote instance.
type fetchLatest func(ctx context.Context, transport transport.Transport, uri *url.URL, accountDomain string) (ap.Accountable, *gtsmodel.Account, error)
// defaultFetchLatest deduplicates latest fetching code that is used in several
// different functions. It simply calls the remote uri using the given transport,
// parses a returned AP representation into an account, and then returns both.
func (d *deref) defaultFetchLatest(ctx context.Context, transport transport.Transport, uri *url.URL, accountDomain string) (ap.Accountable, *gtsmodel.Account, error) {
// Dereference this account to get the latest available.
apubAcc, err := d.dereferenceAccountable(ctx, transport, uri)
if err != nil {
return nil, nil, fmt.Errorf("error dereferencing account %s: %w", uri, err)
}
// Convert the dereferenced AP account object to our GTS model.
latestAcc, err := d.typeConverter.ASRepresentationToAccount(
ctx, apubAcc, accountDomain,
)
if err != nil {
return nil, nil, fmt.Errorf("error converting accountable to gts model for account %s: %w", uri, err)
}
return apubAcc, latestAcc, nil
}
// enrichAccount will ensure the given account is the most up-to-date model of the account, re-webfingering and re-dereferencing if necessary.
func (d *deref) enrichAccount(ctx context.Context, requestUser string, uri *url.URL, account *gtsmodel.Account, force, block bool) (*gtsmodel.Account, error) {
func (d *deref) enrichAccount(
ctx context.Context,
requestUser string,
uri *url.URL,
account *gtsmodel.Account,
f fetchLatest,
force bool,
) (*gtsmodel.Account, error) {
if account.IsLocal() {
// Can't update local accounts.
return account, nil
@ -205,18 +260,10 @@ func (d *deref) enrichAccount(ctx context.Context, requestUser string, uri *url.
d.startHandshake(requestUser, uri)
defer d.stopHandshake(requestUser, uri)
// Dereference this account to get the latest available.
apubAcc, err := d.dereferenceAccountable(ctx, transport, uri)
// Fetch latest version of the account, dereferencing if necessary.
apubAcc, latestAcc, err := f(ctx, transport, uri, account.Domain)
if err != nil {
return nil, fmt.Errorf("enrichAccount: error dereferencing account %s: %w", uri, err)
}
// Convert the dereferenced AP account object to our GTS model.
latestAcc, err := d.typeConverter.ASRepresentationToAccount(
ctx, apubAcc, account.Domain,
)
if err != nil {
return nil, fmt.Errorf("enrichAccount: error converting accountable to gts model for account %s: %w", uri, err)
return nil, fmt.Errorf("enrichAccount: error calling fetchLatest function: %w", err)
}
if account.Username == "" {
@ -256,11 +303,11 @@ func (d *deref) enrichAccount(ctx context.Context, requestUser string, uri *url.
latestAcc.ID = account.ID
latestAcc.FetchedAt = time.Now()
// Use the existing account media attachments by default.
// Reuse the existing account media attachments by default.
latestAcc.AvatarMediaAttachmentID = account.AvatarMediaAttachmentID
latestAcc.HeaderMediaAttachmentID = account.HeaderMediaAttachmentID
if latestAcc.AvatarRemoteURL != account.AvatarRemoteURL {
if force || (latestAcc.AvatarRemoteURL != account.AvatarRemoteURL) {
// Reset the avatar media ID (handles removed).
latestAcc.AvatarMediaAttachmentID = ""
@ -281,7 +328,7 @@ func (d *deref) enrichAccount(ctx context.Context, requestUser string, uri *url.
}
}
if latestAcc.HeaderRemoteURL != account.HeaderRemoteURL {
if force || (latestAcc.HeaderRemoteURL != account.HeaderRemoteURL) {
// Reset the header media ID (handles removed).
latestAcc.HeaderMediaAttachmentID = ""

View file

@ -41,7 +41,6 @@ func (suite *AccountTestSuite) TestDereferenceGroup() {
context.Background(),
fetchingAccount.Username,
groupURL,
false,
)
suite.NoError(err)
suite.NotNil(group)
@ -66,7 +65,6 @@ func (suite *AccountTestSuite) TestDereferenceService() {
context.Background(),
fetchingAccount.Username,
serviceURL,
false,
)
suite.NoError(err)
suite.NotNil(service)
@ -99,7 +97,6 @@ func (suite *AccountTestSuite) TestDereferenceLocalAccountAsRemoteURL() {
context.Background(),
fetchingAccount.Username,
testrig.URLMustParse(targetAccount.URI),
false,
)
suite.NoError(err)
suite.NotNil(fetchedAccount)
@ -119,7 +116,6 @@ func (suite *AccountTestSuite) TestDereferenceLocalAccountAsRemoteURLNoSharedInb
context.Background(),
fetchingAccount.Username,
testrig.URLMustParse(targetAccount.URI),
false,
)
suite.NoError(err)
suite.NotNil(fetchedAccount)
@ -134,7 +130,6 @@ func (suite *AccountTestSuite) TestDereferenceLocalAccountAsUsername() {
context.Background(),
fetchingAccount.Username,
testrig.URLMustParse(targetAccount.URI),
false,
)
suite.NoError(err)
suite.NotNil(fetchedAccount)
@ -149,7 +144,6 @@ func (suite *AccountTestSuite) TestDereferenceLocalAccountAsUsernameDomain() {
context.Background(),
fetchingAccount.Username,
testrig.URLMustParse(targetAccount.URI),
false,
)
suite.NoError(err)
suite.NotNil(fetchedAccount)
@ -165,7 +159,6 @@ func (suite *AccountTestSuite) TestDereferenceLocalAccountAsUsernameDomainAndURL
fetchingAccount.Username,
targetAccount.Username,
config.GetHost(),
false,
)
suite.NoError(err)
suite.NotNil(fetchedAccount)
@ -180,7 +173,6 @@ func (suite *AccountTestSuite) TestDereferenceLocalAccountWithUnknownUsername()
fetchingAccount.Username,
"thisaccountdoesnotexist",
config.GetHost(),
false,
)
var errNotRetrievable *dereferencing.ErrNotRetrievable
suite.ErrorAs(err, &errNotRetrievable)
@ -196,7 +188,6 @@ func (suite *AccountTestSuite) TestDereferenceLocalAccountWithUnknownUsernameDom
fetchingAccount.Username,
"thisaccountdoesnotexist",
"localhost:8080",
false,
)
var errNotRetrievable *dereferencing.ErrNotRetrievable
suite.ErrorAs(err, &errNotRetrievable)
@ -211,7 +202,6 @@ func (suite *AccountTestSuite) TestDereferenceLocalAccountWithUnknownUserURI() {
context.Background(),
fetchingAccount.Username,
testrig.URLMustParse("http://localhost:8080/users/thisaccountdoesnotexist"),
false,
)
var errNotRetrievable *dereferencing.ErrNotRetrievable
suite.ErrorAs(err, &errNotRetrievable)

View file

@ -35,14 +35,15 @@
type Dereferencer interface {
// GetAccountByURI will attempt to fetch an account by its URI, first checking the database and in the case of a remote account will either check the
// last_fetched (and updating if beyond fetch interval) or dereferencing for the first-time if this remote account has never been encountered before.
GetAccountByURI(ctx context.Context, requestUser string, uri *url.URL, block bool) (*gtsmodel.Account, error)
GetAccountByURI(ctx context.Context, requestUser string, uri *url.URL) (*gtsmodel.Account, error)
// GetAccountByUsernameDomain will attempt to fetch an account by username@domain, first checking the database and in the case of a remote account will either
// check the last_fetched (and updating if beyond fetch interval) or dereferencing for the first-time if this remote account has never been encountered before.
GetAccountByUsernameDomain(ctx context.Context, requestUser string, username string, domain string, block bool) (*gtsmodel.Account, error)
GetAccountByUsernameDomain(ctx context.Context, requestUser string, username string, domain string) (*gtsmodel.Account, error)
// UpdateAccount updates the given account if last_fetched is beyond fetch interval (or if force is set). An updated account model is returned, any media fetching is done async.
UpdateAccount(ctx context.Context, requestUser string, account *gtsmodel.Account, force bool) (*gtsmodel.Account, error)
// RefreshAccount forces a refresh of the given account by fetching the current/latest state of the account from the remote instance.
// An updated account model is returned, but not yet inserted/updated in the database; this is the caller's responsibility.
RefreshAccount(ctx context.Context, requestUser string, accountable ap.Accountable, account *gtsmodel.Account) (*gtsmodel.Account, error)
GetStatus(ctx context.Context, username string, remoteStatusID *url.URL, refetch, includeParent bool) (*gtsmodel.Status, ap.Statusable, error)

View file

@ -125,7 +125,7 @@ func (d *deref) GetStatus(ctx context.Context, username string, statusURI *url.U
}
// we need to get the author of the status else we can't serialize it properly
if _, err = d.GetAccountByURI(ctx, username, accountURI, true); err != nil {
if _, err = d.GetAccountByURI(ctx, username, accountURI); err != nil {
return nil, nil, newErrOther(fmt.Errorf("GetRemoteStatus: couldn't get status author: %s", err))
}
@ -278,7 +278,7 @@ func (d *deref) populateStatusMentions(ctx context.Context, status *gtsmodel.Sta
if targetAccount == nil {
// we didn't find the account in our database already
// check if we can get the account remotely (dereference it)
if a, err := d.GetAccountByURI(ctx, requestingUsername, targetAccountURI, false); err != nil {
if a, err := d.GetAccountByURI(ctx, requestingUsername, targetAccountURI); err != nil {
errs = append(errs, err.Error())
} else {
log.Debugf(ctx, "got target account %s with id %s through GetRemoteAccount", targetAccountURI, a.ID)

View file

@ -59,11 +59,11 @@ type federatingActor struct {
// implements the pub.FederatingActor interface.
func newFederatingActor(c pub.CommonBehavior, s2s pub.FederatingProtocol, db pub.Database, clock pub.Clock) pub.FederatingActor {
sideEffectActor := pub.NewSideEffectActor(c, s2s, nil, db, clock)
customActor := pub.NewCustomActor(sideEffectActor, false, true, clock)
sideEffectActor.Serialize = ap.Serialize // hook in our own custom Serialize function
return &federatingActor{
sideEffectActor: sideEffectActor,
wrapped: customActor,
wrapped: pub.NewCustomActor(sideEffectActor, false, true, clock),
}
}
@ -165,7 +165,8 @@ func (f *federatingActor) PostInboxScheme(ctx context.Context, w http.ResponseWr
// If activity Object is a Statusable, we'll want to replace the
// parsed `content` value with the value from the raw JSON instead.
// See https://github.com/superseriousbusiness/gotosocial/issues/1661
ap.NormalizeActivityObject(activity, rawActivity)
// Likewise, if it's an Accountable, we'll normalize some fields on it.
ap.NormalizeIncomingActivityObject(activity, rawActivity)
// Allow server implementations to set context data with a hook.
ctx, err = f.sideEffectActor.PostInboxRequestBodyHook(ctx, r, activity)

View file

@ -23,7 +23,7 @@
"testing"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/testrig"
)
@ -37,7 +37,7 @@ func (suite *FollowersTestSuite) TestGetFollowers() {
f, err := suite.federatingDB.Followers(context.Background(), testrig.URLMustParse(testAccount.URI))
suite.NoError(err)
fi, err := streams.Serialize(f)
fi, err := ap.Serialize(f)
suite.NoError(err)
fJson, err := json.MarshalIndent(fi, "", " ")

View file

@ -23,7 +23,7 @@
"testing"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/testrig"
)
@ -37,7 +37,7 @@ func (suite *FollowingTestSuite) TestGetFollowing() {
f, err := suite.federatingDB.Following(context.Background(), testrig.URLMustParse(testAccount.URI))
suite.NoError(err)
fi, err := streams.Serialize(f)
fi, err := ap.Serialize(f)
suite.NoError(err)
fJson, err := json.MarshalIndent(fi, "", " ")

View file

@ -54,96 +54,69 @@ func (f *federatingDB) Update(ctx context.Context, asType vocab.Type) error {
receivingAccount, _ := extractFromCtx(ctx)
if receivingAccount == nil {
// If the receiving account wasn't set on the context, that means this request didn't pass
// through the API, but came from inside GtS as the result of another activity on this instance. That being so,
// we can safely just ignore this activity, since we know we've already processed it elsewhere.
// If the receiving account wasn't set on the context, that means
// this request didn't pass through the API, but came from inside
// GtS as the result of another activity on this instance. As such,
// we must have already processed it in order to reach this stage.
return nil
}
requestingAcctI := ctx.Value(ap.ContextRequestingAccount)
if requestingAcctI == nil {
l.Error("UPDATE: requesting account wasn't set on context")
return errors.New("Update: requesting account wasn't set on context")
}
requestingAcct, ok := requestingAcctI.(*gtsmodel.Account)
if !ok {
l.Error("UPDATE: requesting account was set on context but couldn't be parsed")
return errors.New("Update: requesting account was set on context but couldn't be parsed")
}
typeName := asType.GetTypeName()
if typeName == ap.ActorApplication ||
typeName == ap.ActorGroup ||
typeName == ap.ActorOrganization ||
typeName == ap.ActorPerson ||
typeName == ap.ActorService {
// it's an UPDATE to some kind of account
var accountable ap.Accountable
switch typeName {
case ap.ActorApplication:
l.Debug("got update for APPLICATION")
i, ok := asType.(vocab.ActivityStreamsApplication)
if !ok {
return errors.New("UPDATE: could not convert type to application")
}
accountable = i
case ap.ActorGroup:
l.Debug("got update for GROUP")
i, ok := asType.(vocab.ActivityStreamsGroup)
if !ok {
return errors.New("UPDATE: could not convert type to group")
}
accountable = i
case ap.ActorOrganization:
l.Debug("got update for ORGANIZATION")
i, ok := asType.(vocab.ActivityStreamsOrganization)
if !ok {
return errors.New("UPDATE: could not convert type to organization")
}
accountable = i
case ap.ActorPerson:
l.Debug("got update for PERSON")
i, ok := asType.(vocab.ActivityStreamsPerson)
if !ok {
return errors.New("UPDATE: could not convert type to person")
}
accountable = i
case ap.ActorService:
l.Debug("got update for SERVICE")
i, ok := asType.(vocab.ActivityStreamsService)
if !ok {
return errors.New("UPDATE: could not convert type to service")
}
accountable = i
}
updatedAcct, err := f.typeConverter.ASRepresentationToAccount(ctx, accountable, "")
if err != nil {
return fmt.Errorf("UPDATE: error converting to account: %s", err)
}
if updatedAcct.Domain == config.GetHost() || updatedAcct.Domain == config.GetAccountDomain() {
// no need to update local accounts
// in fact, if we do this will break the shit out of things so do NOT
return nil
}
if requestingAcct.URI != updatedAcct.URI {
return fmt.Errorf("UPDATE: update for account %s was requested by account %s, this is not valid", updatedAcct.URI, requestingAcct.URI)
}
// set some fields here on the updatedAccount representation so we don't run into db issues
updatedAcct.CreatedAt = requestingAcct.CreatedAt
updatedAcct.ID = requestingAcct.ID
updatedAcct.Language = requestingAcct.Language
// pass to the processor for further updating of eg., avatar/header, emojis
// the actual db insert/update will take place a bit later
f.state.Workers.EnqueueFederator(ctx, messages.FromFederator{
APObjectType: ap.ObjectProfile,
APActivityType: ap.ActivityUpdate,
GTSModel: updatedAcct,
ReceivingAccount: receivingAccount,
})
switch asType.GetTypeName() {
case ap.ActorApplication, ap.ActorGroup, ap.ActorOrganization, ap.ActorPerson, ap.ActorService:
return f.updateAccountable(ctx, receivingAccount, requestingAcct, asType)
}
return nil
}
func (f *federatingDB) updateAccountable(ctx context.Context, receivingAcct *gtsmodel.Account, requestingAcct *gtsmodel.Account, asType vocab.Type) error {
accountable, ok := asType.(ap.Accountable)
if !ok {
return errors.New("updateAccountable: could not convert vocab.Type to Accountable")
}
updatedAcct, err := f.typeConverter.ASRepresentationToAccount(ctx, accountable, "")
if err != nil {
return fmt.Errorf("updateAccountable: error converting to account: %w", err)
}
if updatedAcct.Domain == config.GetHost() || updatedAcct.Domain == config.GetAccountDomain() {
// No need to update local accounts; in fact, if we try
// this it will break the shit out of things so do NOT.
return nil
}
if requestingAcct.URI != updatedAcct.URI {
return fmt.Errorf("updateAccountable: update for account %s was requested by account %s, this is not valid", updatedAcct.URI, requestingAcct.URI)
}
// Set some basic fields on the updated account
// based on what we already know about the requester.
updatedAcct.CreatedAt = requestingAcct.CreatedAt
updatedAcct.ID = requestingAcct.ID
updatedAcct.Language = requestingAcct.Language
updatedAcct.AvatarMediaAttachmentID = requestingAcct.AvatarMediaAttachmentID
updatedAcct.HeaderMediaAttachmentID = requestingAcct.HeaderMediaAttachmentID
// Pass to the processor for further updating of eg., avatar/header,
// emojis, etc. The actual db insert/update will take place there.
f.state.Workers.EnqueueFederator(ctx, messages.FromFederator{
APObjectType: ap.ObjectProfile,
APActivityType: ap.ActivityUpdate,
GTSModel: updatedAcct,
APObjectModel: accountable,
ReceivingAccount: receivingAcct,
})
return nil
}

View file

@ -325,7 +325,7 @@ func extractFromCtx(ctx context.Context) (receivingAccount, requestingAccount *g
}
func marshalItem(item vocab.Type) (string, error) {
m, err := streams.Serialize(item)
m, err := ap.Serialize(item)
if err != nil {
return "", err
}

View file

@ -211,7 +211,7 @@ func (f *federator) AuthenticatePostInbox(ctx context.Context, w http.ResponseWr
// dereference the remote account (or just get it
// from the db if we already have it).
requestingAccount, err := f.GetAccountByURI(
gtscontext.SetFastFail(ctx), username, publicKeyOwnerURI, false,
gtscontext.SetFastFail(ctx), username, publicKeyOwnerURI,
)
if err != nil {
if gtserror.StatusCode(err) == http.StatusGone {

View file

@ -47,7 +47,8 @@ type Account struct {
DisplayName string `validate:"-" bun:""` // DisplayName for this account. Can be empty, then just the Username will be used for display purposes.
EmojiIDs []string `validate:"dive,ulid" bun:"emojis,array"` // Database IDs of any emojis used in this account's bio, display name, etc
Emojis []*Emoji `validate:"-" bun:"attached_emojis,m2m:account_to_emojis"` // Emojis corresponding to emojiIDs. https://bun.uptrace.dev/guide/relations.html#many-to-many-relation
Fields []Field `validate:"-"` // a key/value map of fields that this account has added to their profile
Fields []*Field `validate:"-"` // A slice of of fields that this account has added to their profile.
FieldsRaw []*Field `validate:"-"` // The raw (unparsed) content of fields that this account has added to their profile, without conversion to HTML, only available when requester = target
Note string `validate:"-" bun:""` // A note that this account has on their profile (ie., the account's bio/description of themselves)
NoteRaw string `validate:"-" bun:""` // The raw contents of .Note without conversion to HTML, only available when requester = target
Memorial *bool `validate:"-" bun:",default:false"` // Is this a memorial account, ie., has the user passed away?

View file

@ -34,9 +34,10 @@ type FromClientAPI struct {
// FromFederator wraps a message that travels from the federator into the processor.
type FromFederator struct {
APObjectType string // what is the object type of this message? eg., Note, Profile etc.
APActivityType string // what is the activity type of this message? eg., Create, Follow etc.
APIri *url.URL // what is the IRI ID of this activity?
GTSModel interface{} // representation of this object if it's already been converted into our internal gts model
ReceivingAccount *gtsmodel.Account // which account owns the inbox that this activity was posted to?
APObjectType string
APActivityType string
APIri *url.URL
APObjectModel interface{} // Optional AP model of the Object of the Activity. Should be Accountable or Statusable.
GTSModel interface{} // Optional GTS model of the Activity or Object.
ReceivingAccount *gtsmodel.Account // Local account which owns the inbox that this Activity was posted to.
}

View file

@ -96,7 +96,7 @@ func (p *Processor) getFor(ctx context.Context, requestingAccount *gtsmodel.Acco
}
a, err := p.federator.GetAccountByURI(
gtscontext.SetFastFail(ctx), requestingAccount.Username, targetAccountURI, true,
gtscontext.SetFastFail(ctx), requestingAccount.Username, targetAccountURI,
)
if err == nil {
targetAccount = a

View file

@ -36,6 +36,14 @@
"github.com/superseriousbusiness/gotosocial/internal/validate"
)
func (p *Processor) selectNoteFormatter(contentType string) text.FormatFunc {
if contentType == "text/markdown" {
return p.formatter.FromMarkdown
}
return p.formatter.FromPlain
}
// Update processes the update of an account with the given form.
func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, form *apimodel.UpdateCredentialsRequest) (*apimodel.Account, gtserror.WithCode) {
if form.Discoverable != nil {
@ -46,56 +54,144 @@ func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, form
account.Bot = form.Bot
}
reparseEmojis := false
// Via the process of updating the account,
// it is possible that the emojis used by
// that account in note/display name/fields
// may change; we need to keep track of this.
var emojisChanged bool
if form.DisplayName != nil {
if err := validate.DisplayName(*form.DisplayName); err != nil {
return nil, gtserror.NewErrorBadRequest(err)
displayName := *form.DisplayName
if err := validate.DisplayName(displayName); err != nil {
return nil, gtserror.NewErrorBadRequest(err, err.Error())
}
account.DisplayName = text.SanitizePlaintext(*form.DisplayName)
reparseEmojis = true
// Parse new display name (always from plaintext).
account.DisplayName = text.SanitizePlaintext(displayName)
// If display name has changed, account emojis may have also changed.
emojisChanged = true
}
if form.Note != nil {
if err := validate.Note(*form.Note); err != nil {
return nil, gtserror.NewErrorBadRequest(err)
note := *form.Note
if err := validate.Note(note); err != nil {
return nil, gtserror.NewErrorBadRequest(err, err.Error())
}
// Set the raw note before processing
account.NoteRaw = *form.Note
reparseEmojis = true
// Store raw version of the note for now,
// we'll process the proper version later.
account.NoteRaw = note
// If note has changed, account emojis may have also changed.
emojisChanged = true
}
if reparseEmojis {
// If either DisplayName or Note changed, reparse both, because we
// can't otherwise tell which one each emoji belongs to.
// Deduplicate emojis between the two fields.
if form.FieldsAttributes != nil {
var (
fieldsAttributes = *form.FieldsAttributes
fieldsLen = len(fieldsAttributes)
fieldsRaw = make([]*gtsmodel.Field, 0, fieldsLen)
)
for _, updateField := range fieldsAttributes {
if updateField.Name == nil || updateField.Value == nil {
continue
}
var (
name string = *updateField.Name
value string = *updateField.Value
)
if name == "" || value == "" {
continue
}
// Sanitize raw field values.
fieldRaw := &gtsmodel.Field{
Name: text.SanitizePlaintext(name),
Value: text.SanitizePlaintext(value),
}
fieldsRaw = append(fieldsRaw, fieldRaw)
}
// Check length of parsed raw fields.
if err := validate.ProfileFields(fieldsRaw); err != nil {
return nil, gtserror.NewErrorBadRequest(err, err.Error())
}
// OK, new raw fields are valid.
account.FieldsRaw = fieldsRaw
account.Fields = make([]*gtsmodel.Field, 0, fieldsLen) // process these in a sec
// If fields have changed, account emojis may also have changed.
emojisChanged = true
}
if emojisChanged {
// Use map to deduplicate emojis by their ID.
emojis := make(map[string]*gtsmodel.Emoji)
formatResult := p.formatter.FromPlainEmojiOnly(ctx, p.parseMention, account.ID, "", account.DisplayName)
for _, emoji := range formatResult.Emojis {
// Retrieve display name emojis.
for _, emoji := range p.formatter.FromPlainEmojiOnly(
ctx,
p.parseMention,
account.ID,
"",
account.DisplayName,
).Emojis {
emojis[emoji.ID] = emoji
}
// Process note to generate a valid HTML representation
var f text.FormatFunc
if account.StatusContentType == "text/markdown" {
f = p.formatter.FromMarkdown
} else {
f = p.formatter.FromPlain
}
formatted := f(ctx, p.parseMention, account.ID, "", account.NoteRaw)
// Format + set note according to user prefs.
f := p.selectNoteFormatter(account.StatusContentType)
formatNoteResult := f(ctx, p.parseMention, account.ID, "", account.NoteRaw)
account.Note = formatNoteResult.HTML
// Set updated HTML-ified note
account.Note = formatted.HTML
for _, emoji := range formatted.Emojis {
// Retrieve note emojis.
for _, emoji := range formatNoteResult.Emojis {
emojis[emoji.ID] = emoji
}
account.Emojis = []*gtsmodel.Emoji{}
account.EmojiIDs = []string{}
for eid, emoji := range emojis {
// Process the raw fields we stored earlier.
for _, fieldRaw := range account.FieldsRaw {
field := &gtsmodel.Field{}
// Name stays plain, but we still need to
// see if there are any emojis set in it.
field.Name = fieldRaw.Name
for _, emoji := range p.formatter.FromPlainEmojiOnly(
ctx,
p.parseMention,
account.ID,
"",
fieldRaw.Name,
).Emojis {
emojis[emoji.ID] = emoji
}
// Value can be HTML, but we don't want
// to wrap the result in <p> tags.
fieldFormatValueResult := p.formatter.FromPlainNoParagraph(ctx, p.parseMention, account.ID, "", fieldRaw.Value)
field.Value = fieldFormatValueResult.HTML
// Retrieve field emojis.
for _, emoji := range fieldFormatValueResult.Emojis {
emojis[emoji.ID] = emoji
}
// We're done, append the shiny new field.
account.Fields = append(account.Fields, field)
}
emojisCount := len(emojis)
account.Emojis = make([]*gtsmodel.Emoji, 0, emojisCount)
account.EmojiIDs = make([]string, 0, emojisCount)
for id, emoji := range emojis {
account.Emojis = append(account.Emojis, emoji)
account.EmojiIDs = append(account.EmojiIDs, eid)
account.EmojiIDs = append(account.EmojiIDs, id)
}
}
@ -164,26 +260,6 @@ func (p *Processor) Update(ctx context.Context, account *gtsmodel.Account, form
account.EnableRSS = form.EnableRSS
}
if form.FieldsAttributes != nil && len(*form.FieldsAttributes) != 0 {
if err := validate.ProfileFieldsCount(*form.FieldsAttributes); err != nil {
return nil, gtserror.NewErrorBadRequest(err)
}
account.Fields = make([]gtsmodel.Field, 0) // reset fields
for _, f := range *form.FieldsAttributes {
if f.Name != nil && f.Value != nil {
if *f.Name != "" && *f.Value != "" {
field := gtsmodel.Field{}
field.Name = validate.ProfileField(f.Name)
field.Value = validate.ProfileField(f.Value)
account.Fields = append(account.Fields, field)
}
}
}
}
err := p.state.DB.UpdateAccount(ctx, account)
if err != nil {
return nil, gtserror.NewErrorInternalError(fmt.Errorf("could not update account %s: %s", account.ID, err))

View file

@ -148,6 +148,86 @@ func (suite *AccountUpdateTestSuite) TestAccountUpdateWithMarkdownNote() {
suite.Equal(expectedNote, dbAccount.Note)
}
func (suite *AccountUpdateTestSuite) TestAccountUpdateWithFields() {
testAccount := suite.testAccounts["local_account_1"]
updateFields := []apimodel.UpdateField{
{
Name: func() *string { s := "favourite emoji"; return &s }(),
Value: func() *string { s := ":rainbow:"; return &s }(),
},
{
Name: func() *string { s := "my website"; return &s }(),
Value: func() *string { s := "https://example.org"; return &s }(),
},
}
form := &apimodel.UpdateCredentialsRequest{
FieldsAttributes: &updateFields,
}
// should get no error from the update function, and an api model account returned
apiAccount, errWithCode := suite.accountProcessor.Update(context.Background(), testAccount, form)
// reset test account to avoid breaking other tests
testAccount.StatusContentType = "text/plain"
suite.NoError(errWithCode)
suite.NotNil(apiAccount)
suite.EqualValues([]apimodel.Field{
{
Name: "favourite emoji",
Value: ":rainbow:",
VerifiedAt: (*string)(nil),
},
{
Name: "my website",
Value: "<a href=\"https://example.org\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">https://example.org</a>",
VerifiedAt: (*string)(nil),
},
}, apiAccount.Fields)
suite.EqualValues([]apimodel.Field{
{
Name: "favourite emoji",
Value: ":rainbow:",
VerifiedAt: (*string)(nil),
},
{
Name: "my website",
Value: "https://example.org",
VerifiedAt: (*string)(nil),
},
}, apiAccount.Source.Fields)
suite.EqualValues([]apimodel.Emoji{
{
Shortcode: "rainbow",
URL: "http://localhost:8080/fileserver/01AY6P665V14JJR0AFVRT7311Y/emoji/original/01F8MH9H8E4VG3KDYJR9EGPXCQ.png",
StaticURL: "http://localhost:8080/fileserver/01AY6P665V14JJR0AFVRT7311Y/emoji/static/01F8MH9H8E4VG3KDYJR9EGPXCQ.png",
VisibleInPicker: true,
Category: "reactions",
},
}, apiAccount.Emojis)
// we should have an update in the client api channel
msg := <-suite.fromClientAPIChan
suite.Equal(ap.ActivityUpdate, msg.APActivityType)
suite.Equal(ap.ObjectProfile, msg.APObjectType)
suite.NotNil(msg.OriginAccount)
suite.Equal(testAccount.ID, msg.OriginAccount.ID)
suite.Nil(msg.TargetAccount)
// fields should be updated in the database as well
dbAccount, err := suite.db.GetAccountByID(context.Background(), testAccount.ID)
suite.NoError(err)
suite.Equal("favourite emoji", dbAccount.Fields[0].Name)
suite.Equal(":rainbow:", dbAccount.Fields[0].Value)
suite.Equal("my website", dbAccount.Fields[1].Name)
suite.Equal("<a href=\"https://example.org\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">https://example.org</a>", dbAccount.Fields[1].Value)
suite.Equal("favourite emoji", dbAccount.FieldsRaw[0].Name)
suite.Equal(":rainbow:", dbAccount.FieldsRaw[0].Value)
suite.Equal("my website", dbAccount.FieldsRaw[1].Name)
suite.Equal("https://example.org", dbAccount.FieldsRaw[1].Value)
}
func TestAccountUpdateTestSuite(t *testing.T) {
suite.Run(t, new(AccountUpdateTestSuite))
}

View file

@ -24,7 +24,6 @@
"net/http"
"net/url"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
@ -74,7 +73,7 @@ func (p *Processor) OutboxGet(ctx context.Context, requestedUsername string, pag
return nil, gtserror.NewErrorInternalError(err)
}
data, err = streams.Serialize(collection)
data, err = ap.Serialize(collection)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
@ -93,7 +92,7 @@ func (p *Processor) OutboxGet(ctx context.Context, requestedUsername string, pag
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
data, err = streams.Serialize(outboxPage)
data, err = ap.Serialize(outboxPage)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
@ -119,7 +118,7 @@ func (p *Processor) FollowersGet(ctx context.Context, requestedUsername string)
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error fetching followers for uri %s: %s", requestedAccountURI.String(), err))
}
data, err := streams.Serialize(requestedFollowers)
data, err := ap.Serialize(requestedFollowers)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
@ -145,7 +144,7 @@ func (p *Processor) FollowingGet(ctx context.Context, requestedUsername string)
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error fetching following for uri %s: %s", requestedAccountURI.String(), err))
}
data, err := streams.Serialize(requestedFollowing)
data, err := ap.Serialize(requestedFollowing)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
@ -173,7 +172,7 @@ func (p *Processor) FeaturedCollectionGet(ctx context.Context, requestedUsername
return nil, gtserror.NewErrorInternalError(err)
}
data, err := ap.SerializeOrderedCollection(collection)
data, err := ap.Serialize(collection)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}

View file

@ -40,7 +40,7 @@ func (p *Processor) authenticate(ctx context.Context, requestedUsername string)
return
}
if requestingAccount, err = p.federator.GetAccountByURI(gtscontext.SetFastFail(ctx), requestedUsername, requestingAccountURI, false); err != nil {
if requestingAccount, err = p.federator.GetAccountByURI(gtscontext.SetFastFail(ctx), requestedUsername, requestingAccountURI); err != nil {
errWithCode = gtserror.NewErrorUnauthorized(err)
return
}

View file

@ -21,7 +21,7 @@
"context"
"fmt"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
)
@ -49,7 +49,7 @@ func (p *Processor) EmojiGet(ctx context.Context, requestedEmojiID string) (inte
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting gtsmodel emoji with id %s to ap emoji: %s", requestedEmojiID, err))
}
data, err := streams.Serialize(apEmoji)
data, err := ap.Serialize(apEmoji)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}

View file

@ -22,7 +22,7 @@
"fmt"
"net/url"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
)
@ -57,7 +57,7 @@ func (p *Processor) StatusGet(ctx context.Context, requestedUsername string, req
return nil, gtserror.NewErrorInternalError(err)
}
data, err := streams.Serialize(asStatus)
data, err := ap.Serialize(asStatus)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
@ -105,7 +105,7 @@ func (p *Processor) StatusRepliesGet(ctx context.Context, requestedUsername stri
return nil, gtserror.NewErrorInternalError(err)
}
data, err = streams.Serialize(collection)
data, err = ap.Serialize(collection)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
@ -117,7 +117,7 @@ func (p *Processor) StatusRepliesGet(ctx context.Context, requestedUsername stri
return nil, gtserror.NewErrorInternalError(err)
}
// but only return the first page
data, err = streams.Serialize(collection.GetActivityStreamsFirst().GetActivityStreamsCollectionPage())
data, err = ap.Serialize(collection.GetActivityStreamsFirst().GetActivityStreamsCollectionPage())
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
@ -166,7 +166,7 @@ func (p *Processor) StatusRepliesGet(ctx context.Context, requestedUsername stri
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
data, err = streams.Serialize(repliesPage)
data, err = ap.Serialize(repliesPage)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}

View file

@ -22,8 +22,8 @@
"fmt"
"net/url"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/activity/streams/vocab"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/gtscontext"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/uris"
@ -56,7 +56,7 @@ func (p *Processor) UserGet(ctx context.Context, requestedUsername string, reque
// if we're not already handshaking/dereferencing a remote account, dereference it now
if !p.federator.Handshaking(requestedUsername, requestingAccountURI) {
requestingAccount, err := p.federator.GetAccountByURI(
gtscontext.SetFastFail(ctx), requestedUsername, requestingAccountURI, false,
gtscontext.SetFastFail(ctx), requestedUsername, requestingAccountURI,
)
if err != nil {
return nil, gtserror.NewErrorUnauthorized(err)
@ -78,7 +78,7 @@ func (p *Processor) UserGet(ctx context.Context, requestedUsername string, reque
}
}
data, err := streams.Serialize(requestedPerson)
data, err := ap.Serialize(requestedPerson)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}

View file

@ -145,7 +145,7 @@ func (p *Processor) processCreateStatusFromFederator(ctx context.Context, federa
status.Account = a
}
// do a BLOCKING get of the remote account to make sure the avi and header are cached
// Get the remote account to make sure the avi and header are cached.
if status.Account.Domain != "" {
remoteAccountID, err := url.Parse(status.Account.URI)
if err != nil {
@ -155,7 +155,6 @@ func (p *Processor) processCreateStatusFromFederator(ctx context.Context, federa
a, err := p.federator.GetAccountByURI(ctx,
federatorMsg.ReceivingAccount.Username,
remoteAccountID,
true,
)
if err != nil {
return err
@ -187,7 +186,7 @@ func (p *Processor) processCreateFaveFromFederator(ctx context.Context, federato
incomingFave.Account = a
}
// do a BLOCKING get of the remote account to make sure the avi and header are cached
// Get the remote account to make sure the avi and header are cached.
if incomingFave.Account.Domain != "" {
remoteAccountID, err := url.Parse(incomingFave.Account.URI)
if err != nil {
@ -197,7 +196,6 @@ func (p *Processor) processCreateFaveFromFederator(ctx context.Context, federato
a, err := p.federator.GetAccountByURI(ctx,
federatorMsg.ReceivingAccount.Username,
remoteAccountID,
true,
)
if err != nil {
return err
@ -229,7 +227,7 @@ func (p *Processor) processCreateFollowRequestFromFederator(ctx context.Context,
followRequest.Account = a
}
// do a BLOCKING get of the remote account to make sure the avi and header are cached
// Get the remote account to make sure the avi and header are cached.
if followRequest.Account.Domain != "" {
remoteAccountID, err := url.Parse(followRequest.Account.URI)
if err != nil {
@ -239,7 +237,6 @@ func (p *Processor) processCreateFollowRequestFromFederator(ctx context.Context,
a, err := p.federator.GetAccountByURI(ctx,
federatorMsg.ReceivingAccount.Username,
remoteAccountID,
true,
)
if err != nil {
return err
@ -290,7 +287,7 @@ func (p *Processor) processCreateAnnounceFromFederator(ctx context.Context, fede
incomingAnnounce.Account = a
}
// do a BLOCKING get of the remote account to make sure the avi and header are cached
// Get the remote account to make sure the avi and header are cached.
if incomingAnnounce.Account.Domain != "" {
remoteAccountID, err := url.Parse(incomingAnnounce.Account.URI)
if err != nil {
@ -300,7 +297,6 @@ func (p *Processor) processCreateAnnounceFromFederator(ctx context.Context, fede
a, err := p.federator.GetAccountByURI(ctx,
federatorMsg.ReceivingAccount.Username,
remoteAccountID,
true,
)
if err != nil {
return err
@ -370,16 +366,28 @@ func (p *Processor) processCreateFlagFromFederator(ctx context.Context, federato
func (p *Processor) processUpdateAccountFromFederator(ctx context.Context, federatorMsg messages.FromFederator) error {
incomingAccount, ok := federatorMsg.GTSModel.(*gtsmodel.Account)
if !ok {
return errors.New("profile was not parseable as *gtsmodel.Account")
return errors.New("*gtsmodel.Account was not parseable on update account message")
}
// Call UpdateAccount with force to reflect that
// we want to fetch new bio, avatar, header, etc.
if _, err := p.federator.UpdateAccount(ctx,
// Because this was an Update, the new AP Object should be set on the message.
incomingAccountable, ok := federatorMsg.APObjectModel.(ap.Accountable)
if !ok {
return errors.New("Accountable was not parseable on update account message")
}
// Call RefreshAccount to fetch up-to-date bio, avatar, header, etc.
updatedAccount, err := p.federator.RefreshAccount(
ctx,
federatorMsg.ReceivingAccount.Username,
incomingAccountable,
incomingAccount,
true,
); err != nil {
)
if err != nil {
return fmt.Errorf("error enriching updated account from federator: %s", err)
}
// RefreshAccount doesn't make DB update calls, so do that here.
if err := p.state.DB.UpdateAccount(ctx, updatedAccount); err != nil {
return fmt.Errorf("error enriching updated account from federator: %s", err)
}

View file

@ -270,7 +270,7 @@ func (p *Processor) searchAccountByURI(ctx context.Context, authed *oauth.Auth,
return p.federator.GetAccountByURI(
gtscontext.SetFastFail(ctx),
authed.Account.Username,
uri, false,
uri,
)
}
@ -297,6 +297,6 @@ func (p *Processor) searchAccountByUsernameDomain(ctx context.Context, authed *o
return p.federator.GetAccountByUsernameDomain(
gtscontext.SetFastFail(ctx),
authed.Account.Username,
username, domain, false,
username, domain,
)
}

View file

@ -62,7 +62,6 @@ func GetParseMentionFunc(dbConn db.DB, federator federation.Federator) gtsmodel.
requestingUsername,
username,
domain,
false,
)
if err != nil {
return nil, fmt.Errorf("parseMentionFunc: error fetching account: %s", err)

View file

@ -30,6 +30,8 @@
type Formatter interface {
// FromPlain parses an HTML text from a plaintext.
FromPlain(ctx context.Context, pmf gtsmodel.ParseMentionFunc, authorID string, statusID string, plain string) *FormatResult
// FromPlainNoParagraph parses an HTML text from a plaintext, without wrapping the resulting text in <p> tags.
FromPlainNoParagraph(ctx context.Context, pmf gtsmodel.ParseMentionFunc, authorID string, statusID string, plain string) *FormatResult
// FromMarkdown parses an HTML text from a markdown-formatted text.
FromMarkdown(ctx context.Context, pmf gtsmodel.ParseMentionFunc, authorID string, statusID string, md string) *FormatResult
// FromPlainEmojiOnly parses an HTML text from a plaintext, only parsing emojis and not mentions etc.

View file

@ -92,3 +92,7 @@ func (suite *TextStandardTestSuite) FromMarkdown(text string) *text.FormatResult
func (suite *TextStandardTestSuite) FromPlain(text string) *text.FormatResult {
return suite.formatter.FromPlain(context.Background(), suite.parseMention, suite.testAccounts["local_account_1"].ID, "status_ID", text)
}
func (suite *TextStandardTestSuite) FromPlainNoParagraph(text string) *text.FormatResult {
return suite.formatter.FromPlainNoParagraph(context.Background(), suite.parseMention, suite.testAccounts["local_account_1"].ID, "status_ID", text)
}

View file

@ -60,3 +60,41 @@ func (b *plaintextParser) CanInterruptParagraph() bool {
func (b *plaintextParser) CanAcceptIndentedLine() bool {
return true
}
// plaintextParserNoParagraph implements goldmark.parser.BlockParser
type plaintextParserNoParagraph struct{}
var defaultPlaintextParserNoParagraph = &plaintextParserNoParagraph{}
func newPlaintextParserNoParagraph() parser.BlockParser {
return defaultPlaintextParserNoParagraph
}
func (b *plaintextParserNoParagraph) Trigger() []byte {
return nil
}
func (b *plaintextParserNoParagraph) Open(parent ast.Node, reader text.Reader, pc parser.Context) (ast.Node, parser.State) {
_, segment := reader.PeekLine()
node := ast.NewDocument()
node.Lines().Append(segment)
reader.Advance(segment.Len() - 1)
return node, parser.NoChildren
}
func (b *plaintextParserNoParagraph) Continue(node ast.Node, reader text.Reader, pc parser.Context) parser.State {
_, segment := reader.PeekLine()
node.Lines().Append(segment)
reader.Advance(segment.Len() - 1)
return parser.Continue | parser.NoChildren
}
func (b *plaintextParserNoParagraph) Close(node ast.Node, reader text.Reader, pc parser.Context) {}
func (b *plaintextParserNoParagraph) CanInterruptParagraph() bool {
return false
}
func (b *plaintextParserNoParagraph) CanAcceptIndentedLine() bool {
return true
}

View file

@ -30,26 +30,28 @@
"github.com/yuin/goldmark/util"
)
func (f *formatter) FromPlain(ctx context.Context, pmf gtsmodel.ParseMentionFunc, authorID string, statusID string, plain string) *FormatResult {
func (f *formatter) fromPlain(
ctx context.Context,
ptParser parser.Parser,
pmf gtsmodel.ParseMentionFunc,
authorID string,
statusID string,
plain string,
) *FormatResult {
result := &FormatResult{
Mentions: []*gtsmodel.Mention{},
Tags: []*gtsmodel.Tag{},
Emojis: []*gtsmodel.Emoji{},
}
// parse markdown text into html, using custom renderer to add hashtag/mention links
// Parse markdown into html, using custom renderer
// to add hashtag/mention links and emoji images.
md := goldmark.New(
goldmark.WithRendererOptions(
html.WithXHTML(),
html.WithHardWraps(),
),
goldmark.WithParser(
parser.NewParser(
parser.WithBlockParsers(
util.Prioritized(newPlaintextParser(), 500),
),
),
),
goldmark.WithParser(ptParser), // use parser we were passed
goldmark.WithExtensions(
&customRenderer{f, ctx, pmf, authorID, statusID, false, result},
extension.Linkify, // turns URLs into links
@ -57,20 +59,40 @@ func (f *formatter) FromPlain(ctx context.Context, pmf gtsmodel.ParseMentionFunc
)
var htmlContentBytes bytes.Buffer
err := md.Convert([]byte(plain), &htmlContentBytes)
if err != nil {
if err := md.Convert([]byte(plain), &htmlContentBytes); err != nil {
log.Errorf(ctx, "error formatting plaintext to HTML: %s", err)
}
result.HTML = htmlContentBytes.String()
// clean anything dangerous out of the HTML
// Clean anything dangerous out of resulting HTML.
result.HTML = SanitizeHTML(result.HTML)
// shrink ray
result.HTML, err = m.String("text/html", result.HTML)
if err != nil {
// Shrink ray!
var err error
if result.HTML, err = m.String("text/html", result.HTML); err != nil {
log.Errorf(ctx, "error minifying HTML: %s", err)
}
return result
}
func (f *formatter) FromPlain(ctx context.Context, pmf gtsmodel.ParseMentionFunc, authorID string, statusID string, plain string) *FormatResult {
ptParser := parser.NewParser(
parser.WithBlockParsers(
util.Prioritized(newPlaintextParser(), 500),
),
)
return f.fromPlain(ctx, ptParser, pmf, authorID, statusID, plain)
}
func (f *formatter) FromPlainNoParagraph(ctx context.Context, pmf gtsmodel.ParseMentionFunc, authorID string, statusID string, plain string) *FormatResult {
ptParser := parser.NewParser(
parser.WithBlockParsers(
// Initialize block parser that doesn't wrap in <p> tags.
util.Prioritized(newPlaintextParserNoParagraph(), 500),
),
)
return f.fromPlain(ctx, ptParser, pmf, authorID, statusID, plain)
}

View file

@ -25,14 +25,16 @@
)
const (
simple = "this is a plain and simple status"
simpleExpected = "<p>this is a plain and simple status</p>"
withTag = "here's a simple status that uses hashtag #welcome!"
withTagExpected = "<p>here's a simple status that uses hashtag <a href=\"http://localhost:8080/tags/welcome\" class=\"mention hashtag\" rel=\"tag nofollow noreferrer noopener\" target=\"_blank\">#<span>welcome</span></a>!</p>"
withHTML = "<div>blah this should just be html escaped blah</div>"
withHTMLExpected = "<p>&lt;div>blah this should just be html escaped blah&lt;/div></p>"
moreComplex = "Another test @foss_satan@fossbros-anonymous.io\n\n#Hashtag\n\nText\n\n:rainbow:"
moreComplexExpected = "<p>Another test <span class=\"h-card\"><a href=\"http://fossbros-anonymous.io/@foss_satan\" class=\"u-url mention\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">@<span>foss_satan</span></a></span><br><br><a href=\"http://localhost:8080/tags/Hashtag\" class=\"mention hashtag\" rel=\"tag nofollow noreferrer noopener\" target=\"_blank\">#<span>Hashtag</span></a><br><br>Text<br><br>:rainbow:</p>"
simple = "this is a plain and simple status"
simpleExpected = "<p>this is a plain and simple status</p>"
simpleExpectedNoParagraph = "this is a plain and simple status"
withTag = "here's a simple status that uses hashtag #welcome!"
withTagExpected = "<p>here's a simple status that uses hashtag <a href=\"http://localhost:8080/tags/welcome\" class=\"mention hashtag\" rel=\"tag nofollow noreferrer noopener\" target=\"_blank\">#<span>welcome</span></a>!</p>"
withTagExpectedNoParagraph = "here's a simple status that uses hashtag <a href=\"http://localhost:8080/tags/welcome\" class=\"mention hashtag\" rel=\"tag nofollow noreferrer noopener\" target=\"_blank\">#<span>welcome</span></a>!"
withHTML = "<div>blah this should just be html escaped blah</div>"
withHTMLExpected = "<p>&lt;div>blah this should just be html escaped blah&lt;/div></p>"
moreComplex = "Another test @foss_satan@fossbros-anonymous.io\n\n#Hashtag\n\nText\n\n:rainbow:"
moreComplexExpected = "<p>Another test <span class=\"h-card\"><a href=\"http://fossbros-anonymous.io/@foss_satan\" class=\"u-url mention\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">@<span>foss_satan</span></a></span><br><br><a href=\"http://localhost:8080/tags/Hashtag\" class=\"mention hashtag\" rel=\"tag nofollow noreferrer noopener\" target=\"_blank\">#<span>Hashtag</span></a><br><br>Text<br><br>:rainbow:</p>"
)
type PlainTestSuite struct {
@ -44,11 +46,21 @@ func (suite *PlainTestSuite) TestParseSimple() {
suite.Equal(simpleExpected, formatted.HTML)
}
func (suite *PlainTestSuite) TestParseSimpleNoParagraph() {
formatted := suite.FromPlainNoParagraph(simple)
suite.Equal(simpleExpectedNoParagraph, formatted.HTML)
}
func (suite *PlainTestSuite) TestParseWithTag() {
formatted := suite.FromPlain(withTag)
suite.Equal(withTagExpected, formatted.HTML)
}
func (suite *PlainTestSuite) TestParseWithTagNoParagraph() {
formatted := suite.FromPlainNoParagraph(withTag)
suite.Equal(withTagExpectedNoParagraph, formatted.HTML)
}
func (suite *PlainTestSuite) TestParseWithHTML() {
formatted := suite.FromPlain(withHTML)
suite.Equal(withHTMLExpected, formatted.HTML)

View file

@ -29,7 +29,7 @@
"codeberg.org/gruf/go-byteutil"
"codeberg.org/gruf/go-cache/v3"
"github.com/superseriousbusiness/activity/pub"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/federation/federatingdb"
"github.com/superseriousbusiness/gotosocial/internal/httpclient"
@ -157,7 +157,7 @@ func (c *controller) dereferenceLocalFollowers(ctx context.Context, iri *url.URL
return nil, err
}
i, err := streams.Serialize(followers)
i, err := ap.Serialize(followers)
if err != nil {
return nil, err
}
@ -175,7 +175,7 @@ func (c *controller) dereferenceLocalUser(ctx context.Context, iri *url.URL) ([]
return nil, err
}
i, err := streams.Serialize(user)
i, err := ap.Serialize(user)
if err != nil {
return nil, err
}

View file

@ -86,7 +86,8 @@ func (c *converter) ASRepresentationToAccount(ctx context.Context, accountable a
acct.Emojis = emojis
}
// TODO: fields aka attachment array
// fields aka attachment array
acct.Fields = ap.ExtractFields(accountable)
// note aka summary
acct.Note = ap.ExtractSummary(accountable)

View file

@ -240,7 +240,25 @@ func (c *converter) AccountToAS(ctx context.Context, a *gtsmodel.Account) (vocab
// attachment
// Used for profile fields.
// TODO: The PropertyValue type has to be added: https://schema.org/PropertyValue
if len(a.Fields) != 0 {
attachmentProp := streams.NewActivityStreamsAttachmentProperty()
for _, field := range a.Fields {
propertyValue := streams.NewSchemaPropertyValue()
nameProp := streams.NewActivityStreamsNameProperty()
nameProp.AppendXMLSchemaString(field.Name)
propertyValue.SetActivityStreamsName(nameProp)
valueProp := streams.NewSchemaValueProperty()
valueProp.Set(field.Value)
propertyValue.SetSchemaValue(valueProp)
attachmentProp.AppendSchemaPropertyValue(propertyValue)
}
person.SetActivityStreamsAttachment(attachmentProp)
}
// endpoints
// NOT IMPLEMENTED -- this is for shared inbox which we don't use

View file

@ -21,11 +21,11 @@
"context"
"encoding/json"
"errors"
"fmt"
"strings"
"testing"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
@ -43,7 +43,7 @@ func (suite *InternalToASTestSuite) TestAccountToAS() {
asPerson, err := suite.typeconverter.AccountToAS(context.Background(), testAccount)
suite.NoError(err)
ser, err := streams.Serialize(asPerson)
ser, err := ap.Serialize(asPerson)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -85,6 +85,107 @@ func (suite *InternalToASTestSuite) TestAccountToAS() {
}`, trimmed)
}
func (suite *InternalToASTestSuite) TestAccountToASWithFields() {
testAccount := &gtsmodel.Account{}
*testAccount = *suite.testAccounts["local_account_2"]
asPerson, err := suite.typeconverter.AccountToAS(context.Background(), testAccount)
suite.NoError(err)
ser, err := ap.Serialize(asPerson)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
suite.NoError(err)
// trim off everything up to 'attachment';
// this is necessary because the order of multiple 'context' entries is not determinate
trimmed := strings.Split(string(bytes), "\"attachment\"")[1]
fmt.Printf("\n\n\n%s\n\n\n", string(bytes))
suite.Equal(`: [
{
"name": "should you follow me?",
"type": "PropertyValue",
"value": "maybe!"
},
{
"name": "age",
"type": "PropertyValue",
"value": "120"
}
],
"discoverable": false,
"featured": "http://localhost:8080/users/1happyturtle/collections/featured",
"followers": "http://localhost:8080/users/1happyturtle/followers",
"following": "http://localhost:8080/users/1happyturtle/following",
"id": "http://localhost:8080/users/1happyturtle",
"inbox": "http://localhost:8080/users/1happyturtle/inbox",
"manuallyApprovesFollowers": true,
"name": "happy little turtle :3",
"outbox": "http://localhost:8080/users/1happyturtle/outbox",
"preferredUsername": "1happyturtle",
"publicKey": {
"id": "http://localhost:8080/users/1happyturtle#main-key",
"owner": "http://localhost:8080/users/1happyturtle",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtTc6Jpg6LrRPhVQG4KLz\n2+YqEUUtZPd4YR+TKXuCnwEG9ZNGhgP046xa9h3EWzrZXaOhXvkUQgJuRqPrAcfN\nvc8jBHV2xrUeD8pu/MWKEabAsA/tgCv3nUC47HQ3/c12aHfYoPz3ufWsGGnrkhci\nv8PaveJ3LohO5vjCn1yZ00v6osMJMViEZvZQaazyE9A8FwraIexXabDpoy7tkHRg\nA1fvSkg4FeSG1XMcIz2NN7xyUuFACD+XkuOk7UqzRd4cjPUPLxiDwIsTlcgGOd3E\nUFMWVlPxSGjY2hIKa3lEHytaYK9IMYdSuyCsJshd3/yYC9LqxZY2KdlKJ80VOVyh\nyQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"summary": "\u003cp\u003ei post about things that concern me\u003c/p\u003e",
"tag": [],
"type": "Person",
"url": "http://localhost:8080/@1happyturtle"
}`, trimmed)
}
func (suite *InternalToASTestSuite) TestAccountToASWithOneField() {
testAccount := &gtsmodel.Account{}
*testAccount = *suite.testAccounts["local_account_2"]
testAccount.Fields = testAccount.Fields[0:1] // Take only one field.
asPerson, err := suite.typeconverter.AccountToAS(context.Background(), testAccount)
suite.NoError(err)
ser, err := ap.Serialize(asPerson)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
suite.NoError(err)
// trim off everything up to 'attachment';
// this is necessary because the order of multiple 'context' entries is not determinate
trimmed := strings.Split(string(bytes), "\"attachment\"")[1]
// Despite only one field being set, attachments should still be a slice/array.
suite.Equal(`: [
{
"name": "should you follow me?",
"type": "PropertyValue",
"value": "maybe!"
}
],
"discoverable": false,
"featured": "http://localhost:8080/users/1happyturtle/collections/featured",
"followers": "http://localhost:8080/users/1happyturtle/followers",
"following": "http://localhost:8080/users/1happyturtle/following",
"id": "http://localhost:8080/users/1happyturtle",
"inbox": "http://localhost:8080/users/1happyturtle/inbox",
"manuallyApprovesFollowers": true,
"name": "happy little turtle :3",
"outbox": "http://localhost:8080/users/1happyturtle/outbox",
"preferredUsername": "1happyturtle",
"publicKey": {
"id": "http://localhost:8080/users/1happyturtle#main-key",
"owner": "http://localhost:8080/users/1happyturtle",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtTc6Jpg6LrRPhVQG4KLz\n2+YqEUUtZPd4YR+TKXuCnwEG9ZNGhgP046xa9h3EWzrZXaOhXvkUQgJuRqPrAcfN\nvc8jBHV2xrUeD8pu/MWKEabAsA/tgCv3nUC47HQ3/c12aHfYoPz3ufWsGGnrkhci\nv8PaveJ3LohO5vjCn1yZ00v6osMJMViEZvZQaazyE9A8FwraIexXabDpoy7tkHRg\nA1fvSkg4FeSG1XMcIz2NN7xyUuFACD+XkuOk7UqzRd4cjPUPLxiDwIsTlcgGOd3E\nUFMWVlPxSGjY2hIKa3lEHytaYK9IMYdSuyCsJshd3/yYC9LqxZY2KdlKJ80VOVyh\nyQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"summary": "\u003cp\u003ei post about things that concern me\u003c/p\u003e",
"tag": [],
"type": "Person",
"url": "http://localhost:8080/@1happyturtle"
}`, trimmed)
}
func (suite *InternalToASTestSuite) TestAccountToASWithEmoji() {
testAccount := &gtsmodel.Account{}
*testAccount = *suite.testAccounts["local_account_1"] // take zork for this test
@ -93,7 +194,7 @@ func (suite *InternalToASTestSuite) TestAccountToASWithEmoji() {
asPerson, err := suite.typeconverter.AccountToAS(context.Background(), testAccount)
suite.NoError(err)
ser, err := streams.Serialize(asPerson)
ser, err := ap.Serialize(asPerson)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -154,7 +255,7 @@ func (suite *InternalToASTestSuite) TestAccountToASWithSharedInbox() {
asPerson, err := suite.typeconverter.AccountToAS(context.Background(), testAccount)
suite.NoError(err)
ser, err := streams.Serialize(asPerson)
ser, err := ap.Serialize(asPerson)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -206,7 +307,7 @@ func (suite *InternalToASTestSuite) TestOutboxToASCollection() {
collection, err := suite.typeconverter.OutboxToASCollection(ctx, testAccount.OutboxURI)
suite.NoError(err)
ser, err := streams.Serialize(collection)
ser, err := ap.Serialize(collection)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -227,7 +328,7 @@ func (suite *InternalToASTestSuite) TestStatusToAS() {
asStatus, err := suite.typeconverter.StatusToAS(ctx, testStatus)
suite.NoError(err)
ser, err := streams.Serialize(asStatus)
ser, err := ap.Serialize(asStatus)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -268,7 +369,7 @@ func (suite *InternalToASTestSuite) TestStatusWithTagsToASWithIDs() {
asStatus, err := suite.typeconverter.StatusToAS(ctx, testStatus)
suite.NoError(err)
ser, err := streams.Serialize(asStatus)
ser, err := ap.Serialize(asStatus)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -328,7 +429,7 @@ func (suite *InternalToASTestSuite) TestStatusWithTagsToASFromDB() {
asStatus, err := suite.typeconverter.StatusToAS(ctx, testStatus)
suite.NoError(err)
ser, err := streams.Serialize(asStatus)
ser, err := ap.Serialize(asStatus)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -389,7 +490,7 @@ func (suite *InternalToASTestSuite) TestStatusToASWithMentions() {
asStatus, err := suite.typeconverter.StatusToAS(ctx, testStatus)
suite.NoError(err)
ser, err := streams.Serialize(asStatus)
ser, err := ap.Serialize(asStatus)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -437,7 +538,7 @@ func (suite *InternalToASTestSuite) TestStatusToASDeletePublicReply() {
asDelete, err := suite.typeconverter.StatusToASDelete(ctx, testStatus)
suite.NoError(err)
ser, err := streams.Serialize(asDelete)
ser, err := ap.Serialize(asDelete)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -475,7 +576,7 @@ func (suite *InternalToASTestSuite) TestStatusToASDeletePublicReplyOriginalDelet
asDelete, err := suite.typeconverter.StatusToASDelete(ctx, testStatus)
suite.NoError(err)
ser, err := streams.Serialize(asDelete)
ser, err := ap.Serialize(asDelete)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -501,7 +602,7 @@ func (suite *InternalToASTestSuite) TestStatusToASDeletePublic() {
asDelete, err := suite.typeconverter.StatusToASDelete(ctx, testStatus)
suite.NoError(err)
ser, err := streams.Serialize(asDelete)
ser, err := ap.Serialize(asDelete)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -524,7 +625,7 @@ func (suite *InternalToASTestSuite) TestStatusToASDeleteDirectMessage() {
asDelete, err := suite.typeconverter.StatusToASDelete(ctx, testStatus)
suite.NoError(err)
ser, err := streams.Serialize(asDelete)
ser, err := ap.Serialize(asDelete)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -551,7 +652,7 @@ func (suite *InternalToASTestSuite) TestStatusesToASOutboxPage() {
page, err := suite.typeconverter.StatusesToASOutboxPage(ctx, testAccount.OutboxURI, "", "", statuses)
suite.NoError(err)
ser, err := streams.Serialize(page)
ser, err := ap.Serialize(page)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -604,7 +705,7 @@ func (suite *InternalToASTestSuite) TestSelfBoostFollowersOnlyToAS() {
asBoost, err := suite.typeconverter.BoostToAS(ctx, boostWrapperStatus, testAccount, testAccount)
suite.NoError(err)
ser, err := streams.Serialize(asBoost)
ser, err := ap.Serialize(asBoost)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -637,7 +738,7 @@ func (suite *InternalToASTestSuite) TestReportToAS() {
flag, err := suite.typeconverter.ReportToASFlag(ctx, testReport)
suite.NoError(err)
ser, err := streams.Serialize(flag)
ser, err := ap.Serialize(flag)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -670,7 +771,7 @@ func (suite *InternalToASTestSuite) TestPinnedStatusesToASSomeItems() {
suite.FailNow(err.Error())
}
ser, err := ap.SerializeOrderedCollection(collection)
ser, err := ap.Serialize(collection)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -702,7 +803,7 @@ func (suite *InternalToASTestSuite) TestPinnedStatusesToASNoItems() {
suite.FailNow(err.Error())
}
ser, err := ap.SerializeOrderedCollection(collection)
ser, err := ap.Serialize(collection)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@ -731,7 +832,7 @@ func (suite *InternalToASTestSuite) TestPinnedStatusesToASOneItem() {
suite.FailNow(err.Error())
}
ser, err := ap.SerializeOrderedCollection(collection)
ser, err := ap.Serialize(collection)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")

View file

@ -77,7 +77,7 @@ func (c *converter) AccountToAPIAccountSensitive(ctx context.Context, a *gtsmode
Language: a.Language,
StatusContentType: statusContentType,
Note: a.NoteRaw,
Fields: apiAccount.Fields,
Fields: c.fieldsToAPIFields(a.FieldsRaw),
FollowRequestsCount: frc,
}
@ -131,7 +131,6 @@ func (c *converter) AccountToAPIAccountPublic(ctx context.Context, a *gtsmodel.A
aviURLStatic string
headerURL string
headerURLStatic string
fields = make([]apimodel.Field, len(a.Fields))
)
if a.AvatarMediaAttachment != nil {
@ -144,19 +143,8 @@ func (c *converter) AccountToAPIAccountPublic(ctx context.Context, a *gtsmodel.A
headerURLStatic = a.HeaderMediaAttachment.Thumbnail.URL
}
// GTS model fields -> frontend.
for i, field := range a.Fields {
mField := apimodel.Field{
Name: field.Name,
Value: field.Value,
}
if !field.VerifiedAt.IsZero() {
mField.VerifiedAt = util.FormatISO8601(field.VerifiedAt)
}
fields[i] = mField
}
// convert account gts model fields to front api model fields
fields := c.fieldsToAPIFields(a.Fields)
// GTS model emojis -> frontend.
apiEmojis, err := c.convertEmojisToAPIEmojis(ctx, a.Emojis, a.EmojiIDs)
@ -239,6 +227,25 @@ func (c *converter) AccountToAPIAccountPublic(ctx context.Context, a *gtsmodel.A
return accountFrontend, nil
}
func (c *converter) fieldsToAPIFields(f []*gtsmodel.Field) []apimodel.Field {
fields := make([]apimodel.Field, len(f))
for i, field := range f {
mField := apimodel.Field{
Name: field.Name,
Value: field.Value,
}
if !field.VerifiedAt.IsZero() {
mField.VerifiedAt = func() *string { s := util.FormatISO8601(field.VerifiedAt); return &s }()
}
fields[i] = mField
}
return fields
}
func (c *converter) AccountToAPIAccountBlocked(ctx context.Context, a *gtsmodel.Account) (*apimodel.Account, error) {
var (
acct string

View file

@ -873,7 +873,18 @@ func (suite *InternalToFrontendTestSuite) TestReportToFrontend2() {
"statuses_count": 7,
"last_status_at": "2021-10-20T10:40:37.000Z",
"emojis": [],
"fields": [],
"fields": [
{
"name": "should you follow me?",
"value": "maybe!",
"verified_at": null
},
{
"name": "age",
"value": "120",
"verified_at": null
}
],
"role": {
"name": "user"
}
@ -977,7 +988,18 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend1() {
"statuses_count": 7,
"last_status_at": "2021-10-20T10:40:37.000Z",
"emojis": [],
"fields": [],
"fields": [
{
"name": "should you follow me?",
"value": "maybe!",
"verified_at": null
},
{
"name": "age",
"value": "120",
"verified_at": null
}
],
"role": {
"name": "user"
}
@ -1137,7 +1159,18 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend2() {
"statuses_count": 7,
"last_status_at": "2021-10-20T10:40:37.000Z",
"emojis": [],
"fields": [],
"fields": [
{
"name": "should you follow me?",
"value": "maybe!",
"verified_at": null
},
{
"name": "age",
"value": "120",
"verified_at": null
}
],
"role": {
"name": "user"
}

View file

@ -23,7 +23,7 @@
"testing"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
)
type WrapTestSuite struct {
@ -40,7 +40,7 @@ func (suite *WrapTestSuite) TestWrapNoteInCreateIRIOnly() {
suite.NoError(err)
suite.NotNil(create)
createI, err := streams.Serialize(create)
createI, err := ap.Serialize(create)
suite.NoError(err)
bytes, err := json.MarshalIndent(createI, "", " ")
@ -68,7 +68,7 @@ func (suite *WrapTestSuite) TestWrapNoteInCreate() {
suite.NoError(err)
suite.NotNil(create)
createI, err := streams.Serialize(create)
createI, err := ap.Serialize(create)
suite.NoError(err)
bytes, err := json.MarshalIndent(createI, "", " ")

View file

@ -50,7 +50,7 @@ func happyAccount() *gtsmodel.Account {
HeaderMediaAttachment: nil,
HeaderRemoteURL: "",
DisplayName: "original zork (he/they)",
Fields: []gtsmodel.Field{},
Fields: []*gtsmodel.Field{},
Note: "hey yo this is my profile!",
Memorial: testrig.FalseBool(),
AlsoKnownAs: "",

View file

@ -25,6 +25,7 @@
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/regexes"
pwv "github.com/wagslane/go-password-validator"
"golang.org/x/text/language"
@ -43,7 +44,7 @@
maximumCustomCSSLength = 5000
maximumEmojiCategoryLength = 64
maximumProfileFieldLength = 255
maximumProfileFields = 4
maximumProfileFields = 6
)
// NewPassword returns an error if the given password is not sufficiently strong, or nil if it's ok.
@ -233,19 +234,26 @@ func ULID(i string) bool {
return regexes.ULID.MatchString(i)
}
func ProfileFieldsCount(fields []apimodel.UpdateField) error {
if length := len(fields); length > maximumProfileFields {
// ProfileFields validates the length of provided fields slice,
// and also iterates through the fields and trims each name + value
// to maximumProfileFieldLength, if they were above.
func ProfileFields(fields []*gtsmodel.Field) error {
if len(fields) > maximumProfileFields {
return fmt.Errorf("cannot have more than %d profile fields", maximumProfileFields)
}
// Trim each field name + value to maximum allowed length.
for _, field := range fields {
n := []rune(field.Name)
if len(n) > maximumProfileFieldLength {
field.Name = string(n[:maximumProfileFieldLength])
}
v := []rune(field.Value)
if len(v) > maximumProfileFieldLength {
field.Value = string(v[:maximumProfileFieldLength])
}
}
return nil
}
func ProfileField(f *string) string {
s := []rune(*f)
if len(s) > maximumProfileFieldLength {
return string(s[:maximumProfileFieldLength]) // trim profile field to maximum allowed length
}
return string(*f)
}

View file

@ -24,7 +24,7 @@
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/api/model"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/validate"
)
@ -268,37 +268,34 @@ func (suite *ValidationTestSuite) TestValidateReason() {
}
}
func (suite *ValidationTestSuite) TestValidateProfileFieldsCount() {
noFields := []model.UpdateField{}
fewFields := []model.UpdateField{{}, {}}
tooManyFields := []model.UpdateField{{}, {}, {}, {}, {}}
err := validate.ProfileFieldsCount(tooManyFields)
if assert.Error(suite.T(), err) {
assert.Equal(suite.T(), errors.New("cannot have more than 4 profile fields"), err)
}
err = validate.ProfileFieldsCount(noFields)
assert.NoError(suite.T(), err)
err = validate.ProfileFieldsCount(fewFields)
assert.NoError(suite.T(), err)
}
func (suite *ValidationTestSuite) TestValidateProfileField() {
shortProfileField := "pronouns"
tooLongProfileField := "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eu bibendum elit. Sed ac interdum nisi. Vestibulum vulputate eros quis euismod imperdiet. Nulla sit amet dui sit amet lorem consectetur iaculis. Mauris eget lacinia metus. Curabitur nec dui eleifend massa nunc."
trimmedProfileField := "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eu bibendum elit. Sed ac interdum nisi. Vestibulum vulputate eros quis euismod imperdiet. Nulla sit amet dui sit amet lorem consectetur iaculis. Mauris eget lacinia metus. Curabitur nec dui "
var (
shortProfileField = "pronouns"
tooLongProfileField = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eu bibendum elit. Sed ac interdum nisi. Vestibulum vulputate eros quis euismod imperdiet. Nulla sit amet dui sit amet lorem consectetur iaculis. Mauris eget lacinia metus. Curabitur nec dui eleifend massa nunc."
trimmedProfileField = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eu bibendum elit. Sed ac interdum nisi. Vestibulum vulputate eros quis euismod imperdiet. Nulla sit amet dui sit amet lorem consectetur iaculis. Mauris eget lacinia metus. Curabitur nec dui "
err error
)
validated := validate.ProfileField(&shortProfileField)
assert.Equal(suite.T(), shortProfileField, validated)
okFields := []*gtsmodel.Field{
{
Name: "example",
Value: shortProfileField,
},
}
err = validate.ProfileFields(okFields)
suite.NoError(err)
suite.Equal(shortProfileField, okFields[0].Value)
validated = validate.ProfileField(&tooLongProfileField)
assert.Len(suite.T(), validated, 255)
assert.Equal(suite.T(), trimmedProfileField, validated)
validated = validate.ProfileField(&trimmedProfileField)
assert.Len(suite.T(), validated, 255)
assert.Equal(suite.T(), trimmedProfileField, validated)
dodgyFields := []*gtsmodel.Field{
{
Name: "example",
Value: tooLongProfileField,
},
}
err = validate.ProfileFields(dodgyFields)
suite.NoError(err)
suite.Equal(trimmedProfileField, dodgyFields[0].Value)
suite.Len(dodgyFields[0].Value, 255)
}
func TestValidationTestSuite(t *testing.T) {

View file

@ -317,7 +317,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
AvatarMediaAttachmentID: "",
HeaderMediaAttachmentID: "",
DisplayName: "",
Fields: []gtsmodel.Field{},
Fields: []*gtsmodel.Field{},
Note: "",
NoteRaw: "",
Memorial: FalseBool(),
@ -357,7 +357,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
AvatarMediaAttachmentID: "",
HeaderMediaAttachmentID: "",
DisplayName: "",
Fields: []gtsmodel.Field{},
Fields: []*gtsmodel.Field{},
Note: "",
Memorial: FalseBool(),
MovedToAccountID: "",
@ -395,7 +395,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
AvatarMediaAttachmentID: "",
HeaderMediaAttachmentID: "",
DisplayName: "",
Fields: []gtsmodel.Field{},
Fields: []*gtsmodel.Field{},
Note: "",
NoteRaw: "",
Memorial: FalseBool(),
@ -435,7 +435,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
AvatarMediaAttachmentID: "01F8MH58A357CV5K7R7TJMSH6S",
HeaderMediaAttachmentID: "01PFPMWK2FF0D9WMHEJHR07C3Q",
DisplayName: "original zork (he/they)",
Fields: []gtsmodel.Field{},
Fields: []*gtsmodel.Field{},
Note: "<p>hey yo this is my profile!</p>",
NoteRaw: "hey yo this is my profile!",
Memorial: FalseBool(),
@ -475,45 +475,64 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
AvatarMediaAttachmentID: "",
HeaderMediaAttachmentID: "",
DisplayName: "happy little turtle :3",
Fields: []gtsmodel.Field{},
Note: "<p>i post about things that concern me</p>",
NoteRaw: "i post about things that concern me",
Memorial: FalseBool(),
MovedToAccountID: "",
CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
Bot: FalseBool(),
Reason: "",
Locked: TrueBool(),
Discoverable: FalseBool(),
Privacy: gtsmodel.VisibilityFollowersOnly,
Sensitive: TrueBool(),
Language: "fr",
URI: "http://localhost:8080/users/1happyturtle",
URL: "http://localhost:8080/@1happyturtle",
FetchedAt: time.Time{},
InboxURI: "http://localhost:8080/users/1happyturtle/inbox",
OutboxURI: "http://localhost:8080/users/1happyturtle/outbox",
FollowersURI: "http://localhost:8080/users/1happyturtle/followers",
FollowingURI: "http://localhost:8080/users/1happyturtle/following",
FeaturedCollectionURI: "http://localhost:8080/users/1happyturtle/collections/featured",
ActorType: ap.ActorPerson,
AlsoKnownAs: "",
PrivateKey: &rsa.PrivateKey{},
PublicKey: &rsa.PublicKey{},
PublicKeyURI: "http://localhost:8080/users/1happyturtle#main-key",
SensitizedAt: time.Time{},
SilencedAt: time.Time{},
SuspendedAt: time.Time{},
HideCollections: FalseBool(),
SuspensionOrigin: "",
Fields: []*gtsmodel.Field{
{
Name: "should you follow me?",
Value: "maybe!",
},
{
Name: "age",
Value: "120",
},
},
FieldsRaw: []*gtsmodel.Field{
{
Name: "should you follow me?",
Value: "maybe!",
},
{
Name: "age",
Value: "120",
},
},
Note: "<p>i post about things that concern me</p>",
NoteRaw: "i post about things that concern me",
Memorial: FalseBool(),
MovedToAccountID: "",
CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
Bot: FalseBool(),
Reason: "",
Locked: TrueBool(),
Discoverable: FalseBool(),
Privacy: gtsmodel.VisibilityFollowersOnly,
Sensitive: TrueBool(),
Language: "fr",
URI: "http://localhost:8080/users/1happyturtle",
URL: "http://localhost:8080/@1happyturtle",
FetchedAt: time.Time{},
InboxURI: "http://localhost:8080/users/1happyturtle/inbox",
OutboxURI: "http://localhost:8080/users/1happyturtle/outbox",
FollowersURI: "http://localhost:8080/users/1happyturtle/followers",
FollowingURI: "http://localhost:8080/users/1happyturtle/following",
FeaturedCollectionURI: "http://localhost:8080/users/1happyturtle/collections/featured",
ActorType: ap.ActorPerson,
AlsoKnownAs: "",
PrivateKey: &rsa.PrivateKey{},
PublicKey: &rsa.PublicKey{},
PublicKeyURI: "http://localhost:8080/users/1happyturtle#main-key",
SensitizedAt: time.Time{},
SilencedAt: time.Time{},
SuspendedAt: time.Time{},
HideCollections: FalseBool(),
SuspensionOrigin: "",
},
"remote_account_1": {
ID: "01F8MH5ZK5VRH73AKHQM6Y9VNX",
Username: "foss_satan",
Domain: "fossbros-anonymous.io",
DisplayName: "big gerald",
Fields: []gtsmodel.Field{},
Fields: []*gtsmodel.Field{},
Note: "i post about like, i dunno, stuff, or whatever!!!!",
Memorial: FalseBool(),
MovedToAccountID: "",
@ -549,7 +568,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
Username: "Some_User",
Domain: "example.org",
DisplayName: "some user",
Fields: []gtsmodel.Field{},
Fields: []*gtsmodel.Field{},
Note: "i'm a real son of a gun",
Memorial: FalseBool(),
MovedToAccountID: "",
@ -585,7 +604,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
Username: "her_fuckin_maj",
Domain: "thequeenisstillalive.technology",
DisplayName: "lizzzieeeeeeeeeeee",
Fields: []gtsmodel.Field{},
Fields: []*gtsmodel.Field{},
Note: "if i die blame charles don't let that fuck become king",
Memorial: FalseBool(),
MovedToAccountID: "",

View file

@ -21,7 +21,25 @@
// Note that when using the SideEffectActor with an application that good-faith
// implements its required interfaces, the ActivityPub specification is
// guaranteed to be correctly followed.
//
// When doing deliveries to remote servers via the s2s protocol, the side effect
// actor will by default use the Serialize function from the streams package.
// However, this can be overridden after the side effect actor is intantiated,
// by setting the exposed Serialize function on the struct. For example:
//
// a := NewSideEffectActor(...)
// a.Serialize = func(a vocab.Type) (m map[string]interface{}, e error) {
// // Put your custom serializer logic here.
// }
//
// Note that you should only do this *immediately* after instantiating the side
// effect actor -- never while your application is already running, as this will
// likely cause race conditions or other problems! In most cases, you will never
// need to change this; it's provided solely to allow easier customization by
// applications.
type SideEffectActor struct {
Serialize func(a vocab.Type) (m map[string]interface{}, e error)
common CommonBehavior
s2s FederatingProtocol
c2s SocialProtocol
@ -38,18 +56,19 @@ type SideEffectActor struct {
//
// If you are using the returned SideEffectActor for federation, ensure that s2s
// is not nil. Likewise, if you are using it for the social protocol, ensure
// that c2s is not nil.
// that c2s is not nil.
func NewSideEffectActor(c CommonBehavior,
s2s FederatingProtocol,
c2s SocialProtocol,
db Database,
clock Clock) *SideEffectActor {
return &SideEffectActor{
common: c,
s2s: s2s,
c2s: c2s,
db: db,
clock: clock,
Serialize: streams.Serialize,
common: c,
s2s: s2s,
c2s: c2s,
db: db,
clock: clock,
}
}
@ -451,18 +470,23 @@ func (a *SideEffectActor) WrapInCreate(c context.Context, obj vocab.Type, outbox
// deliverToRecipients will take a prepared Activity and send it to specific
// recipients on behalf of an actor.
func (a *SideEffectActor) deliverToRecipients(c context.Context, boxIRI *url.URL, activity Activity, recipients []*url.URL) error {
m, err := streams.Serialize(activity)
// Call whichever serializer is
// set on the side effect actor.
m, err := a.Serialize(activity)
if err != nil {
return err
}
b, err := json.Marshal(m)
if err != nil {
return err
}
tp, err := a.common.NewTransport(c, boxIRI, goFedUserAgent())
if err != nil {
return err
}
return tp.BatchDeliver(c, b, recipients)
}

View file

@ -137,6 +137,9 @@
// ActivityStreamsProfileName is the string literal of the name for the Profile type in the ActivityStreams vocabulary.
var ActivityStreamsProfileName string = "Profile"
// SchemaPropertyValueName is the string literal of the name for the PropertyValue type in the Schema vocabulary.
var SchemaPropertyValueName string = "PropertyValue"
// W3IDSecurityV1PublicKeyName is the string literal of the name for the PublicKey type in the W3IDSecurityV1 vocabulary.
var W3IDSecurityV1PublicKeyName string = "PublicKey"
@ -509,6 +512,9 @@
// ActivityStreamsUrlPropertyName is the string literal of the name for the url property in the ActivityStreams vocabulary.
var ActivityStreamsUrlPropertyName string = "url"
// SchemaValuePropertyName is the string literal of the name for the value property in the Schema vocabulary.
var SchemaValuePropertyName string = "value"
// TootVotersCountPropertyName is the string literal of the name for the votersCount property in the Toot vocabulary.
var TootVotersCountPropertyName string = "votersCount"

View file

@ -158,6 +158,8 @@
typerepository "github.com/superseriousbusiness/activity/streams/impl/forgefed/type_repository"
typeticket "github.com/superseriousbusiness/activity/streams/impl/forgefed/type_ticket"
typeticketdependency "github.com/superseriousbusiness/activity/streams/impl/forgefed/type_ticketdependency"
propertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/property_value"
typepropertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/type_propertyvalue"
propertyblurhash "github.com/superseriousbusiness/activity/streams/impl/toot/property_blurhash"
propertydiscoverable "github.com/superseriousbusiness/activity/streams/impl/toot/property_discoverable"
propertyfeatured "github.com/superseriousbusiness/activity/streams/impl/toot/property_featured"
@ -340,6 +342,8 @@ func init() {
typerepository.SetManager(mgr)
typeticket.SetManager(mgr)
typeticketdependency.SetManager(mgr)
propertyvalue.SetManager(mgr)
typepropertyvalue.SetManager(mgr)
propertyblurhash.SetManager(mgr)
propertydiscoverable.SetManager(mgr)
propertyfeatured.SetManager(mgr)
@ -413,6 +417,7 @@ func init() {
typerepository.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typeticket.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typeticketdependency.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typepropertyvalue.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typeemoji.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typeidentityproof.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typepublickey.SetTypePropertyConstructor(NewJSONLDTypeProperty)

View file

@ -121,6 +121,8 @@ func NewJSONResolver(callbacks ...interface{}) (*JSONResolver, error) {
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsProfile) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.SchemaPropertyValue) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.W3IDSecurityV1PublicKey) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ForgeFedPush) error:
@ -252,6 +254,13 @@ func (this JSONResolver) Resolve(ctx context.Context, m map[string]interface{})
if len(TootAlias) > 0 {
TootAlias += ":"
}
SchemaAlias, ok := aliasMap["https://schema.org"]
if !ok {
SchemaAlias = aliasMap["http://schema.org"]
}
if len(SchemaAlias) > 0 {
SchemaAlias += ":"
}
W3IDSecurityV1Alias, ok := aliasMap["https://w3id.org/security/v1"]
if !ok {
W3IDSecurityV1Alias = aliasMap["http://w3id.org/security/v1"]
@ -755,6 +764,17 @@ func (this JSONResolver) Resolve(ctx context.Context, m map[string]interface{})
}
}
return ErrNoCallbackMatch
} else if typeString == SchemaAlias+"PropertyValue" {
v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap)
if err != nil {
return err
}
for _, i := range this.callbacks {
if fn, ok := i.(func(context.Context, vocab.SchemaPropertyValue) error); ok {
return fn(ctx, v)
}
}
return ErrNoCallbackMatch
} else if typeString == W3IDSecurityV1Alias+"PublicKey" {
v, err := mgr.DeserializePublicKeyW3IDSecurityV1()(m, aliasMap)
if err != nil {

View file

@ -160,6 +160,8 @@
typeticketdependency "github.com/superseriousbusiness/activity/streams/impl/forgefed/type_ticketdependency"
propertyid "github.com/superseriousbusiness/activity/streams/impl/jsonld/property_id"
propertytype "github.com/superseriousbusiness/activity/streams/impl/jsonld/property_type"
propertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/property_value"
typepropertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/type_propertyvalue"
propertyblurhash "github.com/superseriousbusiness/activity/streams/impl/toot/property_blurhash"
propertydiscoverable "github.com/superseriousbusiness/activity/streams/impl/toot/property_discoverable"
propertyfeatured "github.com/superseriousbusiness/activity/streams/impl/toot/property_featured"
@ -1693,6 +1695,18 @@ func (this Manager) DeserializeProfileActivityStreams() func(map[string]interfac
}
}
// DeserializePropertyValueSchema returns the deserialization method for the
// "SchemaPropertyValue" non-functional property in the vocabulary "Schema"
func (this Manager) DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.SchemaPropertyValue, error) {
i, err := typepropertyvalue.DeserializePropertyValue(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializePublicKeyPemPropertyW3IDSecurityV1 returns the deserialization
// method for the "W3IDSecurityV1PublicKeyPemProperty" non-functional property
// in the vocabulary "W3IDSecurityV1"
@ -2311,6 +2325,18 @@ func (this Manager) DeserializeUrlPropertyActivityStreams() func(map[string]inte
}
}
// DeserializeValuePropertySchema returns the deserialization method for the
// "SchemaValueProperty" non-functional property in the vocabulary "Schema"
func (this Manager) DeserializeValuePropertySchema() func(map[string]interface{}, map[string]string) (vocab.SchemaValueProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.SchemaValueProperty, error) {
i, err := propertyvalue.DeserializeValueProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeVideoActivityStreams returns the deserialization method for the
// "ActivityStreamsVideo" non-functional property in the vocabulary
// "ActivityStreams"

View file

@ -0,0 +1,14 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typepropertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/type_propertyvalue"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// SchemaPropertyValueIsDisjointWith returns true if PropertyValue is disjoint
// with the other's type.
func SchemaPropertyValueIsDisjointWith(other vocab.Type) bool {
return typepropertyvalue.PropertyValueIsDisjointWith(other)
}

View file

@ -0,0 +1,15 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typepropertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/type_propertyvalue"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// SchemaPropertyValueIsExtendedBy returns true if the other's type extends from
// PropertyValue. Note that it returns false if the types are the same; see
// the "IsOrExtends" variant instead.
func SchemaPropertyValueIsExtendedBy(other vocab.Type) bool {
return typepropertyvalue.PropertyValueIsExtendedBy(other)
}

View file

@ -0,0 +1,14 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typepropertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/type_propertyvalue"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// SchemaSchemaPropertyValueExtends returns true if PropertyValue extends from the
// other's type.
func SchemaSchemaPropertyValueExtends(other vocab.Type) bool {
return typepropertyvalue.SchemaPropertyValueExtends(other)
}

View file

@ -0,0 +1,14 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typepropertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/type_propertyvalue"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// IsOrExtendsSchemaPropertyValue returns true if the other provided type is the
// PropertyValue type or extends from the PropertyValue type.
func IsOrExtendsSchemaPropertyValue(other vocab.Type) bool {
return typepropertyvalue.IsOrExtendsPropertyValue(other)
}

View file

@ -0,0 +1,13 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
propertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/property_value"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// NewSchemaSchemaValueProperty creates a new SchemaValueProperty
func NewSchemaValueProperty() vocab.SchemaValueProperty {
return propertyvalue.NewSchemaValueProperty()
}

View file

@ -0,0 +1,13 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typepropertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/type_propertyvalue"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// NewSchemaPropertyValue creates a new SchemaPropertyValue
func NewSchemaPropertyValue() vocab.SchemaPropertyValue {
return typepropertyvalue.NewSchemaPropertyValue()
}

View file

@ -181,6 +181,9 @@ func ToType(c context.Context, m map[string]interface{}) (t vocab.Type, err erro
}, func(ctx context.Context, i vocab.ActivityStreamsProfile) error {
t = i
return nil
}, func(ctx context.Context, i vocab.SchemaPropertyValue) error {
t = i
return nil
}, func(ctx context.Context, i vocab.W3IDSecurityV1PublicKey) error {
t = i
return nil

View file

@ -119,6 +119,8 @@ func NewTypePredicatedResolver(delegate Resolver, predicate interface{}) (*TypeP
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.ActivityStreamsProfile) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.SchemaPropertyValue) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.W3IDSecurityV1PublicKey) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.ForgeFedPush) (bool, error):
@ -671,6 +673,17 @@ func (this TypePredicatedResolver) Apply(ctx context.Context, o ActivityStreamsI
} else {
return false, ErrPredicateUnmatched
}
} else if o.VocabularyURI() == "http://schema.org" && o.GetTypeName() == "PropertyValue" {
if fn, ok := this.predicate.(func(context.Context, vocab.SchemaPropertyValue) (bool, error)); ok {
if v, ok := o.(vocab.SchemaPropertyValue); ok {
predicatePasses, err = fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false, errCannotTypeAssertType
}
} else {
return false, ErrPredicateUnmatched
}
} else if o.VocabularyURI() == "https://w3id.org/security/v1" && o.GetTypeName() == "PublicKey" {
if fn, ok := this.predicate.(func(context.Context, vocab.W3IDSecurityV1PublicKey) (bool, error)); ok {
if v, ok := o.(vocab.W3IDSecurityV1PublicKey); ok {

View file

@ -118,6 +118,8 @@ func NewTypeResolver(callbacks ...interface{}) (*TypeResolver, error) {
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsProfile) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.SchemaPropertyValue) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.W3IDSecurityV1PublicKey) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ForgeFedPush) error:
@ -576,6 +578,15 @@ func (this TypeResolver) Resolve(ctx context.Context, o ActivityStreamsInterface
return errCannotTypeAssertType
}
}
} else if o.VocabularyURI() == "http://schema.org" && o.GetTypeName() == "PropertyValue" {
if fn, ok := i.(func(context.Context, vocab.SchemaPropertyValue) error); ok {
if v, ok := o.(vocab.SchemaPropertyValue); ok {
return fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return errCannotTypeAssertType
}
}
} else if o.VocabularyURI() == "https://w3id.org/security/v1" && o.GetTypeName() == "PublicKey" {
if fn, ok := i.(func(context.Context, vocab.W3IDSecurityV1PublicKey) error); ok {
if v, ok := o.(vocab.W3IDSecurityV1PublicKey); ok {

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsActorPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsActorPropertyIterator(i interface{}, aliasMap map
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsActorPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsActorPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsActorPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsActorPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsActorPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsActorPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsActorPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsActorPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsActorPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsActorPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsActorPropertyIterator) JSONLDContext() map[string]stri
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsActorPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsActorPropertyIterator) LessThan(o vocab.ActivityStream
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsActorPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsActorPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsActorPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsActorPropertyIterator) SetType(t vocab.Type) error {
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsActorPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsActorPropertyIterator) serialize() (interface{}, error
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3771,6 +3817,18 @@ func (this *ActivityStreamsActorProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "actor". Invalidates iterators that are traversing using
// Prev.
func (this *ActivityStreamsActorProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsActorPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "actor". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsActorProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4875,6 +4933,23 @@ func (this *ActivityStreamsActorProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "actor". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsActorProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsActorPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "actor". Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
@ -5147,74 +5222,78 @@ func (this ActivityStreamsActorProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6112,6 +6191,20 @@ func (this *ActivityStreamsActorProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "actor". Invalidates all iterators.
func (this *ActivityStreamsActorProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsActorPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "actor". Invalidates all iterators.
func (this *ActivityStreamsActorProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6983,6 +7076,19 @@ func (this *ActivityStreamsActorProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "actor". Panics if the index is out of bounds. Invalidates
// all iterators.
func (this *ActivityStreamsActorProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsActorPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "actor". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsActorProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsAnyOfPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsAnyOfPropertyIterator(i interface{}, aliasMap map
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsAnyOfPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsAnyOfPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsAnyOfPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsAnyOfPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsAnyOfPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsAnyOfPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsAnyOfPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsAnyOfPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsAnyOfPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsAnyOfPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsAnyOfPropertyIterator) JSONLDContext() map[string]stri
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsAnyOfPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsAnyOfPropertyIterator) LessThan(o vocab.ActivityStream
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsAnyOfPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsAnyOfPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsAnyOfPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsAnyOfPropertyIterator) SetType(t vocab.Type) error {
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsAnyOfPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsAnyOfPropertyIterator) serialize() (interface{}, error
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3771,6 +3817,18 @@ func (this *ActivityStreamsAnyOfProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "anyOf". Invalidates iterators that are traversing using
// Prev.
func (this *ActivityStreamsAnyOfProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsAnyOfPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "anyOf". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsAnyOfProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4875,6 +4933,23 @@ func (this *ActivityStreamsAnyOfProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "anyOf". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsAnyOfProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsAnyOfPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "anyOf". Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
@ -5147,74 +5222,78 @@ func (this ActivityStreamsAnyOfProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6112,6 +6191,20 @@ func (this *ActivityStreamsAnyOfProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "anyOf". Invalidates all iterators.
func (this *ActivityStreamsAnyOfProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsAnyOfPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "anyOf". Invalidates all iterators.
func (this *ActivityStreamsAnyOfProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6983,6 +7076,19 @@ func (this *ActivityStreamsAnyOfProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "anyOf". Panics if the index is out of bounds. Invalidates
// all iterators.
func (this *ActivityStreamsAnyOfProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsAnyOfPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "anyOf". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsAnyOfProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsAttachmentPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsAttachmentPropertyIterator(i interface{}, aliasMa
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsAttachmentPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsAttachmentPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsAttachmentPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsAttachmentPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsAttachmentPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsAttachmentPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsAttachmentPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsAttachmentPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsAttachmentPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsAttachmentPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsAttachmentPropertyIterator) JSONLDContext() map[string
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsAttachmentPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsAttachmentPropertyIterator) LessThan(o vocab.ActivityS
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsAttachmentPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsAttachmentPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsAttachmentPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsAttachmentPropertyIterator) SetType(t vocab.Type) err
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsAttachmentPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsAttachmentPropertyIterator) serialize() (interface{},
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3782,6 +3828,18 @@ func (this *ActivityStreamsAttachmentProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "attachment". Invalidates iterators that are traversing
// using Prev.
func (this *ActivityStreamsAttachmentProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsAttachmentPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "attachment". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsAttachmentProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4888,6 +4946,23 @@ func (this *ActivityStreamsAttachmentProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "attachment". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsAttachmentProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsAttachmentPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "attachment". Existing elements at that index and higher are shifted back
// once. Invalidates all iterators.
@ -5160,74 +5235,78 @@ func (this ActivityStreamsAttachmentProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6126,6 +6205,20 @@ func (this *ActivityStreamsAttachmentProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "attachment". Invalidates all iterators.
func (this *ActivityStreamsAttachmentProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsAttachmentPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "attachment". Invalidates all iterators.
func (this *ActivityStreamsAttachmentProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6998,6 +7091,19 @@ func (this *ActivityStreamsAttachmentProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "attachment". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsAttachmentProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsAttachmentPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "attachment". Panics if the index is out of bounds. Invalidates all
// iterators.

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsAttributedToPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsAttributedToPropertyIterator(i interface{}, alias
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsAttributedToPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsAttributedToPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsAttributedToPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsAttributedToPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsAttributedToPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsAttributedToPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsAttributedToPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsAttributedToPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsAttributedToPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsAttributedToPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsAttributedToPropertyIterator) JSONLDContext() map[stri
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsAttributedToPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsAttributedToPropertyIterator) LessThan(o vocab.Activit
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsAttributedToPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsAttributedToPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsAttributedToPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsAttributedToPropertyIterator) SetType(t vocab.Type) e
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsAttributedToPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsAttributedToPropertyIterator) serialize() (interface{}
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3821,6 +3867,18 @@ func (this *ActivityStreamsAttributedToProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "attributedTo". Invalidates iterators that are traversing
// using Prev.
func (this *ActivityStreamsAttributedToProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsAttributedToPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "attributedTo". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsAttributedToProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4928,6 +4986,23 @@ func (this *ActivityStreamsAttributedToProperty) InsertIRI(idx int, v *url.URL)
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "attributedTo". Existing elements at that index and higher
// are shifted back once. Invalidates all iterators.
func (this *ActivityStreamsAttributedToProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsAttributedToPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "attributedTo". Existing elements at that index and higher are shifted back
// once. Invalidates all iterators.
@ -5200,74 +5275,78 @@ func (this ActivityStreamsAttributedToProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6167,6 +6246,20 @@ func (this *ActivityStreamsAttributedToProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "attributedTo". Invalidates all iterators.
func (this *ActivityStreamsAttributedToProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsAttributedToPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "attributedTo". Invalidates all iterators.
func (this *ActivityStreamsAttributedToProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -7039,6 +7132,19 @@ func (this *ActivityStreamsAttributedToProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "attributedTo". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsAttributedToProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsAttributedToPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "attributedTo". Panics if the index is out of bounds. Invalidates all
// iterators.

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsAudiencePropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsAudiencePropertyIterator(i interface{}, aliasMap
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsAudiencePropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsAudiencePropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsAudiencePropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsAudiencePropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsAudiencePropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsAudiencePropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsAudiencePropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsAudiencePropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsAudiencePropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsAudiencePropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsAudiencePropertyIterator) JSONLDContext() map[string]s
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsAudiencePropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsAudiencePropertyIterator) LessThan(o vocab.ActivityStr
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsAudiencePropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsAudiencePropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsAudiencePropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsAudiencePropertyIterator) SetType(t vocab.Type) error
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsAudiencePropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsAudiencePropertyIterator) serialize() (interface{}, er
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3781,6 +3827,18 @@ func (this *ActivityStreamsAudienceProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "audience". Invalidates iterators that are traversing using
// Prev.
func (this *ActivityStreamsAudienceProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsAudiencePropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "audience". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsAudienceProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4886,6 +4944,23 @@ func (this *ActivityStreamsAudienceProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "audience". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsAudienceProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsAudiencePropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "audience". Existing elements at that index and higher are shifted back
// once. Invalidates all iterators.
@ -5158,74 +5233,78 @@ func (this ActivityStreamsAudienceProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6124,6 +6203,20 @@ func (this *ActivityStreamsAudienceProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "audience". Invalidates all iterators.
func (this *ActivityStreamsAudienceProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsAudiencePropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "audience". Invalidates all iterators.
func (this *ActivityStreamsAudienceProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6995,6 +7088,19 @@ func (this *ActivityStreamsAudienceProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "audience". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsAudienceProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsAudiencePropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "audience". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsAudienceProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsBccPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -372,6 +373,12 @@ func deserializeActivityStreamsBccPropertyIterator(i interface{}, aliasMap map[s
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsBccPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsBccPropertyIterator{
alias: alias,
@ -911,6 +918,13 @@ func (this ActivityStreamsBccPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsBccPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsBccPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1059,6 +1073,9 @@ func (this ActivityStreamsBccPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1163,6 +1180,7 @@ func (this ActivityStreamsBccPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1615,6 +1633,13 @@ func (this ActivityStreamsBccPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsBccPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsBccPropertyIterator) IsTootEmoji() bool {
@ -1722,6 +1747,8 @@ func (this ActivityStreamsBccPropertyIterator) JSONLDContext() map[string]string
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1906,60 +1933,63 @@ func (this ActivityStreamsBccPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2065,6 +2095,8 @@ func (this ActivityStreamsBccPropertyIterator) LessThan(o vocab.ActivityStreamsB
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2560,6 +2592,13 @@ func (this *ActivityStreamsBccPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsBccPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsBccPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2753,6 +2792,10 @@ func (this *ActivityStreamsBccPropertyIterator) SetType(t vocab.Type) error {
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2876,6 +2919,7 @@ func (this *ActivityStreamsBccPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2991,6 +3035,8 @@ func (this ActivityStreamsBccPropertyIterator) serialize() (interface{}, error)
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3769,6 +3815,17 @@ func (this *ActivityStreamsBccProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "bcc". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsBccProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsBccPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "bcc". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsBccProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4873,6 +4930,23 @@ func (this *ActivityStreamsBccProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "bcc". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsBccProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsBccPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "bcc". Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
@ -5145,74 +5219,78 @@ func (this ActivityStreamsBccProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6110,6 +6188,20 @@ func (this *ActivityStreamsBccProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "bcc". Invalidates all iterators.
func (this *ActivityStreamsBccProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsBccPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "bcc". Invalidates all iterators.
func (this *ActivityStreamsBccProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6981,6 +7073,19 @@ func (this *ActivityStreamsBccProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "bcc". Panics if the index is out of bounds. Invalidates
// all iterators.
func (this *ActivityStreamsBccProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsBccPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "bcc". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsBccProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsBtoPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -372,6 +373,12 @@ func deserializeActivityStreamsBtoPropertyIterator(i interface{}, aliasMap map[s
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsBtoPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsBtoPropertyIterator{
alias: alias,
@ -911,6 +918,13 @@ func (this ActivityStreamsBtoPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsBtoPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsBtoPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1059,6 +1073,9 @@ func (this ActivityStreamsBtoPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1163,6 +1180,7 @@ func (this ActivityStreamsBtoPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1615,6 +1633,13 @@ func (this ActivityStreamsBtoPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsBtoPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsBtoPropertyIterator) IsTootEmoji() bool {
@ -1722,6 +1747,8 @@ func (this ActivityStreamsBtoPropertyIterator) JSONLDContext() map[string]string
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1906,60 +1933,63 @@ func (this ActivityStreamsBtoPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2065,6 +2095,8 @@ func (this ActivityStreamsBtoPropertyIterator) LessThan(o vocab.ActivityStreamsB
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2560,6 +2592,13 @@ func (this *ActivityStreamsBtoPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsBtoPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsBtoPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2753,6 +2792,10 @@ func (this *ActivityStreamsBtoPropertyIterator) SetType(t vocab.Type) error {
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2876,6 +2919,7 @@ func (this *ActivityStreamsBtoPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2991,6 +3035,8 @@ func (this ActivityStreamsBtoPropertyIterator) serialize() (interface{}, error)
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3769,6 +3815,17 @@ func (this *ActivityStreamsBtoProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "bto". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsBtoProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsBtoPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "bto". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsBtoProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4873,6 +4930,23 @@ func (this *ActivityStreamsBtoProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "bto". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsBtoProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsBtoPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "bto". Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
@ -5145,74 +5219,78 @@ func (this ActivityStreamsBtoProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6110,6 +6188,20 @@ func (this *ActivityStreamsBtoProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "bto". Invalidates all iterators.
func (this *ActivityStreamsBtoProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsBtoPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "bto". Invalidates all iterators.
func (this *ActivityStreamsBtoProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6981,6 +7073,19 @@ func (this *ActivityStreamsBtoProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "bto". Panics if the index is out of bounds. Invalidates
// all iterators.
func (this *ActivityStreamsBtoProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsBtoPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "bto". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsBtoProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsCcPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -372,6 +373,12 @@ func deserializeActivityStreamsCcPropertyIterator(i interface{}, aliasMap map[st
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsCcPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsCcPropertyIterator{
alias: alias,
@ -911,6 +918,13 @@ func (this ActivityStreamsCcPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsCcPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsCcPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1059,6 +1073,9 @@ func (this ActivityStreamsCcPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1163,6 +1180,7 @@ func (this ActivityStreamsCcPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1615,6 +1633,13 @@ func (this ActivityStreamsCcPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsCcPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsCcPropertyIterator) IsTootEmoji() bool {
@ -1722,6 +1747,8 @@ func (this ActivityStreamsCcPropertyIterator) JSONLDContext() map[string]string
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1906,60 +1933,63 @@ func (this ActivityStreamsCcPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2065,6 +2095,8 @@ func (this ActivityStreamsCcPropertyIterator) LessThan(o vocab.ActivityStreamsCc
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2560,6 +2592,13 @@ func (this *ActivityStreamsCcPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsCcPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsCcPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2753,6 +2792,10 @@ func (this *ActivityStreamsCcPropertyIterator) SetType(t vocab.Type) error {
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2876,6 +2919,7 @@ func (this *ActivityStreamsCcPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2991,6 +3035,8 @@ func (this ActivityStreamsCcPropertyIterator) serialize() (interface{}, error) {
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3769,6 +3815,17 @@ func (this *ActivityStreamsCcProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "cc". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsCcProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsCcPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "cc". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsCcProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4873,6 +4930,23 @@ func (this *ActivityStreamsCcProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "cc". Existing elements at that index and higher are shifted
// back once. Invalidates all iterators.
func (this *ActivityStreamsCcProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsCcPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "cc". Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
@ -5145,74 +5219,78 @@ func (this ActivityStreamsCcProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6110,6 +6188,20 @@ func (this *ActivityStreamsCcProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "cc". Invalidates all iterators.
func (this *ActivityStreamsCcProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsCcPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "cc". Invalidates all iterators.
func (this *ActivityStreamsCcProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6981,6 +7073,19 @@ func (this *ActivityStreamsCcProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "cc". Panics if the index is out of bounds. Invalidates
// all iterators.
func (this *ActivityStreamsCcProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsCcPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "cc". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsCcProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -65,6 +65,7 @@ type ActivityStreamsClosedPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -380,6 +381,12 @@ func deserializeActivityStreamsClosedPropertyIterator(i interface{}, aliasMap ma
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsClosedPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsClosedPropertyIterator{
alias: alias,
@ -934,6 +941,13 @@ func (this ActivityStreamsClosedPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsClosedPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsClosedPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1082,6 +1096,9 @@ func (this ActivityStreamsClosedPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1201,6 +1218,7 @@ func (this ActivityStreamsClosedPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1653,6 +1671,13 @@ func (this ActivityStreamsClosedPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsClosedPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsClosedPropertyIterator) IsTootEmoji() bool {
@ -1774,6 +1799,8 @@ func (this ActivityStreamsClosedPropertyIterator) JSONLDContext() map[string]str
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1964,60 +1991,63 @@ func (this ActivityStreamsClosedPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 45
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 46
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 47
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 48
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 49
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 50
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 51
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 52
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 53
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 54
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 55
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 56
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 57
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 58
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 59
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 60
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 61
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 62
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 63
}
if this.IsActivityStreamsView() {
return 64
}
if this.IsIRI() {
return -2
}
@ -2127,6 +2157,8 @@ func (this ActivityStreamsClosedPropertyIterator) LessThan(o vocab.ActivityStrea
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2622,6 +2654,13 @@ func (this *ActivityStreamsClosedPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsClosedPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsClosedPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2815,6 +2854,10 @@ func (this *ActivityStreamsClosedPropertyIterator) SetType(t vocab.Type) error {
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2956,6 +2999,7 @@ func (this *ActivityStreamsClosedPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -3075,6 +3119,8 @@ func (this ActivityStreamsClosedPropertyIterator) serialize() (interface{}, erro
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3854,6 +3900,18 @@ func (this *ActivityStreamsClosedProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "closed". Invalidates iterators that are traversing using
// Prev.
func (this *ActivityStreamsClosedProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsClosedPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "closed". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsClosedProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4982,6 +5040,23 @@ func (this *ActivityStreamsClosedProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "closed". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsClosedProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsClosedPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "closed". Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
@ -5298,74 +5373,78 @@ func (this ActivityStreamsClosedProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 62 {
} else if idx1 == 63 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 63 {
} else if idx1 == 64 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6264,6 +6343,20 @@ func (this *ActivityStreamsClosedProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "closed". Invalidates all iterators.
func (this *ActivityStreamsClosedProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsClosedPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "closed". Invalidates all iterators.
func (this *ActivityStreamsClosedProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -7165,6 +7258,19 @@ func (this *ActivityStreamsClosedProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "closed". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsClosedProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsClosedPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "closed". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsClosedProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsContextPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsContextPropertyIterator(i interface{}, aliasMap m
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsContextPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsContextPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsContextPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsContextPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsContextPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsContextPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsContextPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsContextPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsContextPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsContextPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsContextPropertyIterator) JSONLDContext() map[string]st
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsContextPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsContextPropertyIterator) LessThan(o vocab.ActivityStre
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsContextPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsContextPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsContextPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsContextPropertyIterator) SetType(t vocab.Type) error
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsContextPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsContextPropertyIterator) serialize() (interface{}, err
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3781,6 +3827,18 @@ func (this *ActivityStreamsContextProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "context". Invalidates iterators that are traversing using
// Prev.
func (this *ActivityStreamsContextProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsContextPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "context". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsContextProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4886,6 +4944,23 @@ func (this *ActivityStreamsContextProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "context". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsContextProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsContextPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "context". Existing elements at that index and higher are shifted back
// once. Invalidates all iterators.
@ -5158,74 +5233,78 @@ func (this ActivityStreamsContextProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6124,6 +6203,20 @@ func (this *ActivityStreamsContextProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "context". Invalidates all iterators.
func (this *ActivityStreamsContextProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsContextPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "context". Invalidates all iterators.
func (this *ActivityStreamsContextProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6995,6 +7088,19 @@ func (this *ActivityStreamsContextProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "context". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsContextProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsContextPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "context". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsContextProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

View file

@ -177,6 +177,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -56,6 +56,7 @@ type ActivityStreamsDescribesProperty struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -359,6 +360,12 @@ func DeserializeDescribesProperty(m map[string]interface{}, aliasMap map[string]
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsDescribesProperty{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsDescribesProperty{
alias: alias,
@ -528,6 +535,7 @@ func (this *ActivityStreamsDescribesProperty) Clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -958,6 +966,13 @@ func (this ActivityStreamsDescribesProperty) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsDescribesProperty) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsDescribesProperty) GetTootEmoji() vocab.TootEmoji {
@ -1100,6 +1115,9 @@ func (this ActivityStreamsDescribesProperty) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1202,6 +1220,7 @@ func (this ActivityStreamsDescribesProperty) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1640,6 +1659,13 @@ func (this ActivityStreamsDescribesProperty) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsDescribesProperty) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsDescribesProperty) IsTootEmoji() bool {
@ -1743,6 +1769,8 @@ func (this ActivityStreamsDescribesProperty) JSONLDContext() map[string]string {
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1921,60 +1949,63 @@ func (this ActivityStreamsDescribesProperty) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 41
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 42
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 43
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 44
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 45
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 46
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 47
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 48
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 49
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 50
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 51
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 52
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 53
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 54
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 55
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 56
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 57
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 58
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 59
}
if this.IsActivityStreamsView() {
return 60
}
if this.IsIRI() {
return -2
}
@ -2076,6 +2107,8 @@ func (this ActivityStreamsDescribesProperty) LessThan(o vocab.ActivityStreamsDes
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2216,6 +2249,8 @@ func (this ActivityStreamsDescribesProperty) Serialize() (interface{}, error) {
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -2670,6 +2705,13 @@ func (this *ActivityStreamsDescribesProperty) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsDescribesProperty) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.Clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsDescribesProperty) SetTootEmoji(v vocab.TootEmoji) {
@ -2855,6 +2897,10 @@ func (this *ActivityStreamsDescribesProperty) SetType(t vocab.Type) error {
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil

View file

@ -177,6 +177,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -59,6 +59,7 @@ type ActivityStreamsFormerTypePropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -362,6 +363,12 @@ func deserializeActivityStreamsFormerTypePropertyIterator(i interface{}, aliasMa
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsFormerTypePropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsFormerTypePropertyIterator{
alias: alias,
@ -895,6 +902,13 @@ func (this ActivityStreamsFormerTypePropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsFormerTypePropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsFormerTypePropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1037,6 +1051,9 @@ func (this ActivityStreamsFormerTypePropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1146,6 +1163,7 @@ func (this ActivityStreamsFormerTypePropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1584,6 +1602,13 @@ func (this ActivityStreamsFormerTypePropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsFormerTypePropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsFormerTypePropertyIterator) IsTootEmoji() bool {
@ -1694,6 +1719,8 @@ func (this ActivityStreamsFormerTypePropertyIterator) JSONLDContext() map[string
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1875,60 +1902,63 @@ func (this ActivityStreamsFormerTypePropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 42
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 43
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 44
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 45
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 46
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 47
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 48
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 49
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 50
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 51
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 52
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 53
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 54
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 55
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 56
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 57
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 58
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 59
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 60
}
if this.IsActivityStreamsView() {
return 61
}
if this.IsIRI() {
return -2
}
@ -2032,6 +2062,8 @@ func (this ActivityStreamsFormerTypePropertyIterator) LessThan(o vocab.ActivityS
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2513,6 +2545,13 @@ func (this *ActivityStreamsFormerTypePropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsFormerTypePropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsFormerTypePropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2698,6 +2737,10 @@ func (this *ActivityStreamsFormerTypePropertyIterator) SetType(t vocab.Type) err
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2828,6 +2871,7 @@ func (this *ActivityStreamsFormerTypePropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2941,6 +2985,8 @@ func (this ActivityStreamsFormerTypePropertyIterator) serialize() (interface{},
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3708,6 +3754,18 @@ func (this *ActivityStreamsFormerTypeProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "formerType". Invalidates iterators that are traversing
// using Prev.
func (this *ActivityStreamsFormerTypeProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsFormerTypePropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "formerType". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsFormerTypeProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4792,6 +4850,23 @@ func (this *ActivityStreamsFormerTypeProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "formerType". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsFormerTypeProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsFormerTypePropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "formerType". Existing elements at that index and higher are shifted back
// once. Invalidates all iterators.
@ -5078,74 +5153,78 @@ func (this ActivityStreamsFormerTypeProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 43 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
} else if idx1 == 45 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6016,6 +6095,20 @@ func (this *ActivityStreamsFormerTypeProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "formerType". Invalidates all iterators.
func (this *ActivityStreamsFormerTypeProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsFormerTypePropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "formerType". Invalidates all iterators.
func (this *ActivityStreamsFormerTypeProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6877,6 +6970,19 @@ func (this *ActivityStreamsFormerTypeProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "formerType". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsFormerTypeProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsFormerTypePropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "formerType". Panics if the index is out of bounds. Invalidates all
// iterators.

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsGeneratorPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsGeneratorPropertyIterator(i interface{}, aliasMap
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsGeneratorPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsGeneratorPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsGeneratorPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsGeneratorPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsGeneratorPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsGeneratorPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsGeneratorPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsGeneratorPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsGeneratorPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsGeneratorPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsGeneratorPropertyIterator) JSONLDContext() map[string]
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsGeneratorPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsGeneratorPropertyIterator) LessThan(o vocab.ActivitySt
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsGeneratorPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsGeneratorPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsGeneratorPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsGeneratorPropertyIterator) SetType(t vocab.Type) erro
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsGeneratorPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsGeneratorPropertyIterator) serialize() (interface{}, e
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3781,6 +3827,18 @@ func (this *ActivityStreamsGeneratorProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "generator". Invalidates iterators that are traversing
// using Prev.
func (this *ActivityStreamsGeneratorProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsGeneratorPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "generator". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsGeneratorProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4886,6 +4944,23 @@ func (this *ActivityStreamsGeneratorProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "generator". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsGeneratorProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsGeneratorPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "generator". Existing elements at that index and higher are shifted back
// once. Invalidates all iterators.
@ -5158,74 +5233,78 @@ func (this ActivityStreamsGeneratorProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6124,6 +6203,20 @@ func (this *ActivityStreamsGeneratorProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "generator". Invalidates all iterators.
func (this *ActivityStreamsGeneratorProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsGeneratorPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "generator". Invalidates all iterators.
func (this *ActivityStreamsGeneratorProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6996,6 +7089,19 @@ func (this *ActivityStreamsGeneratorProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "generator". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsGeneratorProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsGeneratorPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "generator". Panics if the index is out of bounds. Invalidates all
// iterators.

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsInReplyToPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsInReplyToPropertyIterator(i interface{}, aliasMap
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsInReplyToPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsInReplyToPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsInReplyToPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsInReplyToPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsInReplyToPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsInReplyToPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsInReplyToPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsInReplyToPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsInReplyToPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsInReplyToPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsInReplyToPropertyIterator) JSONLDContext() map[string]
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsInReplyToPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsInReplyToPropertyIterator) LessThan(o vocab.ActivitySt
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsInReplyToPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsInReplyToPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsInReplyToPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsInReplyToPropertyIterator) SetType(t vocab.Type) erro
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsInReplyToPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsInReplyToPropertyIterator) serialize() (interface{}, e
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3781,6 +3827,18 @@ func (this *ActivityStreamsInReplyToProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "inReplyTo". Invalidates iterators that are traversing
// using Prev.
func (this *ActivityStreamsInReplyToProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsInReplyToPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "inReplyTo". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsInReplyToProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4886,6 +4944,23 @@ func (this *ActivityStreamsInReplyToProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "inReplyTo". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsInReplyToProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsInReplyToPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "inReplyTo". Existing elements at that index and higher are shifted back
// once. Invalidates all iterators.
@ -5158,74 +5233,78 @@ func (this ActivityStreamsInReplyToProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6124,6 +6203,20 @@ func (this *ActivityStreamsInReplyToProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "inReplyTo". Invalidates all iterators.
func (this *ActivityStreamsInReplyToProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsInReplyToPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "inReplyTo". Invalidates all iterators.
func (this *ActivityStreamsInReplyToProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6996,6 +7089,19 @@ func (this *ActivityStreamsInReplyToProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "inReplyTo". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsInReplyToProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsInReplyToPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "inReplyTo". Panics if the index is out of bounds. Invalidates all
// iterators.

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsInstrumentPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsInstrumentPropertyIterator(i interface{}, aliasMa
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsInstrumentPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsInstrumentPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsInstrumentPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsInstrumentPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsInstrumentPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsInstrumentPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsInstrumentPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsInstrumentPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsInstrumentPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsInstrumentPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsInstrumentPropertyIterator) JSONLDContext() map[string
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsInstrumentPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsInstrumentPropertyIterator) LessThan(o vocab.ActivityS
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsInstrumentPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsInstrumentPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsInstrumentPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsInstrumentPropertyIterator) SetType(t vocab.Type) err
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsInstrumentPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsInstrumentPropertyIterator) serialize() (interface{},
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3782,6 +3828,18 @@ func (this *ActivityStreamsInstrumentProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "instrument". Invalidates iterators that are traversing
// using Prev.
func (this *ActivityStreamsInstrumentProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsInstrumentPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "instrument". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsInstrumentProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4888,6 +4946,23 @@ func (this *ActivityStreamsInstrumentProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "instrument". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsInstrumentProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsInstrumentPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "instrument". Existing elements at that index and higher are shifted back
// once. Invalidates all iterators.
@ -5160,74 +5235,78 @@ func (this ActivityStreamsInstrumentProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6126,6 +6205,20 @@ func (this *ActivityStreamsInstrumentProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "instrument". Invalidates all iterators.
func (this *ActivityStreamsInstrumentProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsInstrumentPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "instrument". Invalidates all iterators.
func (this *ActivityStreamsInstrumentProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6998,6 +7091,19 @@ func (this *ActivityStreamsInstrumentProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "instrument". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsInstrumentProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsInstrumentPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "instrument". Panics if the index is out of bounds. Invalidates all
// iterators.

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsItemsPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsItemsPropertyIterator(i interface{}, aliasMap map
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsItemsPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsItemsPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsItemsPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsItemsPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsItemsPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsItemsPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsItemsPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsItemsPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsItemsPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsItemsPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsItemsPropertyIterator) JSONLDContext() map[string]stri
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsItemsPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsItemsPropertyIterator) LessThan(o vocab.ActivityStream
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsItemsPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsItemsPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsItemsPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsItemsPropertyIterator) SetType(t vocab.Type) error {
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsItemsPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsItemsPropertyIterator) serialize() (interface{}, error
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3771,6 +3817,18 @@ func (this *ActivityStreamsItemsProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "items". Invalidates iterators that are traversing using
// Prev.
func (this *ActivityStreamsItemsProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsItemsPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "items". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsItemsProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4875,6 +4933,23 @@ func (this *ActivityStreamsItemsProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "items". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsItemsProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsItemsPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "items". Existing elements at that index and higher are shifted back once.
// Invalidates all iterators.
@ -5147,74 +5222,78 @@ func (this ActivityStreamsItemsProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6112,6 +6191,20 @@ func (this *ActivityStreamsItemsProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "items". Invalidates all iterators.
func (this *ActivityStreamsItemsProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsItemsPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "items". Invalidates all iterators.
func (this *ActivityStreamsItemsProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6983,6 +7076,19 @@ func (this *ActivityStreamsItemsProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "items". Panics if the index is out of bounds. Invalidates
// all iterators.
func (this *ActivityStreamsItemsProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsItemsPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "items". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsItemsProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

View file

@ -185,6 +185,10 @@ type privateManager interface {
// for the "ActivityStreamsProfile" non-functional property in the
// vocabulary "ActivityStreams"
DeserializeProfileActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsProfile, error)
// DeserializePropertyValueSchema returns the deserialization method for
// the "SchemaPropertyValue" non-functional property in the vocabulary
// "Schema"
DeserializePropertyValueSchema() func(map[string]interface{}, map[string]string) (vocab.SchemaPropertyValue, error)
// DeserializePushForgeFed returns the deserialization method for the
// "ForgeFedPush" non-functional property in the vocabulary "ForgeFed"
DeserializePushForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedPush, error)

View file

@ -58,6 +58,7 @@ type ActivityStreamsLocationPropertyIterator struct {
activitystreamsPersonMember vocab.ActivityStreamsPerson
activitystreamsPlaceMember vocab.ActivityStreamsPlace
activitystreamsProfileMember vocab.ActivityStreamsProfile
schemaPropertyValueMember vocab.SchemaPropertyValue
forgefedPushMember vocab.ForgeFedPush
activitystreamsQuestionMember vocab.ActivityStreamsQuestion
activitystreamsReadMember vocab.ActivityStreamsRead
@ -373,6 +374,12 @@ func deserializeActivityStreamsLocationPropertyIterator(i interface{}, aliasMap
alias: alias,
}
return this, nil
} else if v, err := mgr.DeserializePropertyValueSchema()(m, aliasMap); err == nil {
this := &ActivityStreamsLocationPropertyIterator{
alias: alias,
schemaPropertyValueMember: v,
}
return this, nil
} else if v, err := mgr.DeserializePushForgeFed()(m, aliasMap); err == nil {
this := &ActivityStreamsLocationPropertyIterator{
alias: alias,
@ -912,6 +919,13 @@ func (this ActivityStreamsLocationPropertyIterator) GetIRI() *url.URL {
return this.iri
}
// GetSchemaPropertyValue returns the value of this property. When
// IsSchemaPropertyValue returns false, GetSchemaPropertyValue will return an
// arbitrary value.
func (this ActivityStreamsLocationPropertyIterator) GetSchemaPropertyValue() vocab.SchemaPropertyValue {
return this.schemaPropertyValueMember
}
// GetTootEmoji returns the value of this property. When IsTootEmoji returns
// false, GetTootEmoji will return an arbitrary value.
func (this ActivityStreamsLocationPropertyIterator) GetTootEmoji() vocab.TootEmoji {
@ -1060,6 +1074,9 @@ func (this ActivityStreamsLocationPropertyIterator) GetType() vocab.Type {
if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile()
}
if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue()
}
if this.IsForgeFedPush() {
return this.GetForgeFedPush()
}
@ -1164,6 +1181,7 @@ func (this ActivityStreamsLocationPropertyIterator) HasAny() bool {
this.IsActivityStreamsPerson() ||
this.IsActivityStreamsPlace() ||
this.IsActivityStreamsProfile() ||
this.IsSchemaPropertyValue() ||
this.IsForgeFedPush() ||
this.IsActivityStreamsQuestion() ||
this.IsActivityStreamsRead() ||
@ -1616,6 +1634,13 @@ func (this ActivityStreamsLocationPropertyIterator) IsIRI() bool {
return this.iri != nil
}
// IsSchemaPropertyValue returns true if this property has a type of
// "PropertyValue". When true, use the GetSchemaPropertyValue and
// SetSchemaPropertyValue methods to access and set this property.
func (this ActivityStreamsLocationPropertyIterator) IsSchemaPropertyValue() bool {
return this.schemaPropertyValueMember != nil
}
// IsTootEmoji returns true if this property has a type of "Emoji". When true, use
// the GetTootEmoji and SetTootEmoji methods to access and set this property.
func (this ActivityStreamsLocationPropertyIterator) IsTootEmoji() bool {
@ -1723,6 +1748,8 @@ func (this ActivityStreamsLocationPropertyIterator) JSONLDContext() map[string]s
child = this.GetActivityStreamsPlace().JSONLDContext()
} else if this.IsActivityStreamsProfile() {
child = this.GetActivityStreamsProfile().JSONLDContext()
} else if this.IsSchemaPropertyValue() {
child = this.GetSchemaPropertyValue().JSONLDContext()
} else if this.IsForgeFedPush() {
child = this.GetForgeFedPush().JSONLDContext()
} else if this.IsActivityStreamsQuestion() {
@ -1907,60 +1934,63 @@ func (this ActivityStreamsLocationPropertyIterator) KindIndex() int {
if this.IsActivityStreamsProfile() {
return 43
}
if this.IsForgeFedPush() {
if this.IsSchemaPropertyValue() {
return 44
}
if this.IsActivityStreamsQuestion() {
if this.IsForgeFedPush() {
return 45
}
if this.IsActivityStreamsRead() {
if this.IsActivityStreamsQuestion() {
return 46
}
if this.IsActivityStreamsReject() {
if this.IsActivityStreamsRead() {
return 47
}
if this.IsActivityStreamsRelationship() {
if this.IsActivityStreamsReject() {
return 48
}
if this.IsActivityStreamsRemove() {
if this.IsActivityStreamsRelationship() {
return 49
}
if this.IsForgeFedRepository() {
if this.IsActivityStreamsRemove() {
return 50
}
if this.IsActivityStreamsService() {
if this.IsForgeFedRepository() {
return 51
}
if this.IsActivityStreamsTentativeAccept() {
if this.IsActivityStreamsService() {
return 52
}
if this.IsActivityStreamsTentativeReject() {
if this.IsActivityStreamsTentativeAccept() {
return 53
}
if this.IsForgeFedTicket() {
if this.IsActivityStreamsTentativeReject() {
return 54
}
if this.IsForgeFedTicketDependency() {
if this.IsForgeFedTicket() {
return 55
}
if this.IsActivityStreamsTombstone() {
if this.IsForgeFedTicketDependency() {
return 56
}
if this.IsActivityStreamsTravel() {
if this.IsActivityStreamsTombstone() {
return 57
}
if this.IsActivityStreamsUndo() {
if this.IsActivityStreamsTravel() {
return 58
}
if this.IsActivityStreamsUpdate() {
if this.IsActivityStreamsUndo() {
return 59
}
if this.IsActivityStreamsVideo() {
if this.IsActivityStreamsUpdate() {
return 60
}
if this.IsActivityStreamsView() {
if this.IsActivityStreamsVideo() {
return 61
}
if this.IsActivityStreamsView() {
return 62
}
if this.IsIRI() {
return -2
}
@ -2066,6 +2096,8 @@ func (this ActivityStreamsLocationPropertyIterator) LessThan(o vocab.ActivityStr
return this.GetActivityStreamsPlace().LessThan(o.GetActivityStreamsPlace())
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().LessThan(o.GetActivityStreamsProfile())
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().LessThan(o.GetSchemaPropertyValue())
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().LessThan(o.GetForgeFedPush())
} else if this.IsActivityStreamsQuestion() {
@ -2561,6 +2593,13 @@ func (this *ActivityStreamsLocationPropertyIterator) SetIRI(v *url.URL) {
this.iri = v
}
// SetSchemaPropertyValue sets the value of this property. Calling
// IsSchemaPropertyValue afterwards returns true.
func (this *ActivityStreamsLocationPropertyIterator) SetSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.clear()
this.schemaPropertyValueMember = v
}
// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards
// returns true.
func (this *ActivityStreamsLocationPropertyIterator) SetTootEmoji(v vocab.TootEmoji) {
@ -2754,6 +2793,10 @@ func (this *ActivityStreamsLocationPropertyIterator) SetType(t vocab.Type) error
this.SetActivityStreamsProfile(v)
return nil
}
if v, ok := t.(vocab.SchemaPropertyValue); ok {
this.SetSchemaPropertyValue(v)
return nil
}
if v, ok := t.(vocab.ForgeFedPush); ok {
this.SetForgeFedPush(v)
return nil
@ -2877,6 +2920,7 @@ func (this *ActivityStreamsLocationPropertyIterator) clear() {
this.activitystreamsPersonMember = nil
this.activitystreamsPlaceMember = nil
this.activitystreamsProfileMember = nil
this.schemaPropertyValueMember = nil
this.forgefedPushMember = nil
this.activitystreamsQuestionMember = nil
this.activitystreamsReadMember = nil
@ -2992,6 +3036,8 @@ func (this ActivityStreamsLocationPropertyIterator) serialize() (interface{}, er
return this.GetActivityStreamsPlace().Serialize()
} else if this.IsActivityStreamsProfile() {
return this.GetActivityStreamsProfile().Serialize()
} else if this.IsSchemaPropertyValue() {
return this.GetSchemaPropertyValue().Serialize()
} else if this.IsForgeFedPush() {
return this.GetForgeFedPush().Serialize()
} else if this.IsActivityStreamsQuestion() {
@ -3781,6 +3827,18 @@ func (this *ActivityStreamsLocationProperty) AppendIRI(v *url.URL) {
})
}
// AppendSchemaPropertyValue appends a PropertyValue value to the back of a list
// of the property "location". Invalidates iterators that are traversing using
// Prev.
func (this *ActivityStreamsLocationProperty) AppendSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, &ActivityStreamsLocationPropertyIterator{
alias: this.alias,
myIdx: this.Len(),
parent: this,
schemaPropertyValueMember: v,
})
}
// AppendTootEmoji appends a Emoji value to the back of a list of the property
// "location". Invalidates iterators that are traversing using Prev.
func (this *ActivityStreamsLocationProperty) AppendTootEmoji(v vocab.TootEmoji) {
@ -4886,6 +4944,23 @@ func (this *ActivityStreamsLocationProperty) InsertIRI(idx int, v *url.URL) {
}
}
// InsertSchemaPropertyValue inserts a PropertyValue value at the specified index
// for a property "location". Existing elements at that index and higher are
// shifted back once. Invalidates all iterators.
func (this *ActivityStreamsLocationProperty) InsertSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
this.properties = append(this.properties, nil)
copy(this.properties[idx+1:], this.properties[idx:])
this.properties[idx] = &ActivityStreamsLocationPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
for i := idx; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// InsertTootEmoji inserts a Emoji value at the specified index for a property
// "location". Existing elements at that index and higher are shifted back
// once. Invalidates all iterators.
@ -5158,74 +5233,78 @@ func (this ActivityStreamsLocationProperty) Less(i, j int) bool {
rhs := this.properties[j].GetActivityStreamsProfile()
return lhs.LessThan(rhs)
} else if idx1 == 44 {
lhs := this.properties[i].GetSchemaPropertyValue()
rhs := this.properties[j].GetSchemaPropertyValue()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
lhs := this.properties[i].GetForgeFedPush()
rhs := this.properties[j].GetForgeFedPush()
return lhs.LessThan(rhs)
} else if idx1 == 45 {
} else if idx1 == 46 {
lhs := this.properties[i].GetActivityStreamsQuestion()
rhs := this.properties[j].GetActivityStreamsQuestion()
return lhs.LessThan(rhs)
} else if idx1 == 46 {
} else if idx1 == 47 {
lhs := this.properties[i].GetActivityStreamsRead()
rhs := this.properties[j].GetActivityStreamsRead()
return lhs.LessThan(rhs)
} else if idx1 == 47 {
} else if idx1 == 48 {
lhs := this.properties[i].GetActivityStreamsReject()
rhs := this.properties[j].GetActivityStreamsReject()
return lhs.LessThan(rhs)
} else if idx1 == 48 {
} else if idx1 == 49 {
lhs := this.properties[i].GetActivityStreamsRelationship()
rhs := this.properties[j].GetActivityStreamsRelationship()
return lhs.LessThan(rhs)
} else if idx1 == 49 {
} else if idx1 == 50 {
lhs := this.properties[i].GetActivityStreamsRemove()
rhs := this.properties[j].GetActivityStreamsRemove()
return lhs.LessThan(rhs)
} else if idx1 == 50 {
} else if idx1 == 51 {
lhs := this.properties[i].GetForgeFedRepository()
rhs := this.properties[j].GetForgeFedRepository()
return lhs.LessThan(rhs)
} else if idx1 == 51 {
} else if idx1 == 52 {
lhs := this.properties[i].GetActivityStreamsService()
rhs := this.properties[j].GetActivityStreamsService()
return lhs.LessThan(rhs)
} else if idx1 == 52 {
} else if idx1 == 53 {
lhs := this.properties[i].GetActivityStreamsTentativeAccept()
rhs := this.properties[j].GetActivityStreamsTentativeAccept()
return lhs.LessThan(rhs)
} else if idx1 == 53 {
} else if idx1 == 54 {
lhs := this.properties[i].GetActivityStreamsTentativeReject()
rhs := this.properties[j].GetActivityStreamsTentativeReject()
return lhs.LessThan(rhs)
} else if idx1 == 54 {
} else if idx1 == 55 {
lhs := this.properties[i].GetForgeFedTicket()
rhs := this.properties[j].GetForgeFedTicket()
return lhs.LessThan(rhs)
} else if idx1 == 55 {
} else if idx1 == 56 {
lhs := this.properties[i].GetForgeFedTicketDependency()
rhs := this.properties[j].GetForgeFedTicketDependency()
return lhs.LessThan(rhs)
} else if idx1 == 56 {
} else if idx1 == 57 {
lhs := this.properties[i].GetActivityStreamsTombstone()
rhs := this.properties[j].GetActivityStreamsTombstone()
return lhs.LessThan(rhs)
} else if idx1 == 57 {
} else if idx1 == 58 {
lhs := this.properties[i].GetActivityStreamsTravel()
rhs := this.properties[j].GetActivityStreamsTravel()
return lhs.LessThan(rhs)
} else if idx1 == 58 {
} else if idx1 == 59 {
lhs := this.properties[i].GetActivityStreamsUndo()
rhs := this.properties[j].GetActivityStreamsUndo()
return lhs.LessThan(rhs)
} else if idx1 == 59 {
} else if idx1 == 60 {
lhs := this.properties[i].GetActivityStreamsUpdate()
rhs := this.properties[j].GetActivityStreamsUpdate()
return lhs.LessThan(rhs)
} else if idx1 == 60 {
} else if idx1 == 61 {
lhs := this.properties[i].GetActivityStreamsVideo()
rhs := this.properties[j].GetActivityStreamsVideo()
return lhs.LessThan(rhs)
} else if idx1 == 61 {
} else if idx1 == 62 {
lhs := this.properties[i].GetActivityStreamsView()
rhs := this.properties[j].GetActivityStreamsView()
return lhs.LessThan(rhs)
@ -6124,6 +6203,20 @@ func (this *ActivityStreamsLocationProperty) PrependIRI(v *url.URL) {
}
}
// PrependSchemaPropertyValue prepends a PropertyValue value to the front of a
// list of the property "location". Invalidates all iterators.
func (this *ActivityStreamsLocationProperty) PrependSchemaPropertyValue(v vocab.SchemaPropertyValue) {
this.properties = append([]*ActivityStreamsLocationPropertyIterator{{
alias: this.alias,
myIdx: 0,
parent: this,
schemaPropertyValueMember: v,
}}, this.properties...)
for i := 1; i < this.Len(); i++ {
(this.properties)[i].myIdx = i
}
}
// PrependTootEmoji prepends a Emoji value to the front of a list of the property
// "location". Invalidates all iterators.
func (this *ActivityStreamsLocationProperty) PrependTootEmoji(v vocab.TootEmoji) {
@ -6995,6 +7088,19 @@ func (this *ActivityStreamsLocationProperty) SetIRI(idx int, v *url.URL) {
}
}
// SetSchemaPropertyValue sets a PropertyValue value to be at the specified index
// for the property "location". Panics if the index is out of bounds.
// Invalidates all iterators.
func (this *ActivityStreamsLocationProperty) SetSchemaPropertyValue(idx int, v vocab.SchemaPropertyValue) {
(this.properties)[idx].parent = nil
(this.properties)[idx] = &ActivityStreamsLocationPropertyIterator{
alias: this.alias,
myIdx: idx,
parent: this,
schemaPropertyValueMember: v,
}
}
// SetTootEmoji sets a Emoji value to be at the specified index for the property
// "location". Panics if the index is out of bounds. Invalidates all iterators.
func (this *ActivityStreamsLocationProperty) SetTootEmoji(idx int, v vocab.TootEmoji) {

Some files were not shown because too many files have changed in this diff Show more