diff options
| author | 2024-07-06 15:57:11 +0200 | |
|---|---|---|
| committer | 2024-07-06 15:57:11 +0200 | |
| commit | 1a66ea8998e984574b05f2ede57e017801d5926b (patch) | |
| tree | ae48c96918eac7960f79270e8fe05616940d2669 /vendor/github.com/superseriousbusiness/activity/streams/impl | |
| parent | [chore] Update ncruces/go-sqlite3 to 0.17 (#3072) (diff) | |
| download | gotosocial-1a66ea8998e984574b05f2ede57e017801d5926b.tar.xz | |
[chore] upstep activity to v1.7.0-gts (#3074)
Diffstat (limited to 'vendor/github.com/superseriousbusiness/activity/streams/impl')
57 files changed, 6490 insertions, 0 deletions
diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_article/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_article/gen_pkg.go index ffd0619d8..9f2398e26 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_article/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_article/gen_pkg.go @@ -15,6 +15,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -76,6 +80,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_article/gen_type_activitystreams_article.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_article/gen_type_activitystreams_article.go index 63a8dda98..d8614fa8f 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_article/gen_type_activitystreams_article.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_article/gen_type_activitystreams_article.go @@ -20,6 +20,7 @@ import ( // } type ActivityStreamsArticle struct { ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -35,6 +36,7 @@ type ActivityStreamsArticle struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -131,6 +133,11 @@ func DeserializeArticle(m map[string]interface{}, aliasMap map[string]string) (* } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -206,6 +213,11 @@ func DeserializeArticle(m map[string]interface{}, aliasMap map[string]string) (* } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -303,6 +315,8 @@ func DeserializeArticle(m map[string]interface{}, aliasMap map[string]string) (* // Begin: Code that ensures a property name is unknown if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -335,6 +349,8 @@ func DeserializeArticle(m map[string]interface{}, aliasMap map[string]string) (* continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -594,6 +610,18 @@ func (this ActivityStreamsArticle) GetActivityStreamsUrl() vocab.ActivityStreams return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsArticle) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsArticle) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsArticle) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -630,6 +658,7 @@ func (this ActivityStreamsArticle) IsExtending(other vocab.Type) bool { func (this ActivityStreamsArticle) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -645,6 +674,7 @@ func (this ActivityStreamsArticle) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -685,6 +715,20 @@ func (this ActivityStreamsArticle) LessThan(o vocab.ActivityStreamsArticle) bool // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -895,6 +939,20 @@ func (this ActivityStreamsArticle) LessThan(o vocab.ActivityStreamsArticle) bool // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1178,6 +1236,14 @@ func (this ActivityStreamsArticle) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1298,6 +1364,14 @@ func (this ActivityStreamsArticle) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1616,6 +1690,16 @@ func (this *ActivityStreamsArticle) SetActivityStreamsUrl(i vocab.ActivityStream this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsArticle) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsArticle) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsArticle) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_audio/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_audio/gen_pkg.go index 88a4c990a..90b70418b 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_audio/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_audio/gen_pkg.go @@ -15,6 +15,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -80,6 +84,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_audio/gen_type_activitystreams_audio.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_audio/gen_type_activitystreams_audio.go index d88a72fc7..8aa976810 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_audio/gen_type_activitystreams_audio.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_audio/gen_type_activitystreams_audio.go @@ -22,6 +22,7 @@ import ( // } type ActivityStreamsAudio struct { ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -38,6 +39,7 @@ type ActivityStreamsAudio struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -134,6 +136,11 @@ func DeserializeAudio(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -214,6 +221,11 @@ func DeserializeAudio(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -311,6 +323,8 @@ func DeserializeAudio(m map[string]interface{}, aliasMap map[string]string) (*Ac // Begin: Code that ensures a property name is unknown if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -345,6 +359,8 @@ func DeserializeAudio(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -604,6 +620,18 @@ func (this ActivityStreamsAudio) GetActivityStreamsUrl() vocab.ActivityStreamsUr return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsAudio) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsAudio) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsAudio) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -645,6 +673,7 @@ func (this ActivityStreamsAudio) IsExtending(other vocab.Type) bool { func (this ActivityStreamsAudio) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -661,6 +690,7 @@ func (this ActivityStreamsAudio) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -701,6 +731,20 @@ func (this ActivityStreamsAudio) LessThan(o vocab.ActivityStreamsAudio) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -925,6 +969,20 @@ func (this ActivityStreamsAudio) LessThan(o vocab.ActivityStreamsAudio) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1208,6 +1266,14 @@ func (this ActivityStreamsAudio) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1336,6 +1402,14 @@ func (this ActivityStreamsAudio) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1654,6 +1728,16 @@ func (this *ActivityStreamsAudio) SetActivityStreamsUrl(i vocab.ActivityStreamsU this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsAudio) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsAudio) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsAudio) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_document/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_document/gen_pkg.go index 343a63d1b..34462df39 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_document/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_document/gen_pkg.go @@ -15,6 +15,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -80,6 +84,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_document/gen_type_activitystreams_document.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_document/gen_type_activitystreams_document.go index 49c4e73e5..8ac61bd33 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_document/gen_type_activitystreams_document.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_document/gen_type_activitystreams_document.go @@ -18,6 +18,7 @@ import ( // } type ActivityStreamsDocument struct { ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -34,6 +35,7 @@ type ActivityStreamsDocument struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -110,6 +112,11 @@ func DeserializeDocument(m map[string]interface{}, aliasMap map[string]string) ( } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -190,6 +197,11 @@ func DeserializeDocument(m map[string]interface{}, aliasMap map[string]string) ( } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -287,6 +299,8 @@ func DeserializeDocument(m map[string]interface{}, aliasMap map[string]string) ( // Begin: Code that ensures a property name is unknown if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -321,6 +335,8 @@ func DeserializeDocument(m map[string]interface{}, aliasMap map[string]string) ( continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -605,6 +621,18 @@ func (this ActivityStreamsDocument) GetActivityStreamsUrl() vocab.ActivityStream return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsDocument) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsDocument) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsDocument) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -646,6 +674,7 @@ func (this ActivityStreamsDocument) IsExtending(other vocab.Type) bool { func (this ActivityStreamsDocument) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -662,6 +691,7 @@ func (this ActivityStreamsDocument) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -702,6 +732,20 @@ func (this ActivityStreamsDocument) LessThan(o vocab.ActivityStreamsDocument) bo // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -926,6 +970,20 @@ func (this ActivityStreamsDocument) LessThan(o vocab.ActivityStreamsDocument) bo // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1209,6 +1267,14 @@ func (this ActivityStreamsDocument) Serialize() (map[string]interface{}, error) m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1337,6 +1403,14 @@ func (this ActivityStreamsDocument) Serialize() (map[string]interface{}, error) m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1655,6 +1729,16 @@ func (this *ActivityStreamsDocument) SetActivityStreamsUrl(i vocab.ActivityStrea this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsDocument) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsDocument) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsDocument) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_event/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_event/gen_pkg.go index 429cfdb35..1d95dce45 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_event/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_event/gen_pkg.go @@ -15,6 +15,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -76,6 +80,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_event/gen_type_activitystreams_event.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_event/gen_type_activitystreams_event.go index cfe235998..9c2993207 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_event/gen_type_activitystreams_event.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_event/gen_type_activitystreams_event.go @@ -19,6 +19,7 @@ import ( // } type ActivityStreamsEvent struct { ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -34,6 +35,7 @@ type ActivityStreamsEvent struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -110,6 +112,11 @@ func DeserializeEvent(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -185,6 +192,11 @@ func DeserializeEvent(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -282,6 +294,8 @@ func DeserializeEvent(m map[string]interface{}, aliasMap map[string]string) (*Ac // Begin: Code that ensures a property name is unknown if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -314,6 +328,8 @@ func DeserializeEvent(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -593,6 +609,18 @@ func (this ActivityStreamsEvent) GetActivityStreamsUrl() vocab.ActivityStreamsUr return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsEvent) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsEvent) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsEvent) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -629,6 +657,7 @@ func (this ActivityStreamsEvent) IsExtending(other vocab.Type) bool { func (this ActivityStreamsEvent) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -644,6 +673,7 @@ func (this ActivityStreamsEvent) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -684,6 +714,20 @@ func (this ActivityStreamsEvent) LessThan(o vocab.ActivityStreamsEvent) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -894,6 +938,20 @@ func (this ActivityStreamsEvent) LessThan(o vocab.ActivityStreamsEvent) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1177,6 +1235,14 @@ func (this ActivityStreamsEvent) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1297,6 +1363,14 @@ func (this ActivityStreamsEvent) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1615,6 +1689,16 @@ func (this *ActivityStreamsEvent) SetActivityStreamsUrl(i vocab.ActivityStreamsU this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsEvent) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsEvent) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsEvent) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_image/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_image/gen_pkg.go index cec5187db..f8a8383fd 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_image/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_image/gen_pkg.go @@ -15,6 +15,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -84,6 +88,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_image/gen_type_activitystreams_image.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_image/gen_type_activitystreams_image.go index 1e6681301..efe477561 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_image/gen_type_activitystreams_image.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_image/gen_type_activitystreams_image.go @@ -29,6 +29,7 @@ import ( // } type ActivityStreamsImage struct { ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -46,6 +47,7 @@ type ActivityStreamsImage struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -123,6 +125,11 @@ func DeserializeImage(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -208,6 +215,11 @@ func DeserializeImage(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -310,6 +322,8 @@ func DeserializeImage(m map[string]interface{}, aliasMap map[string]string) (*Ac // Begin: Code that ensures a property name is unknown if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -346,6 +360,8 @@ func DeserializeImage(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -639,6 +655,18 @@ func (this ActivityStreamsImage) GetActivityStreamsWidth() vocab.ActivityStreams return this.ActivityStreamsWidth } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsImage) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsImage) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsImage) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -680,6 +708,7 @@ func (this ActivityStreamsImage) IsExtending(other vocab.Type) bool { func (this ActivityStreamsImage) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -697,6 +726,7 @@ func (this ActivityStreamsImage) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -738,6 +768,20 @@ func (this ActivityStreamsImage) LessThan(o vocab.ActivityStreamsImage) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -976,6 +1020,20 @@ func (this ActivityStreamsImage) LessThan(o vocab.ActivityStreamsImage) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1273,6 +1331,14 @@ func (this ActivityStreamsImage) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1409,6 +1475,14 @@ func (this ActivityStreamsImage) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1745,6 +1819,16 @@ func (this *ActivityStreamsImage) SetActivityStreamsWidth(i vocab.ActivityStream this.ActivityStreamsWidth = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsImage) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsImage) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsImage) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_like/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_like/gen_pkg.go index 2a49164f2..e8f125707 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_like/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_like/gen_pkg.go @@ -19,6 +19,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_like/gen_type_activitystreams_like.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_like/gen_type_activitystreams_like.go index 9d7be09cc..928c9722b 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_like/gen_type_activitystreams_like.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_like/gen_type_activitystreams_like.go @@ -24,6 +24,7 @@ import ( type ActivityStreamsLike struct { ActivityStreamsActor vocab.ActivityStreamsActorProperty ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -124,6 +125,11 @@ func DeserializeLike(m map[string]interface{}, aliasMap map[string]string) (*Act } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -318,6 +324,8 @@ func DeserializeLike(m map[string]interface{}, aliasMap map[string]string) (*Act continue } else if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -667,6 +675,12 @@ func (this ActivityStreamsLike) GetActivityStreamsUrl() vocab.ActivityStreamsUrl return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsLike) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsLike) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -704,6 +718,7 @@ func (this ActivityStreamsLike) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsActor, m) m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -777,6 +792,20 @@ func (this ActivityStreamsLike) LessThan(o vocab.ActivityStreamsLike) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1334,6 +1363,14 @@ func (this ActivityStreamsLike) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1829,6 +1866,11 @@ func (this *ActivityStreamsLike) SetActivityStreamsUrl(i vocab.ActivityStreamsUr this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsLike) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsLike) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_note/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_note/gen_pkg.go index d3088c3c5..4618d8ea5 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_note/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_note/gen_pkg.go @@ -15,6 +15,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -76,6 +80,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_note/gen_type_activitystreams_note.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_note/gen_type_activitystreams_note.go index 6ac8034de..443ecf875 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_note/gen_type_activitystreams_note.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_note/gen_type_activitystreams_note.go @@ -19,6 +19,7 @@ import ( // } type ActivityStreamsNote struct { ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -34,6 +35,7 @@ type ActivityStreamsNote struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -110,6 +112,11 @@ func DeserializeNote(m map[string]interface{}, aliasMap map[string]string) (*Act } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -185,6 +192,11 @@ func DeserializeNote(m map[string]interface{}, aliasMap map[string]string) (*Act } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -282,6 +294,8 @@ func DeserializeNote(m map[string]interface{}, aliasMap map[string]string) (*Act // Begin: Code that ensures a property name is unknown if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -314,6 +328,8 @@ func DeserializeNote(m map[string]interface{}, aliasMap map[string]string) (*Act continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -593,6 +609,18 @@ func (this ActivityStreamsNote) GetActivityStreamsUrl() vocab.ActivityStreamsUrl return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsNote) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsNote) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsNote) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -629,6 +657,7 @@ func (this ActivityStreamsNote) IsExtending(other vocab.Type) bool { func (this ActivityStreamsNote) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -644,6 +673,7 @@ func (this ActivityStreamsNote) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -684,6 +714,20 @@ func (this ActivityStreamsNote) LessThan(o vocab.ActivityStreamsNote) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -894,6 +938,20 @@ func (this ActivityStreamsNote) LessThan(o vocab.ActivityStreamsNote) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1177,6 +1235,14 @@ func (this ActivityStreamsNote) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1297,6 +1363,14 @@ func (this ActivityStreamsNote) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1615,6 +1689,16 @@ func (this *ActivityStreamsNote) SetActivityStreamsUrl(i vocab.ActivityStreamsUr this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsNote) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsNote) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsNote) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_page/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_page/gen_pkg.go index eadfad1e5..b7da57286 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_page/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_page/gen_pkg.go @@ -15,6 +15,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -80,6 +84,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_page/gen_type_activitystreams_page.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_page/gen_type_activitystreams_page.go index cd01b3c2b..9f68e115e 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_page/gen_type_activitystreams_page.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_page/gen_type_activitystreams_page.go @@ -18,6 +18,7 @@ import ( // } type ActivityStreamsPage struct { ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -34,6 +35,7 @@ type ActivityStreamsPage struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -110,6 +112,11 @@ func DeserializePage(m map[string]interface{}, aliasMap map[string]string) (*Act } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -190,6 +197,11 @@ func DeserializePage(m map[string]interface{}, aliasMap map[string]string) (*Act } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -287,6 +299,8 @@ func DeserializePage(m map[string]interface{}, aliasMap map[string]string) (*Act // Begin: Code that ensures a property name is unknown if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -321,6 +335,8 @@ func DeserializePage(m map[string]interface{}, aliasMap map[string]string) (*Act continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -600,6 +616,18 @@ func (this ActivityStreamsPage) GetActivityStreamsUrl() vocab.ActivityStreamsUrl return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsPage) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsPage) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsPage) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -641,6 +669,7 @@ func (this ActivityStreamsPage) IsExtending(other vocab.Type) bool { func (this ActivityStreamsPage) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -657,6 +686,7 @@ func (this ActivityStreamsPage) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -697,6 +727,20 @@ func (this ActivityStreamsPage) LessThan(o vocab.ActivityStreamsPage) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -921,6 +965,20 @@ func (this ActivityStreamsPage) LessThan(o vocab.ActivityStreamsPage) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1204,6 +1262,14 @@ func (this ActivityStreamsPage) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1332,6 +1398,14 @@ func (this ActivityStreamsPage) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1650,6 +1724,16 @@ func (this *ActivityStreamsPage) SetActivityStreamsUrl(i vocab.ActivityStreamsUr this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsPage) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsPage) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsPage) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_place/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_place/gen_pkg.go index aa9a42b0d..88201a0b4 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_place/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_place/gen_pkg.go @@ -19,6 +19,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -80,6 +84,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLatitudePropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLatitudeProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_place/gen_type_activitystreams_place.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_place/gen_type_activitystreams_place.go index 90af537c8..b9f5219f3 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_place/gen_type_activitystreams_place.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_place/gen_type_activitystreams_place.go @@ -29,6 +29,7 @@ import ( type ActivityStreamsPlace struct { ActivityStreamsAccuracy vocab.ActivityStreamsAccuracyProperty ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -44,6 +45,7 @@ type ActivityStreamsPlace struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLatitude vocab.ActivityStreamsLatitudeProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty @@ -129,6 +131,11 @@ func DeserializePlace(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -204,6 +211,11 @@ func DeserializePlace(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLatitudePropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -323,6 +335,8 @@ func DeserializePlace(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -355,6 +369,8 @@ func DeserializePlace(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "latitude" { continue } else if k == "likes" { @@ -672,6 +688,18 @@ func (this ActivityStreamsPlace) GetActivityStreamsUrl() vocab.ActivityStreamsUr return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsPlace) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsPlace) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsPlace) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -709,6 +737,7 @@ func (this ActivityStreamsPlace) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAccuracy, m) m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -724,6 +753,7 @@ func (this ActivityStreamsPlace) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLatitude, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) @@ -782,6 +812,20 @@ func (this ActivityStreamsPlace) LessThan(o vocab.ActivityStreamsPlace) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -992,6 +1036,20 @@ func (this ActivityStreamsPlace) LessThan(o vocab.ActivityStreamsPlace) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "latitude" if lhs, rhs := this.ActivityStreamsLatitude, o.GetActivityStreamsLatitude(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1339,6 +1397,14 @@ func (this ActivityStreamsPlace) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1459,6 +1525,14 @@ func (this ActivityStreamsPlace) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "latitude" if this.ActivityStreamsLatitude != nil { if i, err := this.ActivityStreamsLatitude.Serialize(); err != nil { @@ -1834,6 +1908,16 @@ func (this *ActivityStreamsPlace) SetActivityStreamsUrl(i vocab.ActivityStreamsU this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsPlace) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsPlace) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsPlace) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_profile/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_profile/gen_pkg.go index 4f9919840..e9da24092 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_profile/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_profile/gen_pkg.go @@ -15,6 +15,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -80,6 +84,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_profile/gen_type_activitystreams_profile.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_profile/gen_type_activitystreams_profile.go index fb216273b..5725934a6 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_profile/gen_type_activitystreams_profile.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_profile/gen_type_activitystreams_profile.go @@ -23,6 +23,7 @@ import ( // } type ActivityStreamsProfile struct { ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -39,6 +40,7 @@ type ActivityStreamsProfile struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -115,6 +117,11 @@ func DeserializeProfile(m map[string]interface{}, aliasMap map[string]string) (* } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -195,6 +202,11 @@ func DeserializeProfile(m map[string]interface{}, aliasMap map[string]string) (* } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -292,6 +304,8 @@ func DeserializeProfile(m map[string]interface{}, aliasMap map[string]string) (* // Begin: Code that ensures a property name is unknown if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -326,6 +340,8 @@ func DeserializeProfile(m map[string]interface{}, aliasMap map[string]string) (* continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -611,6 +627,18 @@ func (this ActivityStreamsProfile) GetActivityStreamsUrl() vocab.ActivityStreams return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsProfile) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsProfile) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsProfile) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -647,6 +675,7 @@ func (this ActivityStreamsProfile) IsExtending(other vocab.Type) bool { func (this ActivityStreamsProfile) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -663,6 +692,7 @@ func (this ActivityStreamsProfile) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -703,6 +733,20 @@ func (this ActivityStreamsProfile) LessThan(o vocab.ActivityStreamsProfile) bool // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -927,6 +971,20 @@ func (this ActivityStreamsProfile) LessThan(o vocab.ActivityStreamsProfile) bool // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1210,6 +1268,14 @@ func (this ActivityStreamsProfile) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1338,6 +1404,14 @@ func (this ActivityStreamsProfile) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1661,6 +1735,16 @@ func (this *ActivityStreamsProfile) SetActivityStreamsUrl(i vocab.ActivityStream this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsProfile) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsProfile) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsProfile) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_question/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_question/gen_pkg.go index 032f7c697..2f8d56eb0 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_question/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_question/gen_pkg.go @@ -23,6 +23,10 @@ type privateManager interface { // method for the "ActivityStreamsAnyOfProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAnyOfPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAnyOfProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -92,6 +96,11 @@ type privateManager interface { // deserialization method for the "ActivityStreamsInstrumentProperty" // non-functional property in the vocabulary "ActivityStreams" DeserializeInstrumentPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInstrumentProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_question/gen_type_activitystreams_question.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_question/gen_type_activitystreams_question.go index 8c5d6dab3..f165591dc 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_question/gen_type_activitystreams_question.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_question/gen_type_activitystreams_question.go @@ -41,6 +41,7 @@ type ActivityStreamsQuestion struct { ActivityStreamsActor vocab.ActivityStreamsActorProperty ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty ActivityStreamsAnyOf vocab.ActivityStreamsAnyOfProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -58,6 +59,7 @@ type ActivityStreamsQuestion struct { ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty ActivityStreamsInstrument vocab.ActivityStreamsInstrumentProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -148,6 +150,11 @@ func DeserializeQuestion(m map[string]interface{}, aliasMap map[string]string) ( } else if p != nil { this.ActivityStreamsAnyOf = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -233,6 +240,11 @@ func DeserializeQuestion(m map[string]interface{}, aliasMap map[string]string) ( } else if p != nil { this.ActivityStreamsInstrument = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -354,6 +366,8 @@ func DeserializeQuestion(m map[string]interface{}, aliasMap map[string]string) ( continue } else if k == "anyOf" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -390,6 +404,8 @@ func DeserializeQuestion(m map[string]interface{}, aliasMap map[string]string) ( continue } else if k == "instrument" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -719,6 +735,18 @@ func (this ActivityStreamsQuestion) GetActivityStreamsUrl() vocab.ActivityStream return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsQuestion) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsQuestion) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsQuestion) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -763,6 +791,7 @@ func (this ActivityStreamsQuestion) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsActor, m) m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) m = this.helperJSONLDContext(this.ActivityStreamsAnyOf, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -780,6 +809,7 @@ func (this ActivityStreamsQuestion) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) m = this.helperJSONLDContext(this.ActivityStreamsInstrument, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -852,6 +882,20 @@ func (this ActivityStreamsQuestion) LessThan(o vocab.ActivityStreamsQuestion) bo // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1090,6 +1134,20 @@ func (this ActivityStreamsQuestion) LessThan(o vocab.ActivityStreamsQuestion) bo // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1445,6 +1503,14 @@ func (this ActivityStreamsQuestion) Serialize() (map[string]interface{}, error) m[this.ActivityStreamsAnyOf.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1581,6 +1647,14 @@ func (this ActivityStreamsQuestion) Serialize() (map[string]interface{}, error) m[this.ActivityStreamsInstrument.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1966,6 +2040,16 @@ func (this *ActivityStreamsQuestion) SetActivityStreamsUrl(i vocab.ActivityStrea this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsQuestion) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsQuestion) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsQuestion) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video/gen_pkg.go index e7fcae287..1ecea478d 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video/gen_pkg.go @@ -15,6 +15,10 @@ type privateManager interface { // method for the "ActivityStreamsAltitudeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeApprovedByPropertyGoToSocial returns the deserialization + // method for the "GoToSocialApprovedByProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) // DeserializeAttachmentPropertyActivityStreams returns the // deserialization method for the "ActivityStreamsAttachmentProperty" // non-functional property in the vocabulary "ActivityStreams" @@ -80,6 +84,11 @@ type privateManager interface { // method for the "ActivityStreamsInReplyToProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeInteractionPolicyPropertyGoToSocial returns the + // deserialization method for the + // "GoToSocialInteractionPolicyProperty" non-functional property in + // the vocabulary "GoToSocial" + DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) // DeserializeLikesPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsLikesProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video/gen_type_activitystreams_video.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video/gen_type_activitystreams_video.go index 75a1baeae..5fb390177 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video/gen_type_activitystreams_video.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video/gen_type_activitystreams_video.go @@ -19,6 +19,7 @@ import ( // } type ActivityStreamsVideo struct { ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + GoToSocialApprovedBy vocab.GoToSocialApprovedByProperty ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty @@ -35,6 +36,7 @@ type ActivityStreamsVideo struct { JSONLDId vocab.JSONLDIdProperty ActivityStreamsImage vocab.ActivityStreamsImageProperty ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + GoToSocialInteractionPolicy vocab.GoToSocialInteractionPolicyProperty ActivityStreamsLikes vocab.ActivityStreamsLikesProperty ActivityStreamsLocation vocab.ActivityStreamsLocationProperty ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty @@ -111,6 +113,11 @@ func DeserializeVideo(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsAltitude = p } + if p, err := mgr.DeserializeApprovedByPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovedBy = p + } if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -191,6 +198,11 @@ func DeserializeVideo(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsInReplyTo = p } + if p, err := mgr.DeserializeInteractionPolicyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialInteractionPolicy = p + } if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -288,6 +300,8 @@ func DeserializeVideo(m map[string]interface{}, aliasMap map[string]string) (*Ac // Begin: Code that ensures a property name is unknown if k == "altitude" { continue + } else if k == "approvedBy" { + continue } else if k == "attachment" { continue } else if k == "attributedTo" { @@ -322,6 +336,8 @@ func DeserializeVideo(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "inReplyTo" { continue + } else if k == "interactionPolicy" { + continue } else if k == "likes" { continue } else if k == "location" { @@ -601,6 +617,18 @@ func (this ActivityStreamsVideo) GetActivityStreamsUrl() vocab.ActivityStreamsUr return this.ActivityStreamsUrl } +// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists, and nil +// otherwise. +func (this ActivityStreamsVideo) GetGoToSocialApprovedBy() vocab.GoToSocialApprovedByProperty { + return this.GoToSocialApprovedBy +} + +// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property if it +// exists, and nil otherwise. +func (this ActivityStreamsVideo) GetGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicyProperty { + return this.GoToSocialInteractionPolicy +} + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this ActivityStreamsVideo) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -642,6 +670,7 @@ func (this ActivityStreamsVideo) IsExtending(other vocab.Type) bool { func (this ActivityStreamsVideo) JSONLDContext() map[string]string { m := map[string]string{"https://www.w3.org/ns/activitystreams": this.alias} m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.GoToSocialApprovedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) @@ -658,6 +687,7 @@ func (this ActivityStreamsVideo) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDId, m) m = this.helperJSONLDContext(this.ActivityStreamsImage, m) m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.GoToSocialInteractionPolicy, m) m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) @@ -698,6 +728,20 @@ func (this ActivityStreamsVideo) LessThan(o vocab.ActivityStreamsVideo) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "approvedBy" + if lhs, rhs := this.GoToSocialApprovedBy, o.GetGoToSocialApprovedBy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "attachment" if lhs, rhs := this.ActivityStreamsAttachment, o.GetActivityStreamsAttachment(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -922,6 +966,20 @@ func (this ActivityStreamsVideo) LessThan(o vocab.ActivityStreamsVideo) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "interactionPolicy" + if lhs, rhs := this.GoToSocialInteractionPolicy, o.GetGoToSocialInteractionPolicy(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil // Compare property "likes" if lhs, rhs := this.ActivityStreamsLikes, o.GetActivityStreamsLikes(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1205,6 +1263,14 @@ func (this ActivityStreamsVideo) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsAltitude.Name()] = i } } + // Maybe serialize property "approvedBy" + if this.GoToSocialApprovedBy != nil { + if i, err := this.GoToSocialApprovedBy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovedBy.Name()] = i + } + } // Maybe serialize property "attachment" if this.ActivityStreamsAttachment != nil { if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { @@ -1333,6 +1399,14 @@ func (this ActivityStreamsVideo) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsInReplyTo.Name()] = i } } + // Maybe serialize property "interactionPolicy" + if this.GoToSocialInteractionPolicy != nil { + if i, err := this.GoToSocialInteractionPolicy.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialInteractionPolicy.Name()] = i + } + } // Maybe serialize property "likes" if this.ActivityStreamsLikes != nil { if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { @@ -1651,6 +1725,16 @@ func (this *ActivityStreamsVideo) SetActivityStreamsUrl(i vocab.ActivityStreamsU this.ActivityStreamsUrl = i } +// SetGoToSocialApprovedBy sets the "approvedBy" property. +func (this *ActivityStreamsVideo) SetGoToSocialApprovedBy(i vocab.GoToSocialApprovedByProperty) { + this.GoToSocialApprovedBy = i +} + +// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property. +func (this *ActivityStreamsVideo) SetGoToSocialInteractionPolicy(i vocab.GoToSocialInteractionPolicyProperty) { + this.GoToSocialInteractionPolicy = i +} + // SetJSONLDId sets the "id" property. func (this *ActivityStreamsVideo) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always/gen_doc.go new file mode 100644 index 000000000..7df13c1d9 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertyalways contains the implementation for the always property. All +// applications are strongly encouraged to use the interface instead of this +// concrete definition. The interfaces allow applications to consume only the +// types and properties needed and be independent of the go-fed implementation +// if another alternative implementation is created. This package is +// code-generated and subject to the same license as the go-fed tool used to +// generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package propertyalways diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always/gen_pkg.go new file mode 100644 index 000000000..ee3d9208d --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always/gen_pkg.go @@ -0,0 +1,15 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyalways + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface{} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always/gen_property_gotosocial_always.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always/gen_property_gotosocial_always.go new file mode 100644 index 000000000..0dc39d3b3 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always/gen_property_gotosocial_always.go @@ -0,0 +1,503 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyalways + +import ( + "fmt" + anyuri "github.com/superseriousbusiness/activity/streams/values/anyURI" + vocab "github.com/superseriousbusiness/activity/streams/vocab" + "net/url" +) + +// GoToSocialAlwaysPropertyIterator is an iterator for a property. It is permitted +// to be a single nilable value type. +type GoToSocialAlwaysPropertyIterator struct { + xmlschemaAnyURIMember *url.URL + unknown interface{} + alias string + myIdx int + parent vocab.GoToSocialAlwaysProperty +} + +// NewGoToSocialAlwaysPropertyIterator creates a new GoToSocialAlways property. +func NewGoToSocialAlwaysPropertyIterator() *GoToSocialAlwaysPropertyIterator { + return &GoToSocialAlwaysPropertyIterator{alias: ""} +} + +// deserializeGoToSocialAlwaysPropertyIterator creates an iterator from an element +// that has been unmarshalled from a text or binary format. +func deserializeGoToSocialAlwaysPropertyIterator(i interface{}, aliasMap map[string]string) (*GoToSocialAlwaysPropertyIterator, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + if v, err := anyuri.DeserializeAnyURI(i); err == nil { + this := &GoToSocialAlwaysPropertyIterator{ + alias: alias, + xmlschemaAnyURIMember: v, + } + return this, nil + } + this := &GoToSocialAlwaysPropertyIterator{ + alias: alias, + unknown: i, + } + return this, nil +} + +// Get returns the value of this property. When IsXMLSchemaAnyURI returns false, +// Get will return any arbitrary value. +func (this GoToSocialAlwaysPropertyIterator) Get() *url.URL { + return this.xmlschemaAnyURIMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this GoToSocialAlwaysPropertyIterator) GetIRI() *url.URL { + return this.xmlschemaAnyURIMember +} + +// HasAny returns true if the value or IRI is set. +func (this GoToSocialAlwaysPropertyIterator) HasAny() bool { + return this.IsXMLSchemaAnyURI() +} + +// IsIRI returns true if this property is an IRI. +func (this GoToSocialAlwaysPropertyIterator) IsIRI() bool { + return this.xmlschemaAnyURIMember != nil +} + +// IsXMLSchemaAnyURI returns true if this property is set and not an IRI. +func (this GoToSocialAlwaysPropertyIterator) IsXMLSchemaAnyURI() bool { + return this.xmlschemaAnyURIMember != nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialAlwaysPropertyIterator) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + var child map[string]string + + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API detail only for folks looking to replace the go-fed +// implementation. Applications should not use this method. +func (this GoToSocialAlwaysPropertyIterator) KindIndex() int { + if this.IsXMLSchemaAnyURI() { + return 0 + } + if this.IsIRI() { + return -2 + } + return -1 +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialAlwaysPropertyIterator) LessThan(o vocab.GoToSocialAlwaysPropertyIterator) bool { + if this.IsIRI() { + // IRIs are always less than other values, none, or unknowns + return true + } else if o.IsIRI() { + // This other, none, or unknown value is always greater than IRIs + return false + } + // LessThan comparison for the single value or unknown value. + if !this.IsXMLSchemaAnyURI() && !o.IsXMLSchemaAnyURI() { + // Both are unknowns. + return false + } else if this.IsXMLSchemaAnyURI() && !o.IsXMLSchemaAnyURI() { + // Values are always greater than unknown values. + return false + } else if !this.IsXMLSchemaAnyURI() && o.IsXMLSchemaAnyURI() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return anyuri.LessAnyURI(this.Get(), o.Get()) + } +} + +// Name returns the name of this property: "GoToSocialAlways". +func (this GoToSocialAlwaysPropertyIterator) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "GoToSocialAlways" + } else { + return "GoToSocialAlways" + } +} + +// Next returns the next iterator, or nil if there is no next iterator. +func (this GoToSocialAlwaysPropertyIterator) Next() vocab.GoToSocialAlwaysPropertyIterator { + if this.myIdx+1 >= this.parent.Len() { + return nil + } else { + return this.parent.At(this.myIdx + 1) + } +} + +// Prev returns the previous iterator, or nil if there is no previous iterator. +func (this GoToSocialAlwaysPropertyIterator) Prev() vocab.GoToSocialAlwaysPropertyIterator { + if this.myIdx-1 < 0 { + return nil + } else { + return this.parent.At(this.myIdx - 1) + } +} + +// Set sets the value of this property. Calling IsXMLSchemaAnyURI afterwards will +// return true. +func (this *GoToSocialAlwaysPropertyIterator) Set(v *url.URL) { + this.clear() + this.xmlschemaAnyURIMember = v +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *GoToSocialAlwaysPropertyIterator) SetIRI(v *url.URL) { + this.clear() + this.Set(v) +} + +// clear ensures no value of this property is set. Calling IsXMLSchemaAnyURI +// afterwards will return false. +func (this *GoToSocialAlwaysPropertyIterator) clear() { + this.unknown = nil + this.xmlschemaAnyURIMember = nil +} + +// serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialAlwaysPropertyIterator) serialize() (interface{}, error) { + if this.IsXMLSchemaAnyURI() { + return anyuri.SerializeAnyURI(this.Get()) + } + return this.unknown, nil +} + +// GoToSocialAlwaysProperty is the non-functional property "always". It is +// permitted to have one or more values, and of different value types. +type GoToSocialAlwaysProperty struct { + properties []*GoToSocialAlwaysPropertyIterator + alias string +} + +// DeserializeAlwaysProperty creates a "always" property from an interface +// representation that has been unmarshalled from a text or binary format. +func DeserializeAlwaysProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialAlwaysProperty, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + propName := "always" + if len(alias) > 0 { + propName = fmt.Sprintf("%s:%s", alias, "always") + } + i, ok := m[propName] + + if ok { + this := &GoToSocialAlwaysProperty{ + alias: alias, + properties: []*GoToSocialAlwaysPropertyIterator{}, + } + if list, ok := i.([]interface{}); ok { + for _, iterator := range list { + if p, err := deserializeGoToSocialAlwaysPropertyIterator(iterator, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + } else { + if p, err := deserializeGoToSocialAlwaysPropertyIterator(i, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + // Set up the properties for iteration. + for idx, ele := range this.properties { + ele.parent = this + ele.myIdx = idx + } + return this, nil + } + return nil, nil +} + +// NewGoToSocialAlwaysProperty creates a new always property. +func NewGoToSocialAlwaysProperty() *GoToSocialAlwaysProperty { + return &GoToSocialAlwaysProperty{alias: ""} +} + +// AppendIRI appends an IRI value to the back of a list of the property "always" +func (this *GoToSocialAlwaysProperty) AppendIRI(v *url.URL) { + this.properties = append(this.properties, &GoToSocialAlwaysPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + xmlschemaAnyURIMember: v, + }) +} + +// AppendXMLSchemaAnyURI appends a anyURI value to the back of a list of the +// property "always". Invalidates iterators that are traversing using Prev. +func (this *GoToSocialAlwaysProperty) AppendXMLSchemaAnyURI(v *url.URL) { + this.properties = append(this.properties, &GoToSocialAlwaysPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + xmlschemaAnyURIMember: v, + }) +} + +// At returns the property value for the specified index. Panics if the index is +// out of bounds. +func (this GoToSocialAlwaysProperty) At(index int) vocab.GoToSocialAlwaysPropertyIterator { + return this.properties[index] +} + +// Begin returns the first iterator, or nil if empty. Can be used with the +// iterator's Next method and this property's End method to iterate from front +// to back through all values. +func (this GoToSocialAlwaysProperty) Begin() vocab.GoToSocialAlwaysPropertyIterator { + if this.Empty() { + return nil + } else { + return this.properties[0] + } +} + +// Empty returns returns true if there are no elements. +func (this GoToSocialAlwaysProperty) Empty() bool { + return this.Len() == 0 +} + +// End returns beyond-the-last iterator, which is nil. Can be used with the +// iterator's Next method and this property's Begin method to iterate from +// front to back through all values. +func (this GoToSocialAlwaysProperty) End() vocab.GoToSocialAlwaysPropertyIterator { + return nil +} + +// Insert inserts an IRI value at the specified index for a property "always". +// Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *GoToSocialAlwaysProperty) InsertIRI(idx int, v *url.URL) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialAlwaysPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + xmlschemaAnyURIMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertXMLSchemaAnyURI inserts a anyURI value at the specified index for a +// property "always". Existing elements at that index and higher are shifted +// back once. Invalidates all iterators. +func (this *GoToSocialAlwaysProperty) InsertXMLSchemaAnyURI(idx int, v *url.URL) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialAlwaysPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + xmlschemaAnyURIMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialAlwaysProperty) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + for _, elem := range this.properties { + child := elem.JSONLDContext() + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API method specifically needed only for alternate implementations +// for go-fed. Applications should not use this method. Panics if the index is +// out of bounds. +func (this GoToSocialAlwaysProperty) KindIndex(idx int) int { + return this.properties[idx].KindIndex() +} + +// Len returns the number of values that exist for the "always" property. +func (this GoToSocialAlwaysProperty) Len() (length int) { + return len(this.properties) +} + +// Less computes whether another property is less than this one. Mixing types +// results in a consistent but arbitrary ordering +func (this GoToSocialAlwaysProperty) Less(i, j int) bool { + idx1 := this.KindIndex(i) + idx2 := this.KindIndex(j) + if idx1 < idx2 { + return true + } else if idx1 == idx2 { + if idx1 == 0 { + lhs := this.properties[i].Get() + rhs := this.properties[j].Get() + return anyuri.LessAnyURI(lhs, rhs) + } else if idx1 == -2 { + lhs := this.properties[i].GetIRI() + rhs := this.properties[j].GetIRI() + return lhs.String() < rhs.String() + } + } + return false +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialAlwaysProperty) LessThan(o vocab.GoToSocialAlwaysProperty) bool { + l1 := this.Len() + l2 := o.Len() + l := l1 + if l2 < l1 { + l = l2 + } + for i := 0; i < l; i++ { + if this.properties[i].LessThan(o.At(i)) { + return true + } else if o.At(i).LessThan(this.properties[i]) { + return false + } + } + return l1 < l2 +} + +// Name returns the name of this property ("always") with any alias. +func (this GoToSocialAlwaysProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "always" + } else { + return "always" + } +} + +// PrependIRI prepends an IRI value to the front of a list of the property +// "always". +func (this *GoToSocialAlwaysProperty) PrependIRI(v *url.URL) { + this.properties = append([]*GoToSocialAlwaysPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + xmlschemaAnyURIMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependXMLSchemaAnyURI prepends a anyURI value to the front of a list of the +// property "always". Invalidates all iterators. +func (this *GoToSocialAlwaysProperty) PrependXMLSchemaAnyURI(v *url.URL) { + this.properties = append([]*GoToSocialAlwaysPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + xmlschemaAnyURIMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Remove deletes an element at the specified index from a list of the property +// "always", regardless of its type. Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *GoToSocialAlwaysProperty) Remove(idx int) { + (this.properties)[idx].parent = nil + copy((this.properties)[idx:], (this.properties)[idx+1:]) + (this.properties)[len(this.properties)-1] = &GoToSocialAlwaysPropertyIterator{} + this.properties = (this.properties)[:len(this.properties)-1] + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialAlwaysProperty) Serialize() (interface{}, error) { + s := make([]interface{}, 0, len(this.properties)) + for _, iterator := range this.properties { + if b, err := iterator.serialize(); err != nil { + return s, err + } else { + s = append(s, b) + } + } + // Shortcut: if serializing one value, don't return an array -- pretty sure other Fediverse software would choke on a "type" value with array, for example. + if len(s) == 1 { + return s[0], nil + } + return s, nil +} + +// Set sets a anyURI value to be at the specified index for the property "always". +// Panics if the index is out of bounds. Invalidates all iterators. +func (this *GoToSocialAlwaysProperty) Set(idx int, v *url.URL) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialAlwaysPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + xmlschemaAnyURIMember: v, + } +} + +// SetIRI sets an IRI value to be at the specified index for the property +// "always". Panics if the index is out of bounds. +func (this *GoToSocialAlwaysProperty) SetIRI(idx int, v *url.URL) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialAlwaysPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + xmlschemaAnyURIMember: v, + } +} + +// Swap swaps the location of values at two indices for the "always" property. +func (this GoToSocialAlwaysProperty) Swap(i, j int) { + this.properties[i], this.properties[j] = this.properties[j], this.properties[i] +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired/gen_doc.go new file mode 100644 index 000000000..bf6ce36b0 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertyapprovalrequired contains the implementation for the +// approvalRequired property. All applications are strongly encouraged to use +// the interface instead of this concrete definition. The interfaces allow +// applications to consume only the types and properties needed and be +// independent of the go-fed implementation if another alternative +// implementation is created. This package is code-generated and subject to +// the same license as the go-fed tool used to generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package propertyapprovalrequired diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired/gen_pkg.go new file mode 100644 index 000000000..6251a6ed2 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired/gen_pkg.go @@ -0,0 +1,15 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyapprovalrequired + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface{} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired/gen_property_gotosocial_approvalRequired.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired/gen_property_gotosocial_approvalRequired.go new file mode 100644 index 000000000..fbb6411da --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired/gen_property_gotosocial_approvalRequired.go @@ -0,0 +1,510 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyapprovalrequired + +import ( + "fmt" + anyuri "github.com/superseriousbusiness/activity/streams/values/anyURI" + vocab "github.com/superseriousbusiness/activity/streams/vocab" + "net/url" +) + +// GoToSocialApprovalRequiredPropertyIterator is an iterator for a property. It is +// permitted to be a single nilable value type. +type GoToSocialApprovalRequiredPropertyIterator struct { + xmlschemaAnyURIMember *url.URL + unknown interface{} + alias string + myIdx int + parent vocab.GoToSocialApprovalRequiredProperty +} + +// NewGoToSocialApprovalRequiredPropertyIterator creates a new +// GoToSocialApprovalRequired property. +func NewGoToSocialApprovalRequiredPropertyIterator() *GoToSocialApprovalRequiredPropertyIterator { + return &GoToSocialApprovalRequiredPropertyIterator{alias: ""} +} + +// deserializeGoToSocialApprovalRequiredPropertyIterator creates an iterator from +// an element that has been unmarshalled from a text or binary format. +func deserializeGoToSocialApprovalRequiredPropertyIterator(i interface{}, aliasMap map[string]string) (*GoToSocialApprovalRequiredPropertyIterator, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + if v, err := anyuri.DeserializeAnyURI(i); err == nil { + this := &GoToSocialApprovalRequiredPropertyIterator{ + alias: alias, + xmlschemaAnyURIMember: v, + } + return this, nil + } + this := &GoToSocialApprovalRequiredPropertyIterator{ + alias: alias, + unknown: i, + } + return this, nil +} + +// Get returns the value of this property. When IsXMLSchemaAnyURI returns false, +// Get will return any arbitrary value. +func (this GoToSocialApprovalRequiredPropertyIterator) Get() *url.URL { + return this.xmlschemaAnyURIMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this GoToSocialApprovalRequiredPropertyIterator) GetIRI() *url.URL { + return this.xmlschemaAnyURIMember +} + +// HasAny returns true if the value or IRI is set. +func (this GoToSocialApprovalRequiredPropertyIterator) HasAny() bool { + return this.IsXMLSchemaAnyURI() +} + +// IsIRI returns true if this property is an IRI. +func (this GoToSocialApprovalRequiredPropertyIterator) IsIRI() bool { + return this.xmlschemaAnyURIMember != nil +} + +// IsXMLSchemaAnyURI returns true if this property is set and not an IRI. +func (this GoToSocialApprovalRequiredPropertyIterator) IsXMLSchemaAnyURI() bool { + return this.xmlschemaAnyURIMember != nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialApprovalRequiredPropertyIterator) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + var child map[string]string + + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API detail only for folks looking to replace the go-fed +// implementation. Applications should not use this method. +func (this GoToSocialApprovalRequiredPropertyIterator) KindIndex() int { + if this.IsXMLSchemaAnyURI() { + return 0 + } + if this.IsIRI() { + return -2 + } + return -1 +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialApprovalRequiredPropertyIterator) LessThan(o vocab.GoToSocialApprovalRequiredPropertyIterator) bool { + if this.IsIRI() { + // IRIs are always less than other values, none, or unknowns + return true + } else if o.IsIRI() { + // This other, none, or unknown value is always greater than IRIs + return false + } + // LessThan comparison for the single value or unknown value. + if !this.IsXMLSchemaAnyURI() && !o.IsXMLSchemaAnyURI() { + // Both are unknowns. + return false + } else if this.IsXMLSchemaAnyURI() && !o.IsXMLSchemaAnyURI() { + // Values are always greater than unknown values. + return false + } else if !this.IsXMLSchemaAnyURI() && o.IsXMLSchemaAnyURI() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return anyuri.LessAnyURI(this.Get(), o.Get()) + } +} + +// Name returns the name of this property: "GoToSocialApprovalRequired". +func (this GoToSocialApprovalRequiredPropertyIterator) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "GoToSocialApprovalRequired" + } else { + return "GoToSocialApprovalRequired" + } +} + +// Next returns the next iterator, or nil if there is no next iterator. +func (this GoToSocialApprovalRequiredPropertyIterator) Next() vocab.GoToSocialApprovalRequiredPropertyIterator { + if this.myIdx+1 >= this.parent.Len() { + return nil + } else { + return this.parent.At(this.myIdx + 1) + } +} + +// Prev returns the previous iterator, or nil if there is no previous iterator. +func (this GoToSocialApprovalRequiredPropertyIterator) Prev() vocab.GoToSocialApprovalRequiredPropertyIterator { + if this.myIdx-1 < 0 { + return nil + } else { + return this.parent.At(this.myIdx - 1) + } +} + +// Set sets the value of this property. Calling IsXMLSchemaAnyURI afterwards will +// return true. +func (this *GoToSocialApprovalRequiredPropertyIterator) Set(v *url.URL) { + this.clear() + this.xmlschemaAnyURIMember = v +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *GoToSocialApprovalRequiredPropertyIterator) SetIRI(v *url.URL) { + this.clear() + this.Set(v) +} + +// clear ensures no value of this property is set. Calling IsXMLSchemaAnyURI +// afterwards will return false. +func (this *GoToSocialApprovalRequiredPropertyIterator) clear() { + this.unknown = nil + this.xmlschemaAnyURIMember = nil +} + +// serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialApprovalRequiredPropertyIterator) serialize() (interface{}, error) { + if this.IsXMLSchemaAnyURI() { + return anyuri.SerializeAnyURI(this.Get()) + } + return this.unknown, nil +} + +// GoToSocialApprovalRequiredProperty is the non-functional property +// "approvalRequired". It is permitted to have one or more values, and of +// different value types. +type GoToSocialApprovalRequiredProperty struct { + properties []*GoToSocialApprovalRequiredPropertyIterator + alias string +} + +// DeserializeApprovalRequiredProperty creates a "approvalRequired" property from +// an interface representation that has been unmarshalled from a text or +// binary format. +func DeserializeApprovalRequiredProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialApprovalRequiredProperty, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + propName := "approvalRequired" + if len(alias) > 0 { + propName = fmt.Sprintf("%s:%s", alias, "approvalRequired") + } + i, ok := m[propName] + + if ok { + this := &GoToSocialApprovalRequiredProperty{ + alias: alias, + properties: []*GoToSocialApprovalRequiredPropertyIterator{}, + } + if list, ok := i.([]interface{}); ok { + for _, iterator := range list { + if p, err := deserializeGoToSocialApprovalRequiredPropertyIterator(iterator, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + } else { + if p, err := deserializeGoToSocialApprovalRequiredPropertyIterator(i, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + // Set up the properties for iteration. + for idx, ele := range this.properties { + ele.parent = this + ele.myIdx = idx + } + return this, nil + } + return nil, nil +} + +// NewGoToSocialApprovalRequiredProperty creates a new approvalRequired property. +func NewGoToSocialApprovalRequiredProperty() *GoToSocialApprovalRequiredProperty { + return &GoToSocialApprovalRequiredProperty{alias: ""} +} + +// AppendIRI appends an IRI value to the back of a list of the property +// "approvalRequired" +func (this *GoToSocialApprovalRequiredProperty) AppendIRI(v *url.URL) { + this.properties = append(this.properties, &GoToSocialApprovalRequiredPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + xmlschemaAnyURIMember: v, + }) +} + +// AppendXMLSchemaAnyURI appends a anyURI value to the back of a list of the +// property "approvalRequired". Invalidates iterators that are traversing +// using Prev. +func (this *GoToSocialApprovalRequiredProperty) AppendXMLSchemaAnyURI(v *url.URL) { + this.properties = append(this.properties, &GoToSocialApprovalRequiredPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + xmlschemaAnyURIMember: v, + }) +} + +// At returns the property value for the specified index. Panics if the index is +// out of bounds. +func (this GoToSocialApprovalRequiredProperty) At(index int) vocab.GoToSocialApprovalRequiredPropertyIterator { + return this.properties[index] +} + +// Begin returns the first iterator, or nil if empty. Can be used with the +// iterator's Next method and this property's End method to iterate from front +// to back through all values. +func (this GoToSocialApprovalRequiredProperty) Begin() vocab.GoToSocialApprovalRequiredPropertyIterator { + if this.Empty() { + return nil + } else { + return this.properties[0] + } +} + +// Empty returns returns true if there are no elements. +func (this GoToSocialApprovalRequiredProperty) Empty() bool { + return this.Len() == 0 +} + +// End returns beyond-the-last iterator, which is nil. Can be used with the +// iterator's Next method and this property's Begin method to iterate from +// front to back through all values. +func (this GoToSocialApprovalRequiredProperty) End() vocab.GoToSocialApprovalRequiredPropertyIterator { + return nil +} + +// Insert inserts an IRI value at the specified index for a property +// "approvalRequired". Existing elements at that index and higher are shifted +// back once. Invalidates all iterators. +func (this *GoToSocialApprovalRequiredProperty) InsertIRI(idx int, v *url.URL) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialApprovalRequiredPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + xmlschemaAnyURIMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertXMLSchemaAnyURI inserts a anyURI value at the specified index for a +// property "approvalRequired". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *GoToSocialApprovalRequiredProperty) InsertXMLSchemaAnyURI(idx int, v *url.URL) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialApprovalRequiredPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + xmlschemaAnyURIMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialApprovalRequiredProperty) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + for _, elem := range this.properties { + child := elem.JSONLDContext() + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API method specifically needed only for alternate implementations +// for go-fed. Applications should not use this method. Panics if the index is +// out of bounds. +func (this GoToSocialApprovalRequiredProperty) KindIndex(idx int) int { + return this.properties[idx].KindIndex() +} + +// Len returns the number of values that exist for the "approvalRequired" property. +func (this GoToSocialApprovalRequiredProperty) Len() (length int) { + return len(this.properties) +} + +// Less computes whether another property is less than this one. Mixing types +// results in a consistent but arbitrary ordering +func (this GoToSocialApprovalRequiredProperty) Less(i, j int) bool { + idx1 := this.KindIndex(i) + idx2 := this.KindIndex(j) + if idx1 < idx2 { + return true + } else if idx1 == idx2 { + if idx1 == 0 { + lhs := this.properties[i].Get() + rhs := this.properties[j].Get() + return anyuri.LessAnyURI(lhs, rhs) + } else if idx1 == -2 { + lhs := this.properties[i].GetIRI() + rhs := this.properties[j].GetIRI() + return lhs.String() < rhs.String() + } + } + return false +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialApprovalRequiredProperty) LessThan(o vocab.GoToSocialApprovalRequiredProperty) bool { + l1 := this.Len() + l2 := o.Len() + l := l1 + if l2 < l1 { + l = l2 + } + for i := 0; i < l; i++ { + if this.properties[i].LessThan(o.At(i)) { + return true + } else if o.At(i).LessThan(this.properties[i]) { + return false + } + } + return l1 < l2 +} + +// Name returns the name of this property ("approvalRequired") with any alias. +func (this GoToSocialApprovalRequiredProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "approvalRequired" + } else { + return "approvalRequired" + } +} + +// PrependIRI prepends an IRI value to the front of a list of the property +// "approvalRequired". +func (this *GoToSocialApprovalRequiredProperty) PrependIRI(v *url.URL) { + this.properties = append([]*GoToSocialApprovalRequiredPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + xmlschemaAnyURIMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependXMLSchemaAnyURI prepends a anyURI value to the front of a list of the +// property "approvalRequired". Invalidates all iterators. +func (this *GoToSocialApprovalRequiredProperty) PrependXMLSchemaAnyURI(v *url.URL) { + this.properties = append([]*GoToSocialApprovalRequiredPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + xmlschemaAnyURIMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Remove deletes an element at the specified index from a list of the property +// "approvalRequired", regardless of its type. Panics if the index is out of +// bounds. Invalidates all iterators. +func (this *GoToSocialApprovalRequiredProperty) Remove(idx int) { + (this.properties)[idx].parent = nil + copy((this.properties)[idx:], (this.properties)[idx+1:]) + (this.properties)[len(this.properties)-1] = &GoToSocialApprovalRequiredPropertyIterator{} + this.properties = (this.properties)[:len(this.properties)-1] + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialApprovalRequiredProperty) Serialize() (interface{}, error) { + s := make([]interface{}, 0, len(this.properties)) + for _, iterator := range this.properties { + if b, err := iterator.serialize(); err != nil { + return s, err + } else { + s = append(s, b) + } + } + // Shortcut: if serializing one value, don't return an array -- pretty sure other Fediverse software would choke on a "type" value with array, for example. + if len(s) == 1 { + return s[0], nil + } + return s, nil +} + +// Set sets a anyURI value to be at the specified index for the property +// "approvalRequired". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *GoToSocialApprovalRequiredProperty) Set(idx int, v *url.URL) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialApprovalRequiredPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + xmlschemaAnyURIMember: v, + } +} + +// SetIRI sets an IRI value to be at the specified index for the property +// "approvalRequired". Panics if the index is out of bounds. +func (this *GoToSocialApprovalRequiredProperty) SetIRI(idx int, v *url.URL) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialApprovalRequiredPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + xmlschemaAnyURIMember: v, + } +} + +// Swap swaps the location of values at two indices for the "approvalRequired" +// property. +func (this GoToSocialApprovalRequiredProperty) Swap(i, j int) { + this.properties[i], this.properties[j] = this.properties[j], this.properties[i] +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby/gen_doc.go new file mode 100644 index 000000000..f334d13a9 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertyapprovedby contains the implementation for the approvedBy +// property. All applications are strongly encouraged to use the interface +// instead of this concrete definition. The interfaces allow applications to +// consume only the types and properties needed and be independent of the +// go-fed implementation if another alternative implementation is created. +// This package is code-generated and subject to the same license as the +// go-fed tool used to generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package propertyapprovedby diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby/gen_pkg.go new file mode 100644 index 000000000..60c83f53e --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby/gen_pkg.go @@ -0,0 +1,15 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyapprovedby + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface{} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby/gen_property_gotosocial_approvedBy.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby/gen_property_gotosocial_approvedBy.go new file mode 100644 index 000000000..db7f9c194 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby/gen_property_gotosocial_approvedBy.go @@ -0,0 +1,181 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyapprovedby + +import ( + "fmt" + anyuri "github.com/superseriousbusiness/activity/streams/values/anyURI" + vocab "github.com/superseriousbusiness/activity/streams/vocab" + "net/url" +) + +// GoToSocialApprovedByProperty is the functional property "approvedBy". It is +// permitted to be a single nilable value type. +type GoToSocialApprovedByProperty struct { + xmlschemaAnyURIMember *url.URL + unknown interface{} + alias string +} + +// DeserializeApprovedByProperty creates a "approvedBy" property from an interface +// representation that has been unmarshalled from a text or binary format. +func DeserializeApprovedByProperty(m map[string]interface{}, aliasMap map[string]string) (*GoToSocialApprovedByProperty, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + propName := "approvedBy" + if len(alias) > 0 { + // Use alias both to find the property, and set within the property. + propName = fmt.Sprintf("%s:%s", alias, "approvedBy") + } + i, ok := m[propName] + + if ok { + if v, err := anyuri.DeserializeAnyURI(i); err == nil { + this := &GoToSocialApprovedByProperty{ + alias: alias, + xmlschemaAnyURIMember: v, + } + return this, nil + } + this := &GoToSocialApprovedByProperty{ + alias: alias, + unknown: i, + } + return this, nil + } + return nil, nil +} + +// NewGoToSocialApprovedByProperty creates a new approvedBy property. +func NewGoToSocialApprovedByProperty() *GoToSocialApprovedByProperty { + return &GoToSocialApprovedByProperty{alias: ""} +} + +// Clear ensures no value of this property is set. Calling IsXMLSchemaAnyURI +// afterwards will return false. +func (this *GoToSocialApprovedByProperty) Clear() { + this.unknown = nil + this.xmlschemaAnyURIMember = nil +} + +// Get returns the value of this property. When IsXMLSchemaAnyURI returns false, +// Get will return any arbitrary value. +func (this GoToSocialApprovedByProperty) Get() *url.URL { + return this.xmlschemaAnyURIMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this GoToSocialApprovedByProperty) GetIRI() *url.URL { + return this.xmlschemaAnyURIMember +} + +// HasAny returns true if the value or IRI is set. +func (this GoToSocialApprovedByProperty) HasAny() bool { + return this.IsXMLSchemaAnyURI() +} + +// IsIRI returns true if this property is an IRI. +func (this GoToSocialApprovedByProperty) IsIRI() bool { + return this.xmlschemaAnyURIMember != nil +} + +// IsXMLSchemaAnyURI returns true if this property is set and not an IRI. +func (this GoToSocialApprovedByProperty) IsXMLSchemaAnyURI() bool { + return this.xmlschemaAnyURIMember != nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialApprovedByProperty) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + var child map[string]string + + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API detail only for folks looking to replace the go-fed +// implementation. Applications should not use this method. +func (this GoToSocialApprovedByProperty) KindIndex() int { + if this.IsXMLSchemaAnyURI() { + return 0 + } + if this.IsIRI() { + return -2 + } + return -1 +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialApprovedByProperty) LessThan(o vocab.GoToSocialApprovedByProperty) bool { + if this.IsIRI() { + // IRIs are always less than other values, none, or unknowns + return true + } else if o.IsIRI() { + // This other, none, or unknown value is always greater than IRIs + return false + } + // LessThan comparison for the single value or unknown value. + if !this.IsXMLSchemaAnyURI() && !o.IsXMLSchemaAnyURI() { + // Both are unknowns. + return false + } else if this.IsXMLSchemaAnyURI() && !o.IsXMLSchemaAnyURI() { + // Values are always greater than unknown values. + return false + } else if !this.IsXMLSchemaAnyURI() && o.IsXMLSchemaAnyURI() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return anyuri.LessAnyURI(this.Get(), o.Get()) + } +} + +// Name returns the name of this property: "approvedBy". +func (this GoToSocialApprovedByProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "approvedBy" + } else { + return "approvedBy" + } +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialApprovedByProperty) Serialize() (interface{}, error) { + if this.IsXMLSchemaAnyURI() { + return anyuri.SerializeAnyURI(this.Get()) + } + return this.unknown, nil +} + +// Set sets the value of this property. Calling IsXMLSchemaAnyURI afterwards will +// return true. +func (this *GoToSocialApprovedByProperty) Set(v *url.URL) { + this.Clear() + this.xmlschemaAnyURIMember = v +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *GoToSocialApprovedByProperty) SetIRI(v *url.URL) { + this.Clear() + this.Set(v) +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce/gen_doc.go new file mode 100644 index 000000000..0d90f0913 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertycanannounce contains the implementation for the canAnnounce +// property. All applications are strongly encouraged to use the interface +// instead of this concrete definition. The interfaces allow applications to +// consume only the types and properties needed and be independent of the +// go-fed implementation if another alternative implementation is created. +// This package is code-generated and subject to the same license as the +// go-fed tool used to generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package propertycanannounce diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce/gen_pkg.go new file mode 100644 index 000000000..c13d3eec8 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce/gen_pkg.go @@ -0,0 +1,22 @@ +// Code generated by astool. DO NOT EDIT. + +package propertycanannounce + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface { + // DeserializeCanAnnounceGoToSocial returns the deserialization method for + // the "GoToSocialCanAnnounce" non-functional property in the + // vocabulary "GoToSocial" + DeserializeCanAnnounceGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanAnnounce, error) +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce/gen_property_gotosocial_canAnnounce.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce/gen_property_gotosocial_canAnnounce.go new file mode 100644 index 000000000..ad86e89c3 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce/gen_property_gotosocial_canAnnounce.go @@ -0,0 +1,625 @@ +// Code generated by astool. DO NOT EDIT. + +package propertycanannounce + +import ( + "fmt" + vocab "github.com/superseriousbusiness/activity/streams/vocab" + "net/url" +) + +// GoToSocialCanAnnouncePropertyIterator is an iterator for a property. It is +// permitted to be a single nilable value type. +type GoToSocialCanAnnouncePropertyIterator struct { + gotosocialCanAnnounceMember vocab.GoToSocialCanAnnounce + unknown interface{} + iri *url.URL + alias string + myIdx int + parent vocab.GoToSocialCanAnnounceProperty +} + +// NewGoToSocialCanAnnouncePropertyIterator creates a new GoToSocialCanAnnounce +// property. +func NewGoToSocialCanAnnouncePropertyIterator() *GoToSocialCanAnnouncePropertyIterator { + return &GoToSocialCanAnnouncePropertyIterator{alias: ""} +} + +// deserializeGoToSocialCanAnnouncePropertyIterator creates an iterator from an +// element that has been unmarshalled from a text or binary format. +func deserializeGoToSocialCanAnnouncePropertyIterator(i interface{}, aliasMap map[string]string) (*GoToSocialCanAnnouncePropertyIterator, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + if s, ok := i.(string); ok { + u, err := url.Parse(s) + // If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst + // Also, if no scheme exists, don't treat it as a URL -- net/url is greedy + if err == nil && len(u.Scheme) > 0 { + this := &GoToSocialCanAnnouncePropertyIterator{ + alias: alias, + iri: u, + } + return this, nil + } + } + if m, ok := i.(map[string]interface{}); ok { + if v, err := mgr.DeserializeCanAnnounceGoToSocial()(m, aliasMap); err == nil { + this := &GoToSocialCanAnnouncePropertyIterator{ + alias: alias, + gotosocialCanAnnounceMember: v, + } + return this, nil + } + } + this := &GoToSocialCanAnnouncePropertyIterator{ + alias: alias, + unknown: i, + } + return this, nil +} + +// Get returns the value of this property. When IsGoToSocialCanAnnounce returns +// false, Get will return any arbitrary value. +func (this GoToSocialCanAnnouncePropertyIterator) Get() vocab.GoToSocialCanAnnounce { + return this.gotosocialCanAnnounceMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this GoToSocialCanAnnouncePropertyIterator) GetIRI() *url.URL { + return this.iri +} + +// GetType returns the value in this property as a Type. Returns nil if the value +// is not an ActivityStreams type, such as an IRI or another value. +func (this GoToSocialCanAnnouncePropertyIterator) GetType() vocab.Type { + if this.IsGoToSocialCanAnnounce() { + return this.Get() + } + + return nil +} + +// HasAny returns true if the value or IRI is set. +func (this GoToSocialCanAnnouncePropertyIterator) HasAny() bool { + return this.IsGoToSocialCanAnnounce() || this.iri != nil +} + +// IsGoToSocialCanAnnounce returns true if this property is set and not an IRI. +func (this GoToSocialCanAnnouncePropertyIterator) IsGoToSocialCanAnnounce() bool { + return this.gotosocialCanAnnounceMember != nil +} + +// IsIRI returns true if this property is an IRI. +func (this GoToSocialCanAnnouncePropertyIterator) IsIRI() bool { + return this.iri != nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialCanAnnouncePropertyIterator) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + var child map[string]string + if this.IsGoToSocialCanAnnounce() { + child = this.Get().JSONLDContext() + } + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API detail only for folks looking to replace the go-fed +// implementation. Applications should not use this method. +func (this GoToSocialCanAnnouncePropertyIterator) KindIndex() int { + if this.IsGoToSocialCanAnnounce() { + return 0 + } + if this.IsIRI() { + return -2 + } + return -1 +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialCanAnnouncePropertyIterator) LessThan(o vocab.GoToSocialCanAnnouncePropertyIterator) bool { + // LessThan comparison for if either or both are IRIs. + if this.IsIRI() && o.IsIRI() { + return this.iri.String() < o.GetIRI().String() + } else if this.IsIRI() { + // IRIs are always less than other values, none, or unknowns + return true + } else if o.IsIRI() { + // This other, none, or unknown value is always greater than IRIs + return false + } + // LessThan comparison for the single value or unknown value. + if !this.IsGoToSocialCanAnnounce() && !o.IsGoToSocialCanAnnounce() { + // Both are unknowns. + return false + } else if this.IsGoToSocialCanAnnounce() && !o.IsGoToSocialCanAnnounce() { + // Values are always greater than unknown values. + return false + } else if !this.IsGoToSocialCanAnnounce() && o.IsGoToSocialCanAnnounce() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return this.Get().LessThan(o.Get()) + } +} + +// Name returns the name of this property: "GoToSocialCanAnnounce". +func (this GoToSocialCanAnnouncePropertyIterator) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "GoToSocialCanAnnounce" + } else { + return "GoToSocialCanAnnounce" + } +} + +// Next returns the next iterator, or nil if there is no next iterator. +func (this GoToSocialCanAnnouncePropertyIterator) Next() vocab.GoToSocialCanAnnouncePropertyIterator { + if this.myIdx+1 >= this.parent.Len() { + return nil + } else { + return this.parent.At(this.myIdx + 1) + } +} + +// Prev returns the previous iterator, or nil if there is no previous iterator. +func (this GoToSocialCanAnnouncePropertyIterator) Prev() vocab.GoToSocialCanAnnouncePropertyIterator { + if this.myIdx-1 < 0 { + return nil + } else { + return this.parent.At(this.myIdx - 1) + } +} + +// Set sets the value of this property. Calling IsGoToSocialCanAnnounce afterwards +// will return true. +func (this *GoToSocialCanAnnouncePropertyIterator) Set(v vocab.GoToSocialCanAnnounce) { + this.clear() + this.gotosocialCanAnnounceMember = v +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *GoToSocialCanAnnouncePropertyIterator) SetIRI(v *url.URL) { + this.clear() + this.iri = v +} + +// SetType attempts to set the property for the arbitrary type. Returns an error +// if it is not a valid type to set on this property. +func (this *GoToSocialCanAnnouncePropertyIterator) SetType(t vocab.Type) error { + if v, ok := t.(vocab.GoToSocialCanAnnounce); ok { + this.Set(v) + return nil + } + + return fmt.Errorf("illegal type to set on GoToSocialCanAnnounce property: %T", t) +} + +// clear ensures no value of this property is set. Calling IsGoToSocialCanAnnounce +// afterwards will return false. +func (this *GoToSocialCanAnnouncePropertyIterator) clear() { + this.unknown = nil + this.iri = nil + this.gotosocialCanAnnounceMember = nil +} + +// serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialCanAnnouncePropertyIterator) serialize() (interface{}, error) { + if this.IsGoToSocialCanAnnounce() { + return this.Get().Serialize() + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// GoToSocialCanAnnounceProperty is the non-functional property "canAnnounce". It +// is permitted to have one or more values, and of different value types. +type GoToSocialCanAnnounceProperty struct { + properties []*GoToSocialCanAnnouncePropertyIterator + alias string +} + +// DeserializeCanAnnounceProperty creates a "canAnnounce" property from an +// interface representation that has been unmarshalled from a text or binary +// format. +func DeserializeCanAnnounceProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialCanAnnounceProperty, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + propName := "canAnnounce" + if len(alias) > 0 { + propName = fmt.Sprintf("%s:%s", alias, "canAnnounce") + } + i, ok := m[propName] + + if ok { + this := &GoToSocialCanAnnounceProperty{ + alias: alias, + properties: []*GoToSocialCanAnnouncePropertyIterator{}, + } + if list, ok := i.([]interface{}); ok { + for _, iterator := range list { + if p, err := deserializeGoToSocialCanAnnouncePropertyIterator(iterator, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + } else { + if p, err := deserializeGoToSocialCanAnnouncePropertyIterator(i, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + // Set up the properties for iteration. + for idx, ele := range this.properties { + ele.parent = this + ele.myIdx = idx + } + return this, nil + } + return nil, nil +} + +// NewGoToSocialCanAnnounceProperty creates a new canAnnounce property. +func NewGoToSocialCanAnnounceProperty() *GoToSocialCanAnnounceProperty { + return &GoToSocialCanAnnounceProperty{alias: ""} +} + +// AppendGoToSocialCanAnnounce appends a CanAnnounce value to the back of a list +// of the property "canAnnounce". Invalidates iterators that are traversing +// using Prev. +func (this *GoToSocialCanAnnounceProperty) AppendGoToSocialCanAnnounce(v vocab.GoToSocialCanAnnounce) { + this.properties = append(this.properties, &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + gotosocialCanAnnounceMember: v, + myIdx: this.Len(), + parent: this, + }) +} + +// AppendIRI appends an IRI value to the back of a list of the property +// "canAnnounce" +func (this *GoToSocialCanAnnounceProperty) AppendIRI(v *url.URL) { + this.properties = append(this.properties, &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + iri: v, + myIdx: this.Len(), + parent: this, + }) +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "canAnnounce". Invalidates iterators that are traversing using +// Prev. Returns an error if the type is not a valid one to set for this +// property. +func (this *GoToSocialCanAnnounceProperty) AppendType(t vocab.Type) error { + n := &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append(this.properties, n) + return nil +} + +// At returns the property value for the specified index. Panics if the index is +// out of bounds. +func (this GoToSocialCanAnnounceProperty) At(index int) vocab.GoToSocialCanAnnouncePropertyIterator { + return this.properties[index] +} + +// Begin returns the first iterator, or nil if empty. Can be used with the +// iterator's Next method and this property's End method to iterate from front +// to back through all values. +func (this GoToSocialCanAnnounceProperty) Begin() vocab.GoToSocialCanAnnouncePropertyIterator { + if this.Empty() { + return nil + } else { + return this.properties[0] + } +} + +// Empty returns returns true if there are no elements. +func (this GoToSocialCanAnnounceProperty) Empty() bool { + return this.Len() == 0 +} + +// End returns beyond-the-last iterator, which is nil. Can be used with the +// iterator's Next method and this property's Begin method to iterate from +// front to back through all values. +func (this GoToSocialCanAnnounceProperty) End() vocab.GoToSocialCanAnnouncePropertyIterator { + return nil +} + +// InsertGoToSocialCanAnnounce inserts a CanAnnounce value at the specified index +// for a property "canAnnounce". Existing elements at that index and higher +// are shifted back once. Invalidates all iterators. +func (this *GoToSocialCanAnnounceProperty) InsertGoToSocialCanAnnounce(idx int, v vocab.GoToSocialCanAnnounce) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + gotosocialCanAnnounceMember: v, + myIdx: idx, + parent: this, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Insert inserts an IRI value at the specified index for a property +// "canAnnounce". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *GoToSocialCanAnnounceProperty) InsertIRI(idx int, v *url.URL) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + iri: v, + myIdx: idx, + parent: this, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "canAnnounce". Invalidates all iterators. Returns an error if the +// type is not a valid one to set for this property. +func (this *GoToSocialCanAnnounceProperty) InsertType(idx int, t vocab.Type) error { + n := &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = n + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } + return nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialCanAnnounceProperty) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + for _, elem := range this.properties { + child := elem.JSONLDContext() + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API method specifically needed only for alternate implementations +// for go-fed. Applications should not use this method. Panics if the index is +// out of bounds. +func (this GoToSocialCanAnnounceProperty) KindIndex(idx int) int { + return this.properties[idx].KindIndex() +} + +// Len returns the number of values that exist for the "canAnnounce" property. +func (this GoToSocialCanAnnounceProperty) Len() (length int) { + return len(this.properties) +} + +// Less computes whether another property is less than this one. Mixing types +// results in a consistent but arbitrary ordering +func (this GoToSocialCanAnnounceProperty) Less(i, j int) bool { + idx1 := this.KindIndex(i) + idx2 := this.KindIndex(j) + if idx1 < idx2 { + return true + } else if idx1 == idx2 { + if idx1 == 0 { + lhs := this.properties[i].Get() + rhs := this.properties[j].Get() + return lhs.LessThan(rhs) + } else if idx1 == -2 { + lhs := this.properties[i].GetIRI() + rhs := this.properties[j].GetIRI() + return lhs.String() < rhs.String() + } + } + return false +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialCanAnnounceProperty) LessThan(o vocab.GoToSocialCanAnnounceProperty) bool { + l1 := this.Len() + l2 := o.Len() + l := l1 + if l2 < l1 { + l = l2 + } + for i := 0; i < l; i++ { + if this.properties[i].LessThan(o.At(i)) { + return true + } else if o.At(i).LessThan(this.properties[i]) { + return false + } + } + return l1 < l2 +} + +// Name returns the name of this property ("canAnnounce") with any alias. +func (this GoToSocialCanAnnounceProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "canAnnounce" + } else { + return "canAnnounce" + } +} + +// PrependGoToSocialCanAnnounce prepends a CanAnnounce value to the front of a +// list of the property "canAnnounce". Invalidates all iterators. +func (this *GoToSocialCanAnnounceProperty) PrependGoToSocialCanAnnounce(v vocab.GoToSocialCanAnnounce) { + this.properties = append([]*GoToSocialCanAnnouncePropertyIterator{{ + alias: this.alias, + gotosocialCanAnnounceMember: v, + myIdx: 0, + parent: this, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependIRI prepends an IRI value to the front of a list of the property +// "canAnnounce". +func (this *GoToSocialCanAnnounceProperty) PrependIRI(v *url.URL) { + this.properties = append([]*GoToSocialCanAnnouncePropertyIterator{{ + alias: this.alias, + iri: v, + myIdx: 0, + parent: this, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "canAnnounce". Invalidates all iterators. Returns an error if the +// type is not a valid one to set for this property. +func (this *GoToSocialCanAnnounceProperty) PrependType(t vocab.Type) error { + n := &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + myIdx: 0, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append([]*GoToSocialCanAnnouncePropertyIterator{n}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } + return nil +} + +// Remove deletes an element at the specified index from a list of the property +// "canAnnounce", regardless of its type. Panics if the index is out of +// bounds. Invalidates all iterators. +func (this *GoToSocialCanAnnounceProperty) Remove(idx int) { + (this.properties)[idx].parent = nil + copy((this.properties)[idx:], (this.properties)[idx+1:]) + (this.properties)[len(this.properties)-1] = &GoToSocialCanAnnouncePropertyIterator{} + this.properties = (this.properties)[:len(this.properties)-1] + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialCanAnnounceProperty) Serialize() (interface{}, error) { + s := make([]interface{}, 0, len(this.properties)) + for _, iterator := range this.properties { + if b, err := iterator.serialize(); err != nil { + return s, err + } else { + s = append(s, b) + } + } + // Shortcut: if serializing one value, don't return an array -- pretty sure other Fediverse software would choke on a "type" value with array, for example. + if len(s) == 1 { + return s[0], nil + } + return s, nil +} + +// Set sets a CanAnnounce value to be at the specified index for the property +// "canAnnounce". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *GoToSocialCanAnnounceProperty) Set(idx int, v vocab.GoToSocialCanAnnounce) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + gotosocialCanAnnounceMember: v, + myIdx: idx, + parent: this, + } +} + +// SetIRI sets an IRI value to be at the specified index for the property +// "canAnnounce". Panics if the index is out of bounds. +func (this *GoToSocialCanAnnounceProperty) SetIRI(idx int, v *url.URL) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + iri: v, + myIdx: idx, + parent: this, + } +} + +// SetType sets an arbitrary type value to the specified index of the property +// "canAnnounce". Invalidates all iterators. Returns an error if the type is +// not a valid one to set for this property. Panics if the index is out of +// bounds. +func (this *GoToSocialCanAnnounceProperty) SetType(idx int, t vocab.Type) error { + n := &GoToSocialCanAnnouncePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + (this.properties)[idx] = n + return nil +} + +// Swap swaps the location of values at two indices for the "canAnnounce" property. +func (this GoToSocialCanAnnounceProperty) Swap(i, j int) { + this.properties[i], this.properties[j] = this.properties[j], this.properties[i] +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike/gen_doc.go new file mode 100644 index 000000000..8e8c79c00 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertycanlike contains the implementation for the canLike property. +// All applications are strongly encouraged to use the interface instead of +// this concrete definition. The interfaces allow applications to consume only +// the types and properties needed and be independent of the go-fed +// implementation if another alternative implementation is created. This +// package is code-generated and subject to the same license as the go-fed +// tool used to generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package propertycanlike diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike/gen_pkg.go new file mode 100644 index 000000000..d7c63bc37 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike/gen_pkg.go @@ -0,0 +1,22 @@ +// Code generated by astool. DO NOT EDIT. + +package propertycanlike + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface { + // DeserializeCanLikeGoToSocial returns the deserialization method for the + // "GoToSocialCanLike" non-functional property in the vocabulary + // "GoToSocial" + DeserializeCanLikeGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanLike, error) +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike/gen_property_gotosocial_canLike.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike/gen_property_gotosocial_canLike.go new file mode 100644 index 000000000..efeb22012 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike/gen_property_gotosocial_canLike.go @@ -0,0 +1,618 @@ +// Code generated by astool. DO NOT EDIT. + +package propertycanlike + +import ( + "fmt" + vocab "github.com/superseriousbusiness/activity/streams/vocab" + "net/url" +) + +// GoToSocialCanLikePropertyIterator is an iterator for a property. It is +// permitted to be a single nilable value type. +type GoToSocialCanLikePropertyIterator struct { + gotosocialCanLikeMember vocab.GoToSocialCanLike + unknown interface{} + iri *url.URL + alias string + myIdx int + parent vocab.GoToSocialCanLikeProperty +} + +// NewGoToSocialCanLikePropertyIterator creates a new GoToSocialCanLike property. +func NewGoToSocialCanLikePropertyIterator() *GoToSocialCanLikePropertyIterator { + return &GoToSocialCanLikePropertyIterator{alias: ""} +} + +// deserializeGoToSocialCanLikePropertyIterator creates an iterator from an +// element that has been unmarshalled from a text or binary format. +func deserializeGoToSocialCanLikePropertyIterator(i interface{}, aliasMap map[string]string) (*GoToSocialCanLikePropertyIterator, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + if s, ok := i.(string); ok { + u, err := url.Parse(s) + // If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst + // Also, if no scheme exists, don't treat it as a URL -- net/url is greedy + if err == nil && len(u.Scheme) > 0 { + this := &GoToSocialCanLikePropertyIterator{ + alias: alias, + iri: u, + } + return this, nil + } + } + if m, ok := i.(map[string]interface{}); ok { + if v, err := mgr.DeserializeCanLikeGoToSocial()(m, aliasMap); err == nil { + this := &GoToSocialCanLikePropertyIterator{ + alias: alias, + gotosocialCanLikeMember: v, + } + return this, nil + } + } + this := &GoToSocialCanLikePropertyIterator{ + alias: alias, + unknown: i, + } + return this, nil +} + +// Get returns the value of this property. When IsGoToSocialCanLike returns false, +// Get will return any arbitrary value. +func (this GoToSocialCanLikePropertyIterator) Get() vocab.GoToSocialCanLike { + return this.gotosocialCanLikeMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this GoToSocialCanLikePropertyIterator) GetIRI() *url.URL { + return this.iri +} + +// GetType returns the value in this property as a Type. Returns nil if the value +// is not an ActivityStreams type, such as an IRI or another value. +func (this GoToSocialCanLikePropertyIterator) GetType() vocab.Type { + if this.IsGoToSocialCanLike() { + return this.Get() + } + + return nil +} + +// HasAny returns true if the value or IRI is set. +func (this GoToSocialCanLikePropertyIterator) HasAny() bool { + return this.IsGoToSocialCanLike() || this.iri != nil +} + +// IsGoToSocialCanLike returns true if this property is set and not an IRI. +func (this GoToSocialCanLikePropertyIterator) IsGoToSocialCanLike() bool { + return this.gotosocialCanLikeMember != nil +} + +// IsIRI returns true if this property is an IRI. +func (this GoToSocialCanLikePropertyIterator) IsIRI() bool { + return this.iri != nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialCanLikePropertyIterator) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + var child map[string]string + if this.IsGoToSocialCanLike() { + child = this.Get().JSONLDContext() + } + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API detail only for folks looking to replace the go-fed +// implementation. Applications should not use this method. +func (this GoToSocialCanLikePropertyIterator) KindIndex() int { + if this.IsGoToSocialCanLike() { + return 0 + } + if this.IsIRI() { + return -2 + } + return -1 +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialCanLikePropertyIterator) LessThan(o vocab.GoToSocialCanLikePropertyIterator) bool { + // LessThan comparison for if either or both are IRIs. + if this.IsIRI() && o.IsIRI() { + return this.iri.String() < o.GetIRI().String() + } else if this.IsIRI() { + // IRIs are always less than other values, none, or unknowns + return true + } else if o.IsIRI() { + // This other, none, or unknown value is always greater than IRIs + return false + } + // LessThan comparison for the single value or unknown value. + if !this.IsGoToSocialCanLike() && !o.IsGoToSocialCanLike() { + // Both are unknowns. + return false + } else if this.IsGoToSocialCanLike() && !o.IsGoToSocialCanLike() { + // Values are always greater than unknown values. + return false + } else if !this.IsGoToSocialCanLike() && o.IsGoToSocialCanLike() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return this.Get().LessThan(o.Get()) + } +} + +// Name returns the name of this property: "GoToSocialCanLike". +func (this GoToSocialCanLikePropertyIterator) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "GoToSocialCanLike" + } else { + return "GoToSocialCanLike" + } +} + +// Next returns the next iterator, or nil if there is no next iterator. +func (this GoToSocialCanLikePropertyIterator) Next() vocab.GoToSocialCanLikePropertyIterator { + if this.myIdx+1 >= this.parent.Len() { + return nil + } else { + return this.parent.At(this.myIdx + 1) + } +} + +// Prev returns the previous iterator, or nil if there is no previous iterator. +func (this GoToSocialCanLikePropertyIterator) Prev() vocab.GoToSocialCanLikePropertyIterator { + if this.myIdx-1 < 0 { + return nil + } else { + return this.parent.At(this.myIdx - 1) + } +} + +// Set sets the value of this property. Calling IsGoToSocialCanLike afterwards +// will return true. +func (this *GoToSocialCanLikePropertyIterator) Set(v vocab.GoToSocialCanLike) { + this.clear() + this.gotosocialCanLikeMember = v +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *GoToSocialCanLikePropertyIterator) SetIRI(v *url.URL) { + this.clear() + this.iri = v +} + +// SetType attempts to set the property for the arbitrary type. Returns an error +// if it is not a valid type to set on this property. +func (this *GoToSocialCanLikePropertyIterator) SetType(t vocab.Type) error { + if v, ok := t.(vocab.GoToSocialCanLike); ok { + this.Set(v) + return nil + } + + return fmt.Errorf("illegal type to set on GoToSocialCanLike property: %T", t) +} + +// clear ensures no value of this property is set. Calling IsGoToSocialCanLike +// afterwards will return false. +func (this *GoToSocialCanLikePropertyIterator) clear() { + this.unknown = nil + this.iri = nil + this.gotosocialCanLikeMember = nil +} + +// serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialCanLikePropertyIterator) serialize() (interface{}, error) { + if this.IsGoToSocialCanLike() { + return this.Get().Serialize() + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// GoToSocialCanLikeProperty is the non-functional property "canLike". It is +// permitted to have one or more values, and of different value types. +type GoToSocialCanLikeProperty struct { + properties []*GoToSocialCanLikePropertyIterator + alias string +} + +// DeserializeCanLikeProperty creates a "canLike" property from an interface +// representation that has been unmarshalled from a text or binary format. +func DeserializeCanLikeProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialCanLikeProperty, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + propName := "canLike" + if len(alias) > 0 { + propName = fmt.Sprintf("%s:%s", alias, "canLike") + } + i, ok := m[propName] + + if ok { + this := &GoToSocialCanLikeProperty{ + alias: alias, + properties: []*GoToSocialCanLikePropertyIterator{}, + } + if list, ok := i.([]interface{}); ok { + for _, iterator := range list { + if p, err := deserializeGoToSocialCanLikePropertyIterator(iterator, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + } else { + if p, err := deserializeGoToSocialCanLikePropertyIterator(i, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + // Set up the properties for iteration. + for idx, ele := range this.properties { + ele.parent = this + ele.myIdx = idx + } + return this, nil + } + return nil, nil +} + +// NewGoToSocialCanLikeProperty creates a new canLike property. +func NewGoToSocialCanLikeProperty() *GoToSocialCanLikeProperty { + return &GoToSocialCanLikeProperty{alias: ""} +} + +// AppendGoToSocialCanLike appends a CanLike value to the back of a list of the +// property "canLike". Invalidates iterators that are traversing using Prev. +func (this *GoToSocialCanLikeProperty) AppendGoToSocialCanLike(v vocab.GoToSocialCanLike) { + this.properties = append(this.properties, &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + gotosocialCanLikeMember: v, + myIdx: this.Len(), + parent: this, + }) +} + +// AppendIRI appends an IRI value to the back of a list of the property "canLike" +func (this *GoToSocialCanLikeProperty) AppendIRI(v *url.URL) { + this.properties = append(this.properties, &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + iri: v, + myIdx: this.Len(), + parent: this, + }) +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "canLike". Invalidates iterators that are traversing using Prev. +// Returns an error if the type is not a valid one to set for this property. +func (this *GoToSocialCanLikeProperty) AppendType(t vocab.Type) error { + n := &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append(this.properties, n) + return nil +} + +// At returns the property value for the specified index. Panics if the index is +// out of bounds. +func (this GoToSocialCanLikeProperty) At(index int) vocab.GoToSocialCanLikePropertyIterator { + return this.properties[index] +} + +// Begin returns the first iterator, or nil if empty. Can be used with the +// iterator's Next method and this property's End method to iterate from front +// to back through all values. +func (this GoToSocialCanLikeProperty) Begin() vocab.GoToSocialCanLikePropertyIterator { + if this.Empty() { + return nil + } else { + return this.properties[0] + } +} + +// Empty returns returns true if there are no elements. +func (this GoToSocialCanLikeProperty) Empty() bool { + return this.Len() == 0 +} + +// End returns beyond-the-last iterator, which is nil. Can be used with the +// iterator's Next method and this property's Begin method to iterate from +// front to back through all values. +func (this GoToSocialCanLikeProperty) End() vocab.GoToSocialCanLikePropertyIterator { + return nil +} + +// InsertGoToSocialCanLike inserts a CanLike value at the specified index for a +// property "canLike". Existing elements at that index and higher are shifted +// back once. Invalidates all iterators. +func (this *GoToSocialCanLikeProperty) InsertGoToSocialCanLike(idx int, v vocab.GoToSocialCanLike) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + gotosocialCanLikeMember: v, + myIdx: idx, + parent: this, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Insert inserts an IRI value at the specified index for a property "canLike". +// Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *GoToSocialCanLikeProperty) InsertIRI(idx int, v *url.URL) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + iri: v, + myIdx: idx, + parent: this, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "canLike". Invalidates all iterators. Returns an error if the type +// is not a valid one to set for this property. +func (this *GoToSocialCanLikeProperty) InsertType(idx int, t vocab.Type) error { + n := &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = n + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } + return nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialCanLikeProperty) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + for _, elem := range this.properties { + child := elem.JSONLDContext() + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API method specifically needed only for alternate implementations +// for go-fed. Applications should not use this method. Panics if the index is +// out of bounds. +func (this GoToSocialCanLikeProperty) KindIndex(idx int) int { + return this.properties[idx].KindIndex() +} + +// Len returns the number of values that exist for the "canLike" property. +func (this GoToSocialCanLikeProperty) Len() (length int) { + return len(this.properties) +} + +// Less computes whether another property is less than this one. Mixing types +// results in a consistent but arbitrary ordering +func (this GoToSocialCanLikeProperty) Less(i, j int) bool { + idx1 := this.KindIndex(i) + idx2 := this.KindIndex(j) + if idx1 < idx2 { + return true + } else if idx1 == idx2 { + if idx1 == 0 { + lhs := this.properties[i].Get() + rhs := this.properties[j].Get() + return lhs.LessThan(rhs) + } else if idx1 == -2 { + lhs := this.properties[i].GetIRI() + rhs := this.properties[j].GetIRI() + return lhs.String() < rhs.String() + } + } + return false +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialCanLikeProperty) LessThan(o vocab.GoToSocialCanLikeProperty) bool { + l1 := this.Len() + l2 := o.Len() + l := l1 + if l2 < l1 { + l = l2 + } + for i := 0; i < l; i++ { + if this.properties[i].LessThan(o.At(i)) { + return true + } else if o.At(i).LessThan(this.properties[i]) { + return false + } + } + return l1 < l2 +} + +// Name returns the name of this property ("canLike") with any alias. +func (this GoToSocialCanLikeProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "canLike" + } else { + return "canLike" + } +} + +// PrependGoToSocialCanLike prepends a CanLike value to the front of a list of the +// property "canLike". Invalidates all iterators. +func (this *GoToSocialCanLikeProperty) PrependGoToSocialCanLike(v vocab.GoToSocialCanLike) { + this.properties = append([]*GoToSocialCanLikePropertyIterator{{ + alias: this.alias, + gotosocialCanLikeMember: v, + myIdx: 0, + parent: this, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependIRI prepends an IRI value to the front of a list of the property +// "canLike". +func (this *GoToSocialCanLikeProperty) PrependIRI(v *url.URL) { + this.properties = append([]*GoToSocialCanLikePropertyIterator{{ + alias: this.alias, + iri: v, + myIdx: 0, + parent: this, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "canLike". Invalidates all iterators. Returns an error if the type +// is not a valid one to set for this property. +func (this *GoToSocialCanLikeProperty) PrependType(t vocab.Type) error { + n := &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + myIdx: 0, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append([]*GoToSocialCanLikePropertyIterator{n}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } + return nil +} + +// Remove deletes an element at the specified index from a list of the property +// "canLike", regardless of its type. Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *GoToSocialCanLikeProperty) Remove(idx int) { + (this.properties)[idx].parent = nil + copy((this.properties)[idx:], (this.properties)[idx+1:]) + (this.properties)[len(this.properties)-1] = &GoToSocialCanLikePropertyIterator{} + this.properties = (this.properties)[:len(this.properties)-1] + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialCanLikeProperty) Serialize() (interface{}, error) { + s := make([]interface{}, 0, len(this.properties)) + for _, iterator := range this.properties { + if b, err := iterator.serialize(); err != nil { + return s, err + } else { + s = append(s, b) + } + } + // Shortcut: if serializing one value, don't return an array -- pretty sure other Fediverse software would choke on a "type" value with array, for example. + if len(s) == 1 { + return s[0], nil + } + return s, nil +} + +// Set sets a CanLike value to be at the specified index for the property +// "canLike". Panics if the index is out of bounds. Invalidates all iterators. +func (this *GoToSocialCanLikeProperty) Set(idx int, v vocab.GoToSocialCanLike) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + gotosocialCanLikeMember: v, + myIdx: idx, + parent: this, + } +} + +// SetIRI sets an IRI value to be at the specified index for the property +// "canLike". Panics if the index is out of bounds. +func (this *GoToSocialCanLikeProperty) SetIRI(idx int, v *url.URL) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + iri: v, + myIdx: idx, + parent: this, + } +} + +// SetType sets an arbitrary type value to the specified index of the property +// "canLike". Invalidates all iterators. Returns an error if the type is not a +// valid one to set for this property. Panics if the index is out of bounds. +func (this *GoToSocialCanLikeProperty) SetType(idx int, t vocab.Type) error { + n := &GoToSocialCanLikePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + (this.properties)[idx] = n + return nil +} + +// Swap swaps the location of values at two indices for the "canLike" property. +func (this GoToSocialCanLikeProperty) Swap(i, j int) { + this.properties[i], this.properties[j] = this.properties[j], this.properties[i] +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply/gen_doc.go new file mode 100644 index 000000000..0037c92ae --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertycanreply contains the implementation for the canReply property. +// All applications are strongly encouraged to use the interface instead of +// this concrete definition. The interfaces allow applications to consume only +// the types and properties needed and be independent of the go-fed +// implementation if another alternative implementation is created. This +// package is code-generated and subject to the same license as the go-fed +// tool used to generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package propertycanreply diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply/gen_pkg.go new file mode 100644 index 000000000..e4ba4ae9b --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply/gen_pkg.go @@ -0,0 +1,22 @@ +// Code generated by astool. DO NOT EDIT. + +package propertycanreply + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface { + // DeserializeCanReplyGoToSocial returns the deserialization method for + // the "GoToSocialCanReply" non-functional property in the vocabulary + // "GoToSocial" + DeserializeCanReplyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanReply, error) +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply/gen_property_gotosocial_canReply.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply/gen_property_gotosocial_canReply.go new file mode 100644 index 000000000..205563d3f --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply/gen_property_gotosocial_canReply.go @@ -0,0 +1,618 @@ +// Code generated by astool. DO NOT EDIT. + +package propertycanreply + +import ( + "fmt" + vocab "github.com/superseriousbusiness/activity/streams/vocab" + "net/url" +) + +// GoToSocialCanReplyPropertyIterator is an iterator for a property. It is +// permitted to be a single nilable value type. +type GoToSocialCanReplyPropertyIterator struct { + gotosocialCanReplyMember vocab.GoToSocialCanReply + unknown interface{} + iri *url.URL + alias string + myIdx int + parent vocab.GoToSocialCanReplyProperty +} + +// NewGoToSocialCanReplyPropertyIterator creates a new GoToSocialCanReply property. +func NewGoToSocialCanReplyPropertyIterator() *GoToSocialCanReplyPropertyIterator { + return &GoToSocialCanReplyPropertyIterator{alias: ""} +} + +// deserializeGoToSocialCanReplyPropertyIterator creates an iterator from an +// element that has been unmarshalled from a text or binary format. +func deserializeGoToSocialCanReplyPropertyIterator(i interface{}, aliasMap map[string]string) (*GoToSocialCanReplyPropertyIterator, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + if s, ok := i.(string); ok { + u, err := url.Parse(s) + // If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst + // Also, if no scheme exists, don't treat it as a URL -- net/url is greedy + if err == nil && len(u.Scheme) > 0 { + this := &GoToSocialCanReplyPropertyIterator{ + alias: alias, + iri: u, + } + return this, nil + } + } + if m, ok := i.(map[string]interface{}); ok { + if v, err := mgr.DeserializeCanReplyGoToSocial()(m, aliasMap); err == nil { + this := &GoToSocialCanReplyPropertyIterator{ + alias: alias, + gotosocialCanReplyMember: v, + } + return this, nil + } + } + this := &GoToSocialCanReplyPropertyIterator{ + alias: alias, + unknown: i, + } + return this, nil +} + +// Get returns the value of this property. When IsGoToSocialCanReply returns +// false, Get will return any arbitrary value. +func (this GoToSocialCanReplyPropertyIterator) Get() vocab.GoToSocialCanReply { + return this.gotosocialCanReplyMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this GoToSocialCanReplyPropertyIterator) GetIRI() *url.URL { + return this.iri +} + +// GetType returns the value in this property as a Type. Returns nil if the value +// is not an ActivityStreams type, such as an IRI or another value. +func (this GoToSocialCanReplyPropertyIterator) GetType() vocab.Type { + if this.IsGoToSocialCanReply() { + return this.Get() + } + + return nil +} + +// HasAny returns true if the value or IRI is set. +func (this GoToSocialCanReplyPropertyIterator) HasAny() bool { + return this.IsGoToSocialCanReply() || this.iri != nil +} + +// IsGoToSocialCanReply returns true if this property is set and not an IRI. +func (this GoToSocialCanReplyPropertyIterator) IsGoToSocialCanReply() bool { + return this.gotosocialCanReplyMember != nil +} + +// IsIRI returns true if this property is an IRI. +func (this GoToSocialCanReplyPropertyIterator) IsIRI() bool { + return this.iri != nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialCanReplyPropertyIterator) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + var child map[string]string + if this.IsGoToSocialCanReply() { + child = this.Get().JSONLDContext() + } + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API detail only for folks looking to replace the go-fed +// implementation. Applications should not use this method. +func (this GoToSocialCanReplyPropertyIterator) KindIndex() int { + if this.IsGoToSocialCanReply() { + return 0 + } + if this.IsIRI() { + return -2 + } + return -1 +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialCanReplyPropertyIterator) LessThan(o vocab.GoToSocialCanReplyPropertyIterator) bool { + // LessThan comparison for if either or both are IRIs. + if this.IsIRI() && o.IsIRI() { + return this.iri.String() < o.GetIRI().String() + } else if this.IsIRI() { + // IRIs are always less than other values, none, or unknowns + return true + } else if o.IsIRI() { + // This other, none, or unknown value is always greater than IRIs + return false + } + // LessThan comparison for the single value or unknown value. + if !this.IsGoToSocialCanReply() && !o.IsGoToSocialCanReply() { + // Both are unknowns. + return false + } else if this.IsGoToSocialCanReply() && !o.IsGoToSocialCanReply() { + // Values are always greater than unknown values. + return false + } else if !this.IsGoToSocialCanReply() && o.IsGoToSocialCanReply() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return this.Get().LessThan(o.Get()) + } +} + +// Name returns the name of this property: "GoToSocialCanReply". +func (this GoToSocialCanReplyPropertyIterator) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "GoToSocialCanReply" + } else { + return "GoToSocialCanReply" + } +} + +// Next returns the next iterator, or nil if there is no next iterator. +func (this GoToSocialCanReplyPropertyIterator) Next() vocab.GoToSocialCanReplyPropertyIterator { + if this.myIdx+1 >= this.parent.Len() { + return nil + } else { + return this.parent.At(this.myIdx + 1) + } +} + +// Prev returns the previous iterator, or nil if there is no previous iterator. +func (this GoToSocialCanReplyPropertyIterator) Prev() vocab.GoToSocialCanReplyPropertyIterator { + if this.myIdx-1 < 0 { + return nil + } else { + return this.parent.At(this.myIdx - 1) + } +} + +// Set sets the value of this property. Calling IsGoToSocialCanReply afterwards +// will return true. +func (this *GoToSocialCanReplyPropertyIterator) Set(v vocab.GoToSocialCanReply) { + this.clear() + this.gotosocialCanReplyMember = v +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *GoToSocialCanReplyPropertyIterator) SetIRI(v *url.URL) { + this.clear() + this.iri = v +} + +// SetType attempts to set the property for the arbitrary type. Returns an error +// if it is not a valid type to set on this property. +func (this *GoToSocialCanReplyPropertyIterator) SetType(t vocab.Type) error { + if v, ok := t.(vocab.GoToSocialCanReply); ok { + this.Set(v) + return nil + } + + return fmt.Errorf("illegal type to set on GoToSocialCanReply property: %T", t) +} + +// clear ensures no value of this property is set. Calling IsGoToSocialCanReply +// afterwards will return false. +func (this *GoToSocialCanReplyPropertyIterator) clear() { + this.unknown = nil + this.iri = nil + this.gotosocialCanReplyMember = nil +} + +// serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialCanReplyPropertyIterator) serialize() (interface{}, error) { + if this.IsGoToSocialCanReply() { + return this.Get().Serialize() + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// GoToSocialCanReplyProperty is the non-functional property "canReply". It is +// permitted to have one or more values, and of different value types. +type GoToSocialCanReplyProperty struct { + properties []*GoToSocialCanReplyPropertyIterator + alias string +} + +// DeserializeCanReplyProperty creates a "canReply" property from an interface +// representation that has been unmarshalled from a text or binary format. +func DeserializeCanReplyProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialCanReplyProperty, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + propName := "canReply" + if len(alias) > 0 { + propName = fmt.Sprintf("%s:%s", alias, "canReply") + } + i, ok := m[propName] + + if ok { + this := &GoToSocialCanReplyProperty{ + alias: alias, + properties: []*GoToSocialCanReplyPropertyIterator{}, + } + if list, ok := i.([]interface{}); ok { + for _, iterator := range list { + if p, err := deserializeGoToSocialCanReplyPropertyIterator(iterator, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + } else { + if p, err := deserializeGoToSocialCanReplyPropertyIterator(i, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + // Set up the properties for iteration. + for idx, ele := range this.properties { + ele.parent = this + ele.myIdx = idx + } + return this, nil + } + return nil, nil +} + +// NewGoToSocialCanReplyProperty creates a new canReply property. +func NewGoToSocialCanReplyProperty() *GoToSocialCanReplyProperty { + return &GoToSocialCanReplyProperty{alias: ""} +} + +// AppendGoToSocialCanReply appends a CanReply value to the back of a list of the +// property "canReply". Invalidates iterators that are traversing using Prev. +func (this *GoToSocialCanReplyProperty) AppendGoToSocialCanReply(v vocab.GoToSocialCanReply) { + this.properties = append(this.properties, &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + gotosocialCanReplyMember: v, + myIdx: this.Len(), + parent: this, + }) +} + +// AppendIRI appends an IRI value to the back of a list of the property "canReply" +func (this *GoToSocialCanReplyProperty) AppendIRI(v *url.URL) { + this.properties = append(this.properties, &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + iri: v, + myIdx: this.Len(), + parent: this, + }) +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "canReply". Invalidates iterators that are traversing using Prev. +// Returns an error if the type is not a valid one to set for this property. +func (this *GoToSocialCanReplyProperty) AppendType(t vocab.Type) error { + n := &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append(this.properties, n) + return nil +} + +// At returns the property value for the specified index. Panics if the index is +// out of bounds. +func (this GoToSocialCanReplyProperty) At(index int) vocab.GoToSocialCanReplyPropertyIterator { + return this.properties[index] +} + +// Begin returns the first iterator, or nil if empty. Can be used with the +// iterator's Next method and this property's End method to iterate from front +// to back through all values. +func (this GoToSocialCanReplyProperty) Begin() vocab.GoToSocialCanReplyPropertyIterator { + if this.Empty() { + return nil + } else { + return this.properties[0] + } +} + +// Empty returns returns true if there are no elements. +func (this GoToSocialCanReplyProperty) Empty() bool { + return this.Len() == 0 +} + +// End returns beyond-the-last iterator, which is nil. Can be used with the +// iterator's Next method and this property's Begin method to iterate from +// front to back through all values. +func (this GoToSocialCanReplyProperty) End() vocab.GoToSocialCanReplyPropertyIterator { + return nil +} + +// InsertGoToSocialCanReply inserts a CanReply value at the specified index for a +// property "canReply". Existing elements at that index and higher are shifted +// back once. Invalidates all iterators. +func (this *GoToSocialCanReplyProperty) InsertGoToSocialCanReply(idx int, v vocab.GoToSocialCanReply) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + gotosocialCanReplyMember: v, + myIdx: idx, + parent: this, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Insert inserts an IRI value at the specified index for a property "canReply". +// Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *GoToSocialCanReplyProperty) InsertIRI(idx int, v *url.URL) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + iri: v, + myIdx: idx, + parent: this, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "canReply". Invalidates all iterators. Returns an error if the +// type is not a valid one to set for this property. +func (this *GoToSocialCanReplyProperty) InsertType(idx int, t vocab.Type) error { + n := &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = n + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } + return nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialCanReplyProperty) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + for _, elem := range this.properties { + child := elem.JSONLDContext() + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API method specifically needed only for alternate implementations +// for go-fed. Applications should not use this method. Panics if the index is +// out of bounds. +func (this GoToSocialCanReplyProperty) KindIndex(idx int) int { + return this.properties[idx].KindIndex() +} + +// Len returns the number of values that exist for the "canReply" property. +func (this GoToSocialCanReplyProperty) Len() (length int) { + return len(this.properties) +} + +// Less computes whether another property is less than this one. Mixing types +// results in a consistent but arbitrary ordering +func (this GoToSocialCanReplyProperty) Less(i, j int) bool { + idx1 := this.KindIndex(i) + idx2 := this.KindIndex(j) + if idx1 < idx2 { + return true + } else if idx1 == idx2 { + if idx1 == 0 { + lhs := this.properties[i].Get() + rhs := this.properties[j].Get() + return lhs.LessThan(rhs) + } else if idx1 == -2 { + lhs := this.properties[i].GetIRI() + rhs := this.properties[j].GetIRI() + return lhs.String() < rhs.String() + } + } + return false +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialCanReplyProperty) LessThan(o vocab.GoToSocialCanReplyProperty) bool { + l1 := this.Len() + l2 := o.Len() + l := l1 + if l2 < l1 { + l = l2 + } + for i := 0; i < l; i++ { + if this.properties[i].LessThan(o.At(i)) { + return true + } else if o.At(i).LessThan(this.properties[i]) { + return false + } + } + return l1 < l2 +} + +// Name returns the name of this property ("canReply") with any alias. +func (this GoToSocialCanReplyProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "canReply" + } else { + return "canReply" + } +} + +// PrependGoToSocialCanReply prepends a CanReply value to the front of a list of +// the property "canReply". Invalidates all iterators. +func (this *GoToSocialCanReplyProperty) PrependGoToSocialCanReply(v vocab.GoToSocialCanReply) { + this.properties = append([]*GoToSocialCanReplyPropertyIterator{{ + alias: this.alias, + gotosocialCanReplyMember: v, + myIdx: 0, + parent: this, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependIRI prepends an IRI value to the front of a list of the property +// "canReply". +func (this *GoToSocialCanReplyProperty) PrependIRI(v *url.URL) { + this.properties = append([]*GoToSocialCanReplyPropertyIterator{{ + alias: this.alias, + iri: v, + myIdx: 0, + parent: this, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "canReply". Invalidates all iterators. Returns an error if the +// type is not a valid one to set for this property. +func (this *GoToSocialCanReplyProperty) PrependType(t vocab.Type) error { + n := &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + myIdx: 0, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append([]*GoToSocialCanReplyPropertyIterator{n}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } + return nil +} + +// Remove deletes an element at the specified index from a list of the property +// "canReply", regardless of its type. Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *GoToSocialCanReplyProperty) Remove(idx int) { + (this.properties)[idx].parent = nil + copy((this.properties)[idx:], (this.properties)[idx+1:]) + (this.properties)[len(this.properties)-1] = &GoToSocialCanReplyPropertyIterator{} + this.properties = (this.properties)[:len(this.properties)-1] + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialCanReplyProperty) Serialize() (interface{}, error) { + s := make([]interface{}, 0, len(this.properties)) + for _, iterator := range this.properties { + if b, err := iterator.serialize(); err != nil { + return s, err + } else { + s = append(s, b) + } + } + // Shortcut: if serializing one value, don't return an array -- pretty sure other Fediverse software would choke on a "type" value with array, for example. + if len(s) == 1 { + return s[0], nil + } + return s, nil +} + +// Set sets a CanReply value to be at the specified index for the property +// "canReply". Panics if the index is out of bounds. Invalidates all iterators. +func (this *GoToSocialCanReplyProperty) Set(idx int, v vocab.GoToSocialCanReply) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + gotosocialCanReplyMember: v, + myIdx: idx, + parent: this, + } +} + +// SetIRI sets an IRI value to be at the specified index for the property +// "canReply". Panics if the index is out of bounds. +func (this *GoToSocialCanReplyProperty) SetIRI(idx int, v *url.URL) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + iri: v, + myIdx: idx, + parent: this, + } +} + +// SetType sets an arbitrary type value to the specified index of the property +// "canReply". Invalidates all iterators. Returns an error if the type is not +// a valid one to set for this property. Panics if the index is out of bounds. +func (this *GoToSocialCanReplyProperty) SetType(idx int, t vocab.Type) error { + n := &GoToSocialCanReplyPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + (this.properties)[idx] = n + return nil +} + +// Swap swaps the location of values at two indices for the "canReply" property. +func (this GoToSocialCanReplyProperty) Swap(i, j int) { + this.properties[i], this.properties[j] = this.properties[j], this.properties[i] +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy/gen_doc.go new file mode 100644 index 000000000..a5ccea8ad --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertyinteractionpolicy contains the implementation for the +// interactionPolicy property. All applications are strongly encouraged to use +// the interface instead of this concrete definition. The interfaces allow +// applications to consume only the types and properties needed and be +// independent of the go-fed implementation if another alternative +// implementation is created. This package is code-generated and subject to +// the same license as the go-fed tool used to generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package propertyinteractionpolicy diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy/gen_pkg.go new file mode 100644 index 000000000..145474ffa --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy/gen_pkg.go @@ -0,0 +1,22 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyinteractionpolicy + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface { + // DeserializeInteractionPolicyGoToSocial returns the deserialization + // method for the "GoToSocialInteractionPolicy" non-functional + // property in the vocabulary "GoToSocial" + DeserializeInteractionPolicyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicy, error) +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy/gen_property_gotosocial_interactionPolicy.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy/gen_property_gotosocial_interactionPolicy.go new file mode 100644 index 000000000..e541b34f5 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy/gen_property_gotosocial_interactionPolicy.go @@ -0,0 +1,630 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyinteractionpolicy + +import ( + "fmt" + vocab "github.com/superseriousbusiness/activity/streams/vocab" + "net/url" +) + +// GoToSocialInteractionPolicyPropertyIterator is an iterator for a property. It +// is permitted to be a single nilable value type. +type GoToSocialInteractionPolicyPropertyIterator struct { + gotosocialInteractionPolicyMember vocab.GoToSocialInteractionPolicy + unknown interface{} + iri *url.URL + alias string + myIdx int + parent vocab.GoToSocialInteractionPolicyProperty +} + +// NewGoToSocialInteractionPolicyPropertyIterator creates a new +// GoToSocialInteractionPolicy property. +func NewGoToSocialInteractionPolicyPropertyIterator() *GoToSocialInteractionPolicyPropertyIterator { + return &GoToSocialInteractionPolicyPropertyIterator{alias: ""} +} + +// deserializeGoToSocialInteractionPolicyPropertyIterator creates an iterator from +// an element that has been unmarshalled from a text or binary format. +func deserializeGoToSocialInteractionPolicyPropertyIterator(i interface{}, aliasMap map[string]string) (*GoToSocialInteractionPolicyPropertyIterator, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + if s, ok := i.(string); ok { + u, err := url.Parse(s) + // If error exists, don't error out -- skip this and treat as unknown string ([]byte) at worst + // Also, if no scheme exists, don't treat it as a URL -- net/url is greedy + if err == nil && len(u.Scheme) > 0 { + this := &GoToSocialInteractionPolicyPropertyIterator{ + alias: alias, + iri: u, + } + return this, nil + } + } + if m, ok := i.(map[string]interface{}); ok { + if v, err := mgr.DeserializeInteractionPolicyGoToSocial()(m, aliasMap); err == nil { + this := &GoToSocialInteractionPolicyPropertyIterator{ + alias: alias, + gotosocialInteractionPolicyMember: v, + } + return this, nil + } + } + this := &GoToSocialInteractionPolicyPropertyIterator{ + alias: alias, + unknown: i, + } + return this, nil +} + +// Get returns the value of this property. When IsGoToSocialInteractionPolicy +// returns false, Get will return any arbitrary value. +func (this GoToSocialInteractionPolicyPropertyIterator) Get() vocab.GoToSocialInteractionPolicy { + return this.gotosocialInteractionPolicyMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this GoToSocialInteractionPolicyPropertyIterator) GetIRI() *url.URL { + return this.iri +} + +// GetType returns the value in this property as a Type. Returns nil if the value +// is not an ActivityStreams type, such as an IRI or another value. +func (this GoToSocialInteractionPolicyPropertyIterator) GetType() vocab.Type { + if this.IsGoToSocialInteractionPolicy() { + return this.Get() + } + + return nil +} + +// HasAny returns true if the value or IRI is set. +func (this GoToSocialInteractionPolicyPropertyIterator) HasAny() bool { + return this.IsGoToSocialInteractionPolicy() || this.iri != nil +} + +// IsGoToSocialInteractionPolicy returns true if this property is set and not an +// IRI. +func (this GoToSocialInteractionPolicyPropertyIterator) IsGoToSocialInteractionPolicy() bool { + return this.gotosocialInteractionPolicyMember != nil +} + +// IsIRI returns true if this property is an IRI. +func (this GoToSocialInteractionPolicyPropertyIterator) IsIRI() bool { + return this.iri != nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialInteractionPolicyPropertyIterator) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + var child map[string]string + if this.IsGoToSocialInteractionPolicy() { + child = this.Get().JSONLDContext() + } + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API detail only for folks looking to replace the go-fed +// implementation. Applications should not use this method. +func (this GoToSocialInteractionPolicyPropertyIterator) KindIndex() int { + if this.IsGoToSocialInteractionPolicy() { + return 0 + } + if this.IsIRI() { + return -2 + } + return -1 +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialInteractionPolicyPropertyIterator) LessThan(o vocab.GoToSocialInteractionPolicyPropertyIterator) bool { + // LessThan comparison for if either or both are IRIs. + if this.IsIRI() && o.IsIRI() { + return this.iri.String() < o.GetIRI().String() + } else if this.IsIRI() { + // IRIs are always less than other values, none, or unknowns + return true + } else if o.IsIRI() { + // This other, none, or unknown value is always greater than IRIs + return false + } + // LessThan comparison for the single value or unknown value. + if !this.IsGoToSocialInteractionPolicy() && !o.IsGoToSocialInteractionPolicy() { + // Both are unknowns. + return false + } else if this.IsGoToSocialInteractionPolicy() && !o.IsGoToSocialInteractionPolicy() { + // Values are always greater than unknown values. + return false + } else if !this.IsGoToSocialInteractionPolicy() && o.IsGoToSocialInteractionPolicy() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return this.Get().LessThan(o.Get()) + } +} + +// Name returns the name of this property: "GoToSocialInteractionPolicy". +func (this GoToSocialInteractionPolicyPropertyIterator) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "GoToSocialInteractionPolicy" + } else { + return "GoToSocialInteractionPolicy" + } +} + +// Next returns the next iterator, or nil if there is no next iterator. +func (this GoToSocialInteractionPolicyPropertyIterator) Next() vocab.GoToSocialInteractionPolicyPropertyIterator { + if this.myIdx+1 >= this.parent.Len() { + return nil + } else { + return this.parent.At(this.myIdx + 1) + } +} + +// Prev returns the previous iterator, or nil if there is no previous iterator. +func (this GoToSocialInteractionPolicyPropertyIterator) Prev() vocab.GoToSocialInteractionPolicyPropertyIterator { + if this.myIdx-1 < 0 { + return nil + } else { + return this.parent.At(this.myIdx - 1) + } +} + +// Set sets the value of this property. Calling IsGoToSocialInteractionPolicy +// afterwards will return true. +func (this *GoToSocialInteractionPolicyPropertyIterator) Set(v vocab.GoToSocialInteractionPolicy) { + this.clear() + this.gotosocialInteractionPolicyMember = v +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *GoToSocialInteractionPolicyPropertyIterator) SetIRI(v *url.URL) { + this.clear() + this.iri = v +} + +// SetType attempts to set the property for the arbitrary type. Returns an error +// if it is not a valid type to set on this property. +func (this *GoToSocialInteractionPolicyPropertyIterator) SetType(t vocab.Type) error { + if v, ok := t.(vocab.GoToSocialInteractionPolicy); ok { + this.Set(v) + return nil + } + + return fmt.Errorf("illegal type to set on GoToSocialInteractionPolicy property: %T", t) +} + +// clear ensures no value of this property is set. Calling +// IsGoToSocialInteractionPolicy afterwards will return false. +func (this *GoToSocialInteractionPolicyPropertyIterator) clear() { + this.unknown = nil + this.iri = nil + this.gotosocialInteractionPolicyMember = nil +} + +// serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialInteractionPolicyPropertyIterator) serialize() (interface{}, error) { + if this.IsGoToSocialInteractionPolicy() { + return this.Get().Serialize() + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// GoToSocialInteractionPolicyProperty is the non-functional property +// "interactionPolicy". It is permitted to have one or more values, and of +// different value types. +type GoToSocialInteractionPolicyProperty struct { + properties []*GoToSocialInteractionPolicyPropertyIterator + alias string +} + +// DeserializeInteractionPolicyProperty creates a "interactionPolicy" property +// from an interface representation that has been unmarshalled from a text or +// binary format. +func DeserializeInteractionPolicyProperty(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + propName := "interactionPolicy" + if len(alias) > 0 { + propName = fmt.Sprintf("%s:%s", alias, "interactionPolicy") + } + i, ok := m[propName] + + if ok { + this := &GoToSocialInteractionPolicyProperty{ + alias: alias, + properties: []*GoToSocialInteractionPolicyPropertyIterator{}, + } + if list, ok := i.([]interface{}); ok { + for _, iterator := range list { + if p, err := deserializeGoToSocialInteractionPolicyPropertyIterator(iterator, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + } else { + if p, err := deserializeGoToSocialInteractionPolicyPropertyIterator(i, aliasMap); err != nil { + return this, err + } else if p != nil { + this.properties = append(this.properties, p) + } + } + // Set up the properties for iteration. + for idx, ele := range this.properties { + ele.parent = this + ele.myIdx = idx + } + return this, nil + } + return nil, nil +} + +// NewGoToSocialInteractionPolicyProperty creates a new interactionPolicy property. +func NewGoToSocialInteractionPolicyProperty() *GoToSocialInteractionPolicyProperty { + return &GoToSocialInteractionPolicyProperty{alias: ""} +} + +// AppendGoToSocialInteractionPolicy appends a InteractionPolicy value to the back +// of a list of the property "interactionPolicy". Invalidates iterators that +// are traversing using Prev. +func (this *GoToSocialInteractionPolicyProperty) AppendGoToSocialInteractionPolicy(v vocab.GoToSocialInteractionPolicy) { + this.properties = append(this.properties, &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + gotosocialInteractionPolicyMember: v, + myIdx: this.Len(), + parent: this, + }) +} + +// AppendIRI appends an IRI value to the back of a list of the property +// "interactionPolicy" +func (this *GoToSocialInteractionPolicyProperty) AppendIRI(v *url.URL) { + this.properties = append(this.properties, &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + iri: v, + myIdx: this.Len(), + parent: this, + }) +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "interactionPolicy". Invalidates iterators that are traversing +// using Prev. Returns an error if the type is not a valid one to set for this +// property. +func (this *GoToSocialInteractionPolicyProperty) AppendType(t vocab.Type) error { + n := &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append(this.properties, n) + return nil +} + +// At returns the property value for the specified index. Panics if the index is +// out of bounds. +func (this GoToSocialInteractionPolicyProperty) At(index int) vocab.GoToSocialInteractionPolicyPropertyIterator { + return this.properties[index] +} + +// Begin returns the first iterator, or nil if empty. Can be used with the +// iterator's Next method and this property's End method to iterate from front +// to back through all values. +func (this GoToSocialInteractionPolicyProperty) Begin() vocab.GoToSocialInteractionPolicyPropertyIterator { + if this.Empty() { + return nil + } else { + return this.properties[0] + } +} + +// Empty returns returns true if there are no elements. +func (this GoToSocialInteractionPolicyProperty) Empty() bool { + return this.Len() == 0 +} + +// End returns beyond-the-last iterator, which is nil. Can be used with the +// iterator's Next method and this property's Begin method to iterate from +// front to back through all values. +func (this GoToSocialInteractionPolicyProperty) End() vocab.GoToSocialInteractionPolicyPropertyIterator { + return nil +} + +// InsertGoToSocialInteractionPolicy inserts a InteractionPolicy value at the +// specified index for a property "interactionPolicy". Existing elements at +// that index and higher are shifted back once. Invalidates all iterators. +func (this *GoToSocialInteractionPolicyProperty) InsertGoToSocialInteractionPolicy(idx int, v vocab.GoToSocialInteractionPolicy) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + gotosocialInteractionPolicyMember: v, + myIdx: idx, + parent: this, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Insert inserts an IRI value at the specified index for a property +// "interactionPolicy". Existing elements at that index and higher are shifted +// back once. Invalidates all iterators. +func (this *GoToSocialInteractionPolicyProperty) InsertIRI(idx int, v *url.URL) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + iri: v, + myIdx: idx, + parent: this, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "interactionPolicy". Invalidates all iterators. Returns an error +// if the type is not a valid one to set for this property. +func (this *GoToSocialInteractionPolicyProperty) InsertType(idx int, t vocab.Type) error { + n := &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = n + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } + return nil +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// property and the specific values that are set. The value in the map is the +// alias used to import the property's value or values. +func (this GoToSocialInteractionPolicyProperty) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + for _, elem := range this.properties { + child := elem.JSONLDContext() + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + for k, v := range child { + m[k] = v + } + } + return m +} + +// KindIndex computes an arbitrary value for indexing this kind of value. This is +// a leaky API method specifically needed only for alternate implementations +// for go-fed. Applications should not use this method. Panics if the index is +// out of bounds. +func (this GoToSocialInteractionPolicyProperty) KindIndex(idx int) int { + return this.properties[idx].KindIndex() +} + +// Len returns the number of values that exist for the "interactionPolicy" +// property. +func (this GoToSocialInteractionPolicyProperty) Len() (length int) { + return len(this.properties) +} + +// Less computes whether another property is less than this one. Mixing types +// results in a consistent but arbitrary ordering +func (this GoToSocialInteractionPolicyProperty) Less(i, j int) bool { + idx1 := this.KindIndex(i) + idx2 := this.KindIndex(j) + if idx1 < idx2 { + return true + } else if idx1 == idx2 { + if idx1 == 0 { + lhs := this.properties[i].Get() + rhs := this.properties[j].Get() + return lhs.LessThan(rhs) + } else if idx1 == -2 { + lhs := this.properties[i].GetIRI() + rhs := this.properties[j].GetIRI() + return lhs.String() < rhs.String() + } + } + return false +} + +// LessThan compares two instances of this property with an arbitrary but stable +// comparison. Applications should not use this because it is only meant to +// help alternative implementations to go-fed to be able to normalize +// nonfunctional properties. +func (this GoToSocialInteractionPolicyProperty) LessThan(o vocab.GoToSocialInteractionPolicyProperty) bool { + l1 := this.Len() + l2 := o.Len() + l := l1 + if l2 < l1 { + l = l2 + } + for i := 0; i < l; i++ { + if this.properties[i].LessThan(o.At(i)) { + return true + } else if o.At(i).LessThan(this.properties[i]) { + return false + } + } + return l1 < l2 +} + +// Name returns the name of this property ("interactionPolicy") with any alias. +func (this GoToSocialInteractionPolicyProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "interactionPolicy" + } else { + return "interactionPolicy" + } +} + +// PrependGoToSocialInteractionPolicy prepends a InteractionPolicy value to the +// front of a list of the property "interactionPolicy". Invalidates all +// iterators. +func (this *GoToSocialInteractionPolicyProperty) PrependGoToSocialInteractionPolicy(v vocab.GoToSocialInteractionPolicy) { + this.properties = append([]*GoToSocialInteractionPolicyPropertyIterator{{ + alias: this.alias, + gotosocialInteractionPolicyMember: v, + myIdx: 0, + parent: this, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependIRI prepends an IRI value to the front of a list of the property +// "interactionPolicy". +func (this *GoToSocialInteractionPolicyProperty) PrependIRI(v *url.URL) { + this.properties = append([]*GoToSocialInteractionPolicyPropertyIterator{{ + alias: this.alias, + iri: v, + myIdx: 0, + parent: this, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependType prepends an arbitrary type value to the front of a list of the +// property "interactionPolicy". Invalidates all iterators. Returns an error +// if the type is not a valid one to set for this property. +func (this *GoToSocialInteractionPolicyProperty) PrependType(t vocab.Type) error { + n := &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + myIdx: 0, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + this.properties = append([]*GoToSocialInteractionPolicyPropertyIterator{n}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } + return nil +} + +// Remove deletes an element at the specified index from a list of the property +// "interactionPolicy", regardless of its type. Panics if the index is out of +// bounds. Invalidates all iterators. +func (this *GoToSocialInteractionPolicyProperty) Remove(idx int) { + (this.properties)[idx].parent = nil + copy((this.properties)[idx:], (this.properties)[idx+1:]) + (this.properties)[len(this.properties)-1] = &GoToSocialInteractionPolicyPropertyIterator{} + this.properties = (this.properties)[:len(this.properties)-1] + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. Applications should not need this +// function as most typical use cases serialize types instead of individual +// properties. It is exposed for alternatives to go-fed implementations to use. +func (this GoToSocialInteractionPolicyProperty) Serialize() (interface{}, error) { + s := make([]interface{}, 0, len(this.properties)) + for _, iterator := range this.properties { + if b, err := iterator.serialize(); err != nil { + return s, err + } else { + s = append(s, b) + } + } + // Shortcut: if serializing one value, don't return an array -- pretty sure other Fediverse software would choke on a "type" value with array, for example. + if len(s) == 1 { + return s[0], nil + } + return s, nil +} + +// Set sets a InteractionPolicy value to be at the specified index for the +// property "interactionPolicy". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *GoToSocialInteractionPolicyProperty) Set(idx int, v vocab.GoToSocialInteractionPolicy) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + gotosocialInteractionPolicyMember: v, + myIdx: idx, + parent: this, + } +} + +// SetIRI sets an IRI value to be at the specified index for the property +// "interactionPolicy". Panics if the index is out of bounds. +func (this *GoToSocialInteractionPolicyProperty) SetIRI(idx int, v *url.URL) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + iri: v, + myIdx: idx, + parent: this, + } +} + +// SetType sets an arbitrary type value to the specified index of the property +// "interactionPolicy". Invalidates all iterators. Returns an error if the +// type is not a valid one to set for this property. Panics if the index is +// out of bounds. +func (this *GoToSocialInteractionPolicyProperty) SetType(idx int, t vocab.Type) error { + n := &GoToSocialInteractionPolicyPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + } + if err := n.SetType(t); err != nil { + return err + } + (this.properties)[idx] = n + return nil +} + +// Swap swaps the location of values at two indices for the "interactionPolicy" +// property. +func (this GoToSocialInteractionPolicyProperty) Swap(i, j int) { + this.properties[i], this.properties[j] = this.properties[j], this.properties[i] +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce/gen_doc.go new file mode 100644 index 000000000..f145bc742 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package typecanannounce contains the implementation for the CanAnnounce type. +// All applications are strongly encouraged to use the interface instead of +// this concrete definition. The interfaces allow applications to consume only +// the types and properties needed and be independent of the go-fed +// implementation if another alternative implementation is created. This +// package is code-generated and subject to the same license as the go-fed +// tool used to generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package typecanannounce diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce/gen_pkg.go new file mode 100644 index 000000000..a20526e50 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce/gen_pkg.go @@ -0,0 +1,54 @@ +// Code generated by astool. DO NOT EDIT. + +package typecanannounce + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +var mgr privateManager + +var typePropertyConstructor func() vocab.JSONLDTypeProperty + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface { + // DeserializeAlwaysPropertyGoToSocial returns the deserialization method + // for the "GoToSocialAlwaysProperty" non-functional property in the + // vocabulary "GoToSocial" + DeserializeAlwaysPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialAlwaysProperty, error) + // DeserializeApprovalRequiredPropertyGoToSocial returns the + // deserialization method for the "GoToSocialApprovalRequiredProperty" + // non-functional property in the vocabulary "GoToSocial" + DeserializeApprovalRequiredPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovalRequiredProperty, error) + // DeserializeIdPropertyJSONLD returns the deserialization method for the + // "JSONLDIdProperty" non-functional property in the vocabulary + // "JSONLD" + DeserializeIdPropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDIdProperty, error) +} + +// jsonldContexter is a private interface to determine the JSON-LD contexts and +// aliases needed for functional and non-functional properties. It is a helper +// interface for this implementation. +type jsonldContexter interface { + // JSONLDContext returns the JSONLD URIs required in the context string + // for this property and the specific values that are set. The value + // in the map is the alias used to import the property's value or + // values. + JSONLDContext() map[string]string +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} + +// SetTypePropertyConstructor sets the "type" property's constructor in the +// package-global variable. For internal use only, do not use as part of +// Application behavior. Must be called at golang init time. Permits +// ActivityStreams types to correctly set their "type" property at +// construction time, so users don't have to remember to do so each time. It +// is dependency injected so other go-fed compatible implementations could +// inject their own type. +func SetTypePropertyConstructor(f func() vocab.JSONLDTypeProperty) { + typePropertyConstructor = f +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce/gen_type_gotosocial_canannounce.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce/gen_type_gotosocial_canannounce.go new file mode 100644 index 000000000..fadb70186 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce/gen_type_gotosocial_canannounce.go @@ -0,0 +1,288 @@ +// Code generated by astool. DO NOT EDIT. + +package typecanannounce + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +type GoToSocialCanAnnounce struct { + GoToSocialAlways vocab.GoToSocialAlwaysProperty + GoToSocialApprovalRequired vocab.GoToSocialApprovalRequiredProperty + JSONLDId vocab.JSONLDIdProperty + alias string + unknown map[string]interface{} +} + +// CanAnnounceIsDisjointWith returns true if the other provided type is disjoint +// with the CanAnnounce type. +func CanAnnounceIsDisjointWith(other vocab.Type) bool { + // Shortcut implementation: is not disjoint with anything. + return false +} + +// CanAnnounceIsExtendedBy returns true if the other provided type extends from +// the CanAnnounce type. Note that it returns false if the types are the same; +// see the "IsOrExtendsCanAnnounce" variant instead. +func CanAnnounceIsExtendedBy(other vocab.Type) bool { + // Shortcut implementation: is not extended by anything. + return false +} + +// DeserializeCanAnnounce creates a CanAnnounce from a map representation that has +// been unmarshalled from a text or binary format. +func DeserializeCanAnnounce(m map[string]interface{}, aliasMap map[string]string) (*GoToSocialCanAnnounce, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + this := &GoToSocialCanAnnounce{ + alias: alias, + unknown: make(map[string]interface{}), + } + + // Begin: Known property deserialization + if p, err := mgr.DeserializeAlwaysPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialAlways = p + } + if p, err := mgr.DeserializeApprovalRequiredPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovalRequired = p + } + if p, err := mgr.DeserializeIdPropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDId = p + } + // End: Known property deserialization + + // Begin: Unknown deserialization + for k, v := range m { + // Begin: Code that ensures a property name is unknown + if k == "always" { + continue + } else if k == "approvalRequired" { + continue + } else if k == "id" { + continue + } // End: Code that ensures a property name is unknown + + this.unknown[k] = v + } + // End: Unknown deserialization + + return this, nil +} + +// GoToSocialCanAnnounceExtends returns true if the CanAnnounce type extends from +// the other type. +func GoToSocialCanAnnounceExtends(other vocab.Type) bool { + // Shortcut implementation: this does not extend anything. + return false +} + +// IsOrExtendsCanAnnounce returns true if the other provided type is the +// CanAnnounce type or extends from the CanAnnounce type. +func IsOrExtendsCanAnnounce(other vocab.Type) bool { + if other.GetTypeName() == "CanAnnounce" { + return true + } + return CanAnnounceIsExtendedBy(other) +} + +// NewGoToSocialCanAnnounce creates a new CanAnnounce type +func NewGoToSocialCanAnnounce() *GoToSocialCanAnnounce { + return &GoToSocialCanAnnounce{ + alias: "", + unknown: make(map[string]interface{}), + } +} + +// GetGoToSocialAlways returns the "always" property if it exists, and nil +// otherwise. +func (this GoToSocialCanAnnounce) GetGoToSocialAlways() vocab.GoToSocialAlwaysProperty { + return this.GoToSocialAlways +} + +// GetGoToSocialApprovalRequired returns the "approvalRequired" property if it +// exists, and nil otherwise. +func (this GoToSocialCanAnnounce) GetGoToSocialApprovalRequired() vocab.GoToSocialApprovalRequiredProperty { + return this.GoToSocialApprovalRequired +} + +// GetJSONLDId returns the "id" property if it exists, and nil otherwise. +func (this GoToSocialCanAnnounce) GetJSONLDId() vocab.JSONLDIdProperty { + return this.JSONLDId +} + +// GetTypeName returns the name of this type. +func (this GoToSocialCanAnnounce) GetTypeName() string { + return "CanAnnounce" +} + +// GetUnknownProperties returns the unknown properties for the CanAnnounce type. +// Note that this should not be used by app developers. It is only used to +// help determine which implementation is LessThan the other. Developers who +// are creating a different implementation of this type's interface can use +// this method in their LessThan implementation, but routine ActivityPub +// applications should not use this to bypass the code generation tool. +func (this GoToSocialCanAnnounce) GetUnknownProperties() map[string]interface{} { + return this.unknown +} + +// IsExtending returns true if the CanAnnounce type extends from the other type. +func (this GoToSocialCanAnnounce) IsExtending(other vocab.Type) bool { + return GoToSocialCanAnnounceExtends(other) +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// type and the specific properties that are set. The value in the map is the +// alias used to import the type and its properties. +func (this GoToSocialCanAnnounce) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + m = this.helperJSONLDContext(this.GoToSocialAlways, m) + m = this.helperJSONLDContext(this.GoToSocialApprovalRequired, m) + m = this.helperJSONLDContext(this.JSONLDId, m) + + return m +} + +// LessThan computes if this CanAnnounce is lesser, with an arbitrary but stable +// determination. +func (this GoToSocialCanAnnounce) LessThan(o vocab.GoToSocialCanAnnounce) bool { + // Begin: Compare known properties + // Compare property "always" + if lhs, rhs := this.GoToSocialAlways, o.GetGoToSocialAlways(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // Compare property "approvalRequired" + if lhs, rhs := this.GoToSocialApprovalRequired, o.GetGoToSocialApprovalRequired(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // Compare property "id" + if lhs, rhs := this.JSONLDId, o.GetJSONLDId(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // End: Compare known properties + + // Begin: Compare unknown properties (only by number of them) + if len(this.unknown) < len(o.GetUnknownProperties()) { + return true + } else if len(o.GetUnknownProperties()) < len(this.unknown) { + return false + } // End: Compare unknown properties (only by number of them) + + // All properties are the same. + return false +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. +func (this GoToSocialCanAnnounce) Serialize() (map[string]interface{}, error) { + m := make(map[string]interface{}) + // Begin: Serialize known properties + // Maybe serialize property "always" + if this.GoToSocialAlways != nil { + if i, err := this.GoToSocialAlways.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialAlways.Name()] = i + } + } + // Maybe serialize property "approvalRequired" + if this.GoToSocialApprovalRequired != nil { + if i, err := this.GoToSocialApprovalRequired.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovalRequired.Name()] = i + } + } + // Maybe serialize property "id" + if this.JSONLDId != nil { + if i, err := this.JSONLDId.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.JSONLDId.Name()] = i + } + } + // End: Serialize known properties + + // Begin: Serialize unknown properties + for k, v := range this.unknown { + // To be safe, ensure we aren't overwriting a known property + if _, has := m[k]; !has { + m[k] = v + } + } + // End: Serialize unknown properties + + return m, nil +} + +// SetGoToSocialAlways sets the "always" property. +func (this *GoToSocialCanAnnounce) SetGoToSocialAlways(i vocab.GoToSocialAlwaysProperty) { + this.GoToSocialAlways = i +} + +// SetGoToSocialApprovalRequired sets the "approvalRequired" property. +func (this *GoToSocialCanAnnounce) SetGoToSocialApprovalRequired(i vocab.GoToSocialApprovalRequiredProperty) { + this.GoToSocialApprovalRequired = i +} + +// SetJSONLDId sets the "id" property. +func (this *GoToSocialCanAnnounce) SetJSONLDId(i vocab.JSONLDIdProperty) { + this.JSONLDId = i +} + +// VocabularyURI returns the vocabulary's URI as a string. +func (this GoToSocialCanAnnounce) VocabularyURI() string { + return "https://gotosocial.org/ns" +} + +// helperJSONLDContext obtains the context uris and their aliases from a property, +// if it is not nil. +func (this GoToSocialCanAnnounce) helperJSONLDContext(i jsonldContexter, toMerge map[string]string) map[string]string { + if i == nil { + return toMerge + } + for k, v := range i.JSONLDContext() { + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + toMerge[k] = v + } + return toMerge +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike/gen_doc.go new file mode 100644 index 000000000..c539c37d4 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package typecanlike contains the implementation for the CanLike type. All +// applications are strongly encouraged to use the interface instead of this +// concrete definition. The interfaces allow applications to consume only the +// types and properties needed and be independent of the go-fed implementation +// if another alternative implementation is created. This package is +// code-generated and subject to the same license as the go-fed tool used to +// generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package typecanlike diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike/gen_pkg.go new file mode 100644 index 000000000..d7f3997bf --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike/gen_pkg.go @@ -0,0 +1,54 @@ +// Code generated by astool. DO NOT EDIT. + +package typecanlike + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +var mgr privateManager + +var typePropertyConstructor func() vocab.JSONLDTypeProperty + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface { + // DeserializeAlwaysPropertyGoToSocial returns the deserialization method + // for the "GoToSocialAlwaysProperty" non-functional property in the + // vocabulary "GoToSocial" + DeserializeAlwaysPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialAlwaysProperty, error) + // DeserializeApprovalRequiredPropertyGoToSocial returns the + // deserialization method for the "GoToSocialApprovalRequiredProperty" + // non-functional property in the vocabulary "GoToSocial" + DeserializeApprovalRequiredPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovalRequiredProperty, error) + // DeserializeIdPropertyJSONLD returns the deserialization method for the + // "JSONLDIdProperty" non-functional property in the vocabulary + // "JSONLD" + DeserializeIdPropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDIdProperty, error) +} + +// jsonldContexter is a private interface to determine the JSON-LD contexts and +// aliases needed for functional and non-functional properties. It is a helper +// interface for this implementation. +type jsonldContexter interface { + // JSONLDContext returns the JSONLD URIs required in the context string + // for this property and the specific values that are set. The value + // in the map is the alias used to import the property's value or + // values. + JSONLDContext() map[string]string +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} + +// SetTypePropertyConstructor sets the "type" property's constructor in the +// package-global variable. For internal use only, do not use as part of +// Application behavior. Must be called at golang init time. Permits +// ActivityStreams types to correctly set their "type" property at +// construction time, so users don't have to remember to do so each time. It +// is dependency injected so other go-fed compatible implementations could +// inject their own type. +func SetTypePropertyConstructor(f func() vocab.JSONLDTypeProperty) { + typePropertyConstructor = f +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike/gen_type_gotosocial_canlike.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike/gen_type_gotosocial_canlike.go new file mode 100644 index 000000000..899011380 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike/gen_type_gotosocial_canlike.go @@ -0,0 +1,288 @@ +// Code generated by astool. DO NOT EDIT. + +package typecanlike + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +type GoToSocialCanLike struct { + GoToSocialAlways vocab.GoToSocialAlwaysProperty + GoToSocialApprovalRequired vocab.GoToSocialApprovalRequiredProperty + JSONLDId vocab.JSONLDIdProperty + alias string + unknown map[string]interface{} +} + +// CanLikeIsDisjointWith returns true if the other provided type is disjoint with +// the CanLike type. +func CanLikeIsDisjointWith(other vocab.Type) bool { + // Shortcut implementation: is not disjoint with anything. + return false +} + +// CanLikeIsExtendedBy returns true if the other provided type extends from the +// CanLike type. Note that it returns false if the types are the same; see the +// "IsOrExtendsCanLike" variant instead. +func CanLikeIsExtendedBy(other vocab.Type) bool { + // Shortcut implementation: is not extended by anything. + return false +} + +// DeserializeCanLike creates a CanLike from a map representation that has been +// unmarshalled from a text or binary format. +func DeserializeCanLike(m map[string]interface{}, aliasMap map[string]string) (*GoToSocialCanLike, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + this := &GoToSocialCanLike{ + alias: alias, + unknown: make(map[string]interface{}), + } + + // Begin: Known property deserialization + if p, err := mgr.DeserializeAlwaysPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialAlways = p + } + if p, err := mgr.DeserializeApprovalRequiredPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovalRequired = p + } + if p, err := mgr.DeserializeIdPropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDId = p + } + // End: Known property deserialization + + // Begin: Unknown deserialization + for k, v := range m { + // Begin: Code that ensures a property name is unknown + if k == "always" { + continue + } else if k == "approvalRequired" { + continue + } else if k == "id" { + continue + } // End: Code that ensures a property name is unknown + + this.unknown[k] = v + } + // End: Unknown deserialization + + return this, nil +} + +// GoToSocialCanLikeExtends returns true if the CanLike type extends from the +// other type. +func GoToSocialCanLikeExtends(other vocab.Type) bool { + // Shortcut implementation: this does not extend anything. + return false +} + +// IsOrExtendsCanLike returns true if the other provided type is the CanLike type +// or extends from the CanLike type. +func IsOrExtendsCanLike(other vocab.Type) bool { + if other.GetTypeName() == "CanLike" { + return true + } + return CanLikeIsExtendedBy(other) +} + +// NewGoToSocialCanLike creates a new CanLike type +func NewGoToSocialCanLike() *GoToSocialCanLike { + return &GoToSocialCanLike{ + alias: "", + unknown: make(map[string]interface{}), + } +} + +// GetGoToSocialAlways returns the "always" property if it exists, and nil +// otherwise. +func (this GoToSocialCanLike) GetGoToSocialAlways() vocab.GoToSocialAlwaysProperty { + return this.GoToSocialAlways +} + +// GetGoToSocialApprovalRequired returns the "approvalRequired" property if it +// exists, and nil otherwise. +func (this GoToSocialCanLike) GetGoToSocialApprovalRequired() vocab.GoToSocialApprovalRequiredProperty { + return this.GoToSocialApprovalRequired +} + +// GetJSONLDId returns the "id" property if it exists, and nil otherwise. +func (this GoToSocialCanLike) GetJSONLDId() vocab.JSONLDIdProperty { + return this.JSONLDId +} + +// GetTypeName returns the name of this type. +func (this GoToSocialCanLike) GetTypeName() string { + return "CanLike" +} + +// GetUnknownProperties returns the unknown properties for the CanLike type. Note +// that this should not be used by app developers. It is only used to help +// determine which implementation is LessThan the other. Developers who are +// creating a different implementation of this type's interface can use this +// method in their LessThan implementation, but routine ActivityPub +// applications should not use this to bypass the code generation tool. +func (this GoToSocialCanLike) GetUnknownProperties() map[string]interface{} { + return this.unknown +} + +// IsExtending returns true if the CanLike type extends from the other type. +func (this GoToSocialCanLike) IsExtending(other vocab.Type) bool { + return GoToSocialCanLikeExtends(other) +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// type and the specific properties that are set. The value in the map is the +// alias used to import the type and its properties. +func (this GoToSocialCanLike) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + m = this.helperJSONLDContext(this.GoToSocialAlways, m) + m = this.helperJSONLDContext(this.GoToSocialApprovalRequired, m) + m = this.helperJSONLDContext(this.JSONLDId, m) + + return m +} + +// LessThan computes if this CanLike is lesser, with an arbitrary but stable +// determination. +func (this GoToSocialCanLike) LessThan(o vocab.GoToSocialCanLike) bool { + // Begin: Compare known properties + // Compare property "always" + if lhs, rhs := this.GoToSocialAlways, o.GetGoToSocialAlways(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // Compare property "approvalRequired" + if lhs, rhs := this.GoToSocialApprovalRequired, o.GetGoToSocialApprovalRequired(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // Compare property "id" + if lhs, rhs := this.JSONLDId, o.GetJSONLDId(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // End: Compare known properties + + // Begin: Compare unknown properties (only by number of them) + if len(this.unknown) < len(o.GetUnknownProperties()) { + return true + } else if len(o.GetUnknownProperties()) < len(this.unknown) { + return false + } // End: Compare unknown properties (only by number of them) + + // All properties are the same. + return false +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. +func (this GoToSocialCanLike) Serialize() (map[string]interface{}, error) { + m := make(map[string]interface{}) + // Begin: Serialize known properties + // Maybe serialize property "always" + if this.GoToSocialAlways != nil { + if i, err := this.GoToSocialAlways.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialAlways.Name()] = i + } + } + // Maybe serialize property "approvalRequired" + if this.GoToSocialApprovalRequired != nil { + if i, err := this.GoToSocialApprovalRequired.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovalRequired.Name()] = i + } + } + // Maybe serialize property "id" + if this.JSONLDId != nil { + if i, err := this.JSONLDId.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.JSONLDId.Name()] = i + } + } + // End: Serialize known properties + + // Begin: Serialize unknown properties + for k, v := range this.unknown { + // To be safe, ensure we aren't overwriting a known property + if _, has := m[k]; !has { + m[k] = v + } + } + // End: Serialize unknown properties + + return m, nil +} + +// SetGoToSocialAlways sets the "always" property. +func (this *GoToSocialCanLike) SetGoToSocialAlways(i vocab.GoToSocialAlwaysProperty) { + this.GoToSocialAlways = i +} + +// SetGoToSocialApprovalRequired sets the "approvalRequired" property. +func (this *GoToSocialCanLike) SetGoToSocialApprovalRequired(i vocab.GoToSocialApprovalRequiredProperty) { + this.GoToSocialApprovalRequired = i +} + +// SetJSONLDId sets the "id" property. +func (this *GoToSocialCanLike) SetJSONLDId(i vocab.JSONLDIdProperty) { + this.JSONLDId = i +} + +// VocabularyURI returns the vocabulary's URI as a string. +func (this GoToSocialCanLike) VocabularyURI() string { + return "https://gotosocial.org/ns" +} + +// helperJSONLDContext obtains the context uris and their aliases from a property, +// if it is not nil. +func (this GoToSocialCanLike) helperJSONLDContext(i jsonldContexter, toMerge map[string]string) map[string]string { + if i == nil { + return toMerge + } + for k, v := range i.JSONLDContext() { + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + toMerge[k] = v + } + return toMerge +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply/gen_doc.go new file mode 100644 index 000000000..b17fa98ee --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package typecanreply contains the implementation for the CanReply type. All +// applications are strongly encouraged to use the interface instead of this +// concrete definition. The interfaces allow applications to consume only the +// types and properties needed and be independent of the go-fed implementation +// if another alternative implementation is created. This package is +// code-generated and subject to the same license as the go-fed tool used to +// generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package typecanreply diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply/gen_pkg.go new file mode 100644 index 000000000..1d262affd --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply/gen_pkg.go @@ -0,0 +1,54 @@ +// Code generated by astool. DO NOT EDIT. + +package typecanreply + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +var mgr privateManager + +var typePropertyConstructor func() vocab.JSONLDTypeProperty + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface { + // DeserializeAlwaysPropertyGoToSocial returns the deserialization method + // for the "GoToSocialAlwaysProperty" non-functional property in the + // vocabulary "GoToSocial" + DeserializeAlwaysPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialAlwaysProperty, error) + // DeserializeApprovalRequiredPropertyGoToSocial returns the + // deserialization method for the "GoToSocialApprovalRequiredProperty" + // non-functional property in the vocabulary "GoToSocial" + DeserializeApprovalRequiredPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovalRequiredProperty, error) + // DeserializeIdPropertyJSONLD returns the deserialization method for the + // "JSONLDIdProperty" non-functional property in the vocabulary + // "JSONLD" + DeserializeIdPropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDIdProperty, error) +} + +// jsonldContexter is a private interface to determine the JSON-LD contexts and +// aliases needed for functional and non-functional properties. It is a helper +// interface for this implementation. +type jsonldContexter interface { + // JSONLDContext returns the JSONLD URIs required in the context string + // for this property and the specific values that are set. The value + // in the map is the alias used to import the property's value or + // values. + JSONLDContext() map[string]string +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} + +// SetTypePropertyConstructor sets the "type" property's constructor in the +// package-global variable. For internal use only, do not use as part of +// Application behavior. Must be called at golang init time. Permits +// ActivityStreams types to correctly set their "type" property at +// construction time, so users don't have to remember to do so each time. It +// is dependency injected so other go-fed compatible implementations could +// inject their own type. +func SetTypePropertyConstructor(f func() vocab.JSONLDTypeProperty) { + typePropertyConstructor = f +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply/gen_type_gotosocial_canreply.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply/gen_type_gotosocial_canreply.go new file mode 100644 index 000000000..6d77ffbd2 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply/gen_type_gotosocial_canreply.go @@ -0,0 +1,288 @@ +// Code generated by astool. DO NOT EDIT. + +package typecanreply + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +type GoToSocialCanReply struct { + GoToSocialAlways vocab.GoToSocialAlwaysProperty + GoToSocialApprovalRequired vocab.GoToSocialApprovalRequiredProperty + JSONLDId vocab.JSONLDIdProperty + alias string + unknown map[string]interface{} +} + +// CanReplyIsDisjointWith returns true if the other provided type is disjoint with +// the CanReply type. +func CanReplyIsDisjointWith(other vocab.Type) bool { + // Shortcut implementation: is not disjoint with anything. + return false +} + +// CanReplyIsExtendedBy returns true if the other provided type extends from the +// CanReply type. Note that it returns false if the types are the same; see +// the "IsOrExtendsCanReply" variant instead. +func CanReplyIsExtendedBy(other vocab.Type) bool { + // Shortcut implementation: is not extended by anything. + return false +} + +// DeserializeCanReply creates a CanReply from a map representation that has been +// unmarshalled from a text or binary format. +func DeserializeCanReply(m map[string]interface{}, aliasMap map[string]string) (*GoToSocialCanReply, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + this := &GoToSocialCanReply{ + alias: alias, + unknown: make(map[string]interface{}), + } + + // Begin: Known property deserialization + if p, err := mgr.DeserializeAlwaysPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialAlways = p + } + if p, err := mgr.DeserializeApprovalRequiredPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialApprovalRequired = p + } + if p, err := mgr.DeserializeIdPropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDId = p + } + // End: Known property deserialization + + // Begin: Unknown deserialization + for k, v := range m { + // Begin: Code that ensures a property name is unknown + if k == "always" { + continue + } else if k == "approvalRequired" { + continue + } else if k == "id" { + continue + } // End: Code that ensures a property name is unknown + + this.unknown[k] = v + } + // End: Unknown deserialization + + return this, nil +} + +// GoToSocialCanReplyExtends returns true if the CanReply type extends from the +// other type. +func GoToSocialCanReplyExtends(other vocab.Type) bool { + // Shortcut implementation: this does not extend anything. + return false +} + +// IsOrExtendsCanReply returns true if the other provided type is the CanReply +// type or extends from the CanReply type. +func IsOrExtendsCanReply(other vocab.Type) bool { + if other.GetTypeName() == "CanReply" { + return true + } + return CanReplyIsExtendedBy(other) +} + +// NewGoToSocialCanReply creates a new CanReply type +func NewGoToSocialCanReply() *GoToSocialCanReply { + return &GoToSocialCanReply{ + alias: "", + unknown: make(map[string]interface{}), + } +} + +// GetGoToSocialAlways returns the "always" property if it exists, and nil +// otherwise. +func (this GoToSocialCanReply) GetGoToSocialAlways() vocab.GoToSocialAlwaysProperty { + return this.GoToSocialAlways +} + +// GetGoToSocialApprovalRequired returns the "approvalRequired" property if it +// exists, and nil otherwise. +func (this GoToSocialCanReply) GetGoToSocialApprovalRequired() vocab.GoToSocialApprovalRequiredProperty { + return this.GoToSocialApprovalRequired +} + +// GetJSONLDId returns the "id" property if it exists, and nil otherwise. +func (this GoToSocialCanReply) GetJSONLDId() vocab.JSONLDIdProperty { + return this.JSONLDId +} + +// GetTypeName returns the name of this type. +func (this GoToSocialCanReply) GetTypeName() string { + return "CanReply" +} + +// GetUnknownProperties returns the unknown properties for the CanReply type. Note +// that this should not be used by app developers. It is only used to help +// determine which implementation is LessThan the other. Developers who are +// creating a different implementation of this type's interface can use this +// method in their LessThan implementation, but routine ActivityPub +// applications should not use this to bypass the code generation tool. +func (this GoToSocialCanReply) GetUnknownProperties() map[string]interface{} { + return this.unknown +} + +// IsExtending returns true if the CanReply type extends from the other type. +func (this GoToSocialCanReply) IsExtending(other vocab.Type) bool { + return GoToSocialCanReplyExtends(other) +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// type and the specific properties that are set. The value in the map is the +// alias used to import the type and its properties. +func (this GoToSocialCanReply) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + m = this.helperJSONLDContext(this.GoToSocialAlways, m) + m = this.helperJSONLDContext(this.GoToSocialApprovalRequired, m) + m = this.helperJSONLDContext(this.JSONLDId, m) + + return m +} + +// LessThan computes if this CanReply is lesser, with an arbitrary but stable +// determination. +func (this GoToSocialCanReply) LessThan(o vocab.GoToSocialCanReply) bool { + // Begin: Compare known properties + // Compare property "always" + if lhs, rhs := this.GoToSocialAlways, o.GetGoToSocialAlways(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // Compare property "approvalRequired" + if lhs, rhs := this.GoToSocialApprovalRequired, o.GetGoToSocialApprovalRequired(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // Compare property "id" + if lhs, rhs := this.JSONLDId, o.GetJSONLDId(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // End: Compare known properties + + // Begin: Compare unknown properties (only by number of them) + if len(this.unknown) < len(o.GetUnknownProperties()) { + return true + } else if len(o.GetUnknownProperties()) < len(this.unknown) { + return false + } // End: Compare unknown properties (only by number of them) + + // All properties are the same. + return false +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. +func (this GoToSocialCanReply) Serialize() (map[string]interface{}, error) { + m := make(map[string]interface{}) + // Begin: Serialize known properties + // Maybe serialize property "always" + if this.GoToSocialAlways != nil { + if i, err := this.GoToSocialAlways.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialAlways.Name()] = i + } + } + // Maybe serialize property "approvalRequired" + if this.GoToSocialApprovalRequired != nil { + if i, err := this.GoToSocialApprovalRequired.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialApprovalRequired.Name()] = i + } + } + // Maybe serialize property "id" + if this.JSONLDId != nil { + if i, err := this.JSONLDId.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.JSONLDId.Name()] = i + } + } + // End: Serialize known properties + + // Begin: Serialize unknown properties + for k, v := range this.unknown { + // To be safe, ensure we aren't overwriting a known property + if _, has := m[k]; !has { + m[k] = v + } + } + // End: Serialize unknown properties + + return m, nil +} + +// SetGoToSocialAlways sets the "always" property. +func (this *GoToSocialCanReply) SetGoToSocialAlways(i vocab.GoToSocialAlwaysProperty) { + this.GoToSocialAlways = i +} + +// SetGoToSocialApprovalRequired sets the "approvalRequired" property. +func (this *GoToSocialCanReply) SetGoToSocialApprovalRequired(i vocab.GoToSocialApprovalRequiredProperty) { + this.GoToSocialApprovalRequired = i +} + +// SetJSONLDId sets the "id" property. +func (this *GoToSocialCanReply) SetJSONLDId(i vocab.JSONLDIdProperty) { + this.JSONLDId = i +} + +// VocabularyURI returns the vocabulary's URI as a string. +func (this GoToSocialCanReply) VocabularyURI() string { + return "https://gotosocial.org/ns" +} + +// helperJSONLDContext obtains the context uris and their aliases from a property, +// if it is not nil. +func (this GoToSocialCanReply) helperJSONLDContext(i jsonldContexter, toMerge map[string]string) map[string]string { + if i == nil { + return toMerge + } + for k, v := range i.JSONLDContext() { + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + toMerge[k] = v + } + return toMerge +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy/gen_doc.go new file mode 100644 index 000000000..1e13f6ef7 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package typeinteractionpolicy contains the implementation for the +// InteractionPolicy type. All applications are strongly encouraged to use the +// interface instead of this concrete definition. The interfaces allow +// applications to consume only the types and properties needed and be +// independent of the go-fed implementation if another alternative +// implementation is created. This package is code-generated and subject to +// the same license as the go-fed tool used to generate it. +// +// This package is independent of other types' and properties' implementations +// by having a Manager injected into it to act as a factory for the concrete +// implementations. The implementations have been generated into their own +// separate subpackages for each vocabulary. +// +// Strongly consider using the interfaces instead of this package. +package typeinteractionpolicy diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy/gen_pkg.go new file mode 100644 index 000000000..122fc05ab --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy/gen_pkg.go @@ -0,0 +1,58 @@ +// Code generated by astool. DO NOT EDIT. + +package typeinteractionpolicy + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +var mgr privateManager + +var typePropertyConstructor func() vocab.JSONLDTypeProperty + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface { + // DeserializeCanAnnouncePropertyGoToSocial returns the deserialization + // method for the "GoToSocialCanAnnounceProperty" non-functional + // property in the vocabulary "GoToSocial" + DeserializeCanAnnouncePropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanAnnounceProperty, error) + // DeserializeCanLikePropertyGoToSocial returns the deserialization method + // for the "GoToSocialCanLikeProperty" non-functional property in the + // vocabulary "GoToSocial" + DeserializeCanLikePropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanLikeProperty, error) + // DeserializeCanReplyPropertyGoToSocial returns the deserialization + // method for the "GoToSocialCanReplyProperty" non-functional property + // in the vocabulary "GoToSocial" + DeserializeCanReplyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanReplyProperty, error) + // DeserializeIdPropertyJSONLD returns the deserialization method for the + // "JSONLDIdProperty" non-functional property in the vocabulary + // "JSONLD" + DeserializeIdPropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDIdProperty, error) +} + +// jsonldContexter is a private interface to determine the JSON-LD contexts and +// aliases needed for functional and non-functional properties. It is a helper +// interface for this implementation. +type jsonldContexter interface { + // JSONLDContext returns the JSONLD URIs required in the context string + // for this property and the specific values that are set. The value + // in the map is the alias used to import the property's value or + // values. + JSONLDContext() map[string]string +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} + +// SetTypePropertyConstructor sets the "type" property's constructor in the +// package-global variable. For internal use only, do not use as part of +// Application behavior. Must be called at golang init time. Permits +// ActivityStreams types to correctly set their "type" property at +// construction time, so users don't have to remember to do so each time. It +// is dependency injected so other go-fed compatible implementations could +// inject their own type. +func SetTypePropertyConstructor(f func() vocab.JSONLDTypeProperty) { + typePropertyConstructor = f +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy/gen_type_gotosocial_interactionpolicy.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy/gen_type_gotosocial_interactionpolicy.go new file mode 100644 index 000000000..b48fcb136 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy/gen_type_gotosocial_interactionpolicy.go @@ -0,0 +1,332 @@ +// Code generated by astool. DO NOT EDIT. + +package typeinteractionpolicy + +import vocab "github.com/superseriousbusiness/activity/streams/vocab" + +// InteractionPolicy for an ActivityStreams Object. +type GoToSocialInteractionPolicy struct { + GoToSocialCanAnnounce vocab.GoToSocialCanAnnounceProperty + GoToSocialCanLike vocab.GoToSocialCanLikeProperty + GoToSocialCanReply vocab.GoToSocialCanReplyProperty + JSONLDId vocab.JSONLDIdProperty + alias string + unknown map[string]interface{} +} + +// DeserializeInteractionPolicy creates a InteractionPolicy from a map +// representation that has been unmarshalled from a text or binary format. +func DeserializeInteractionPolicy(m map[string]interface{}, aliasMap map[string]string) (*GoToSocialInteractionPolicy, error) { + alias := "" + if a, ok := aliasMap["https://gotosocial.org/ns"]; ok { + alias = a + } + this := &GoToSocialInteractionPolicy{ + alias: alias, + unknown: make(map[string]interface{}), + } + + // Begin: Known property deserialization + if p, err := mgr.DeserializeCanAnnouncePropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialCanAnnounce = p + } + if p, err := mgr.DeserializeCanLikePropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialCanLike = p + } + if p, err := mgr.DeserializeCanReplyPropertyGoToSocial()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.GoToSocialCanReply = p + } + if p, err := mgr.DeserializeIdPropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDId = p + } + // End: Known property deserialization + + // Begin: Unknown deserialization + for k, v := range m { + // Begin: Code that ensures a property name is unknown + if k == "canAnnounce" { + continue + } else if k == "canLike" { + continue + } else if k == "canReply" { + continue + } else if k == "id" { + continue + } // End: Code that ensures a property name is unknown + + this.unknown[k] = v + } + // End: Unknown deserialization + + return this, nil +} + +// GoToSocialInteractionPolicyExtends returns true if the InteractionPolicy type +// extends from the other type. +func GoToSocialInteractionPolicyExtends(other vocab.Type) bool { + // Shortcut implementation: this does not extend anything. + return false +} + +// InteractionPolicyIsDisjointWith returns true if the other provided type is +// disjoint with the InteractionPolicy type. +func InteractionPolicyIsDisjointWith(other vocab.Type) bool { + // Shortcut implementation: is not disjoint with anything. + return false +} + +// InteractionPolicyIsExtendedBy returns true if the other provided type extends +// from the InteractionPolicy type. Note that it returns false if the types +// are the same; see the "IsOrExtendsInteractionPolicy" variant instead. +func InteractionPolicyIsExtendedBy(other vocab.Type) bool { + // Shortcut implementation: is not extended by anything. + return false +} + +// IsOrExtendsInteractionPolicy returns true if the other provided type is the +// InteractionPolicy type or extends from the InteractionPolicy type. +func IsOrExtendsInteractionPolicy(other vocab.Type) bool { + if other.GetTypeName() == "InteractionPolicy" { + return true + } + return InteractionPolicyIsExtendedBy(other) +} + +// NewGoToSocialInteractionPolicy creates a new InteractionPolicy type +func NewGoToSocialInteractionPolicy() *GoToSocialInteractionPolicy { + return &GoToSocialInteractionPolicy{ + alias: "", + unknown: make(map[string]interface{}), + } +} + +// GetGoToSocialCanAnnounce returns the "canAnnounce" property if it exists, and +// nil otherwise. +func (this GoToSocialInteractionPolicy) GetGoToSocialCanAnnounce() vocab.GoToSocialCanAnnounceProperty { + return this.GoToSocialCanAnnounce +} + +// GetGoToSocialCanLike returns the "canLike" property if it exists, and nil +// otherwise. +func (this GoToSocialInteractionPolicy) GetGoToSocialCanLike() vocab.GoToSocialCanLikeProperty { + return this.GoToSocialCanLike +} + +// GetGoToSocialCanReply returns the "canReply" property if it exists, and nil +// otherwise. +func (this GoToSocialInteractionPolicy) GetGoToSocialCanReply() vocab.GoToSocialCanReplyProperty { + return this.GoToSocialCanReply +} + +// GetJSONLDId returns the "id" property if it exists, and nil otherwise. +func (this GoToSocialInteractionPolicy) GetJSONLDId() vocab.JSONLDIdProperty { + return this.JSONLDId +} + +// GetTypeName returns the name of this type. +func (this GoToSocialInteractionPolicy) GetTypeName() string { + return "InteractionPolicy" +} + +// GetUnknownProperties returns the unknown properties for the InteractionPolicy +// type. Note that this should not be used by app developers. It is only used +// to help determine which implementation is LessThan the other. Developers +// who are creating a different implementation of this type's interface can +// use this method in their LessThan implementation, but routine ActivityPub +// applications should not use this to bypass the code generation tool. +func (this GoToSocialInteractionPolicy) GetUnknownProperties() map[string]interface{} { + return this.unknown +} + +// IsExtending returns true if the InteractionPolicy type extends from the other +// type. +func (this GoToSocialInteractionPolicy) IsExtending(other vocab.Type) bool { + return GoToSocialInteractionPolicyExtends(other) +} + +// JSONLDContext returns the JSONLD URIs required in the context string for this +// type and the specific properties that are set. The value in the map is the +// alias used to import the type and its properties. +func (this GoToSocialInteractionPolicy) JSONLDContext() map[string]string { + m := map[string]string{"https://gotosocial.org/ns": this.alias} + m = this.helperJSONLDContext(this.GoToSocialCanAnnounce, m) + m = this.helperJSONLDContext(this.GoToSocialCanLike, m) + m = this.helperJSONLDContext(this.GoToSocialCanReply, m) + m = this.helperJSONLDContext(this.JSONLDId, m) + + return m +} + +// LessThan computes if this InteractionPolicy is lesser, with an arbitrary but +// stable determination. +func (this GoToSocialInteractionPolicy) LessThan(o vocab.GoToSocialInteractionPolicy) bool { + // Begin: Compare known properties + // Compare property "canAnnounce" + if lhs, rhs := this.GoToSocialCanAnnounce, o.GetGoToSocialCanAnnounce(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // Compare property "canLike" + if lhs, rhs := this.GoToSocialCanLike, o.GetGoToSocialCanLike(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // Compare property "canReply" + if lhs, rhs := this.GoToSocialCanReply, o.GetGoToSocialCanReply(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // Compare property "id" + if lhs, rhs := this.JSONLDId, o.GetJSONLDId(); lhs != nil && rhs != nil { + if lhs.LessThan(rhs) { + return true + } else if rhs.LessThan(lhs) { + return false + } + } else if lhs == nil && rhs != nil { + // Nil is less than anything else + return true + } else if rhs != nil && rhs == nil { + // Anything else is greater than nil + return false + } // Else: Both are nil + // End: Compare known properties + + // Begin: Compare unknown properties (only by number of them) + if len(this.unknown) < len(o.GetUnknownProperties()) { + return true + } else if len(o.GetUnknownProperties()) < len(this.unknown) { + return false + } // End: Compare unknown properties (only by number of them) + + // All properties are the same. + return false +} + +// Serialize converts this into an interface representation suitable for +// marshalling into a text or binary format. +func (this GoToSocialInteractionPolicy) Serialize() (map[string]interface{}, error) { + m := make(map[string]interface{}) + // Begin: Serialize known properties + // Maybe serialize property "canAnnounce" + if this.GoToSocialCanAnnounce != nil { + if i, err := this.GoToSocialCanAnnounce.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialCanAnnounce.Name()] = i + } + } + // Maybe serialize property "canLike" + if this.GoToSocialCanLike != nil { + if i, err := this.GoToSocialCanLike.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialCanLike.Name()] = i + } + } + // Maybe serialize property "canReply" + if this.GoToSocialCanReply != nil { + if i, err := this.GoToSocialCanReply.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.GoToSocialCanReply.Name()] = i + } + } + // Maybe serialize property "id" + if this.JSONLDId != nil { + if i, err := this.JSONLDId.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.JSONLDId.Name()] = i + } + } + // End: Serialize known properties + + // Begin: Serialize unknown properties + for k, v := range this.unknown { + // To be safe, ensure we aren't overwriting a known property + if _, has := m[k]; !has { + m[k] = v + } + } + // End: Serialize unknown properties + + return m, nil +} + +// SetGoToSocialCanAnnounce sets the "canAnnounce" property. +func (this *GoToSocialInteractionPolicy) SetGoToSocialCanAnnounce(i vocab.GoToSocialCanAnnounceProperty) { + this.GoToSocialCanAnnounce = i +} + +// SetGoToSocialCanLike sets the "canLike" property. +func (this *GoToSocialInteractionPolicy) SetGoToSocialCanLike(i vocab.GoToSocialCanLikeProperty) { + this.GoToSocialCanLike = i +} + +// SetGoToSocialCanReply sets the "canReply" property. +func (this *GoToSocialInteractionPolicy) SetGoToSocialCanReply(i vocab.GoToSocialCanReplyProperty) { + this.GoToSocialCanReply = i +} + +// SetJSONLDId sets the "id" property. +func (this *GoToSocialInteractionPolicy) SetJSONLDId(i vocab.JSONLDIdProperty) { + this.JSONLDId = i +} + +// VocabularyURI returns the vocabulary's URI as a string. +func (this GoToSocialInteractionPolicy) VocabularyURI() string { + return "https://gotosocial.org/ns" +} + +// helperJSONLDContext obtains the context uris and their aliases from a property, +// if it is not nil. +func (this GoToSocialInteractionPolicy) helperJSONLDContext(i jsonldContexter, toMerge map[string]string) map[string]string { + if i == nil { + return toMerge + } + for k, v := range i.JSONLDContext() { + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + toMerge[k] = v + } + return toMerge +} |
