[chore] upstep activity to v1.7.0-gts (#3074)

This commit is contained in:
tobi 2024-07-06 15:57:11 +02:00 committed by GitHub
parent 49009fbd8f
commit 1a66ea8998
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
96 changed files with 8362 additions and 4 deletions

2
go.mod
View file

@ -51,7 +51,7 @@ require (
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/superseriousbusiness/activity v1.6.0-gts.0.20240408131430-247f7f7110f0
github.com/superseriousbusiness/activity v1.7.0-gts
github.com/superseriousbusiness/httpsig v1.2.0-SSB
github.com/superseriousbusiness/oauth2/v4 v4.3.2-SSB.0.20230227143000-f4900831d6c8
github.com/tdewolff/minify/v2 v2.20.34

4
go.sum
View file

@ -539,8 +539,8 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/sunfish-shogi/bufseekio v0.0.0-20210207115823-a4185644b365/go.mod h1:dEzdXgvImkQ3WLI+0KQpmEx8T/C/ma9KeS3AfmU899I=
github.com/superseriousbusiness/activity v1.6.0-gts.0.20240408131430-247f7f7110f0 h1:zPdbgwbjPxrJqme2sFTMQoML5ukNWRhChOnilR47rss=
github.com/superseriousbusiness/activity v1.6.0-gts.0.20240408131430-247f7f7110f0/go.mod h1:AZw0Xb4Oju8rmaJCZ21gc5CPg47MmNgyac+Hx5jo8VM=
github.com/superseriousbusiness/activity v1.7.0-gts h1:DsCvzksTWptn7JUDTFIIiJ7xkh0A22VZs5KI3q67p+4=
github.com/superseriousbusiness/activity v1.7.0-gts/go.mod h1:AZw0Xb4Oju8rmaJCZ21gc5CPg47MmNgyac+Hx5jo8VM=
github.com/superseriousbusiness/go-jpeg-image-structure/v2 v2.0.0-20220321154430-d89a106fdabe h1:ksl2oCx/Qo8sNDc3Grb8WGKBM9nkvhCm25uvlT86azE=
github.com/superseriousbusiness/go-jpeg-image-structure/v2 v2.0.0-20220321154430-d89a106fdabe/go.mod h1:gH4P6gN1V+wmIw5o97KGaa1RgXB/tVpC2UNzijhg3E4=
github.com/superseriousbusiness/go-png-image-structure/v2 v2.0.1-SSB h1:8psprYSK1KdOSH7yQ4PbJq0YYaGQY+gzdW/B0ExDb/8=

View file

@ -29,6 +29,15 @@ var ActivityStreamsAudioName string = "Audio"
// ActivityStreamsBlockName is the string literal of the name for the Block type in the ActivityStreams vocabulary.
var ActivityStreamsBlockName string = "Block"
// GoToSocialCanAnnounceName is the string literal of the name for the CanAnnounce type in the GoToSocial vocabulary.
var GoToSocialCanAnnounceName string = "CanAnnounce"
// GoToSocialCanLikeName is the string literal of the name for the CanLike type in the GoToSocial vocabulary.
var GoToSocialCanLikeName string = "CanLike"
// GoToSocialCanReplyName is the string literal of the name for the CanReply type in the GoToSocial vocabulary.
var GoToSocialCanReplyName string = "CanReply"
// ActivityStreamsCollectionName is the string literal of the name for the Collection type in the ActivityStreams vocabulary.
var ActivityStreamsCollectionName string = "Collection"
@ -77,6 +86,9 @@ var ActivityStreamsIgnoreName string = "Ignore"
// ActivityStreamsImageName is the string literal of the name for the Image type in the ActivityStreams vocabulary.
var ActivityStreamsImageName string = "Image"
// GoToSocialInteractionPolicyName is the string literal of the name for the InteractionPolicy type in the GoToSocial vocabulary.
var GoToSocialInteractionPolicyName string = "InteractionPolicy"
// ActivityStreamsIntransitiveActivityName is the string literal of the name for the IntransitiveActivity type in the ActivityStreams vocabulary.
var ActivityStreamsIntransitiveActivityName string = "IntransitiveActivity"
@ -194,9 +206,18 @@ var ActivityStreamsAlsoKnownAsPropertyName string = "alsoKnownAs"
// ActivityStreamsAltitudePropertyName is the string literal of the name for the altitude property in the ActivityStreams vocabulary.
var ActivityStreamsAltitudePropertyName string = "altitude"
// GoToSocialAlwaysPropertyName is the string literal of the name for the always property in the GoToSocial vocabulary.
var GoToSocialAlwaysPropertyName string = "always"
// ActivityStreamsAnyOfPropertyName is the string literal of the name for the anyOf property in the ActivityStreams vocabulary.
var ActivityStreamsAnyOfPropertyName string = "anyOf"
// GoToSocialApprovalRequiredPropertyName is the string literal of the name for the approvalRequired property in the GoToSocial vocabulary.
var GoToSocialApprovalRequiredPropertyName string = "approvalRequired"
// GoToSocialApprovedByPropertyName is the string literal of the name for the approvedBy property in the GoToSocial vocabulary.
var GoToSocialApprovedByPropertyName string = "approvedBy"
// ActivityStreamsAttachmentPropertyName is the string literal of the name for the attachment property in the ActivityStreams vocabulary.
var ActivityStreamsAttachmentPropertyName string = "attachment"
@ -215,6 +236,15 @@ var TootBlurhashPropertyName string = "blurhash"
// ActivityStreamsBtoPropertyName is the string literal of the name for the bto property in the ActivityStreams vocabulary.
var ActivityStreamsBtoPropertyName string = "bto"
// GoToSocialCanAnnouncePropertyName is the string literal of the name for the canAnnounce property in the GoToSocial vocabulary.
var GoToSocialCanAnnouncePropertyName string = "canAnnounce"
// GoToSocialCanLikePropertyName is the string literal of the name for the canLike property in the GoToSocial vocabulary.
var GoToSocialCanLikePropertyName string = "canLike"
// GoToSocialCanReplyPropertyName is the string literal of the name for the canReply property in the GoToSocial vocabulary.
var GoToSocialCanReplyPropertyName string = "canReply"
// ActivityStreamsCcPropertyName is the string literal of the name for the cc property in the ActivityStreams vocabulary.
var ActivityStreamsCcPropertyName string = "cc"
@ -293,6 +323,9 @@ var ActivityStreamsInboxPropertyName string = "inbox"
// ActivityStreamsInstrumentPropertyName is the string literal of the name for the instrument property in the ActivityStreams vocabulary.
var ActivityStreamsInstrumentPropertyName string = "instrument"
// GoToSocialInteractionPolicyPropertyName is the string literal of the name for the interactionPolicy property in the GoToSocial vocabulary.
var GoToSocialInteractionPolicyPropertyName string = "interactionPolicy"
// ActivityStreamsItemsPropertyName is the string literal of the name for the items property in the ActivityStreams vocabulary.
var ActivityStreamsItemsPropertyName string = "items"

View file

@ -135,6 +135,17 @@ import (
typeupdate "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_update"
typevideo "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video"
typeview "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_view"
propertyalways "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always"
propertyapprovalrequired "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired"
propertyapprovedby "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby"
propertycanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce"
propertycanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike"
propertycanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply"
propertyinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy"
typecanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce"
typecanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike"
typecanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply"
typeinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy"
propertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/property_value"
typepropertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/type_propertyvalue"
propertyblurhash "github.com/superseriousbusiness/activity/streams/impl/toot/property_blurhash"
@ -297,6 +308,17 @@ func init() {
typeupdate.SetManager(mgr)
typevideo.SetManager(mgr)
typeview.SetManager(mgr)
propertyalways.SetManager(mgr)
propertyapprovalrequired.SetManager(mgr)
propertyapprovedby.SetManager(mgr)
propertycanannounce.SetManager(mgr)
propertycanlike.SetManager(mgr)
propertycanreply.SetManager(mgr)
propertyinteractionpolicy.SetManager(mgr)
typecanannounce.SetManager(mgr)
typecanlike.SetManager(mgr)
typecanreply.SetManager(mgr)
typeinteractionpolicy.SetManager(mgr)
propertyvalue.SetManager(mgr)
typepropertyvalue.SetManager(mgr)
propertyblurhash.SetManager(mgr)
@ -367,6 +389,10 @@ func init() {
typeupdate.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typevideo.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typeview.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typecanannounce.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typecanlike.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typecanreply.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typeinteractionpolicy.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typepropertyvalue.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typeemoji.SetTypePropertyConstructor(NewJSONLDTypeProperty)
typehashtag.SetTypePropertyConstructor(NewJSONLDTypeProperty)

View file

@ -49,6 +49,12 @@ func NewJSONResolver(callbacks ...interface{}) (*JSONResolver, error) {
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsBlock) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.GoToSocialCanAnnounce) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.GoToSocialCanLike) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.GoToSocialCanReply) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsCollection) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsCollectionPage) error:
@ -81,6 +87,8 @@ func NewJSONResolver(callbacks ...interface{}) (*JSONResolver, error) {
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsImage) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.GoToSocialInteractionPolicy) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsIntransitiveActivity) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsInvite) error:
@ -230,6 +238,13 @@ func (this JSONResolver) Resolve(ctx context.Context, m map[string]interface{})
if len(ActivityStreamsAlias) > 0 {
ActivityStreamsAlias += ":"
}
GoToSocialAlias, ok := aliasMap["https://gotosocial.org/ns"]
if !ok {
GoToSocialAlias = aliasMap["http://gotosocial.org/ns"]
}
if len(GoToSocialAlias) > 0 {
GoToSocialAlias += ":"
}
TootAlias, ok := aliasMap["https://joinmastodon.org/ns"]
if !ok {
TootAlias = aliasMap["http://joinmastodon.org/ns"]
@ -351,6 +366,39 @@ func (this JSONResolver) Resolve(ctx context.Context, m map[string]interface{})
}
}
return ErrNoCallbackMatch
} else if typeString == GoToSocialAlias+"CanAnnounce" {
v, err := mgr.DeserializeCanAnnounceGoToSocial()(m, aliasMap)
if err != nil {
return err
}
for _, i := range this.callbacks {
if fn, ok := i.(func(context.Context, vocab.GoToSocialCanAnnounce) error); ok {
return fn(ctx, v)
}
}
return ErrNoCallbackMatch
} else if typeString == GoToSocialAlias+"CanLike" {
v, err := mgr.DeserializeCanLikeGoToSocial()(m, aliasMap)
if err != nil {
return err
}
for _, i := range this.callbacks {
if fn, ok := i.(func(context.Context, vocab.GoToSocialCanLike) error); ok {
return fn(ctx, v)
}
}
return ErrNoCallbackMatch
} else if typeString == GoToSocialAlias+"CanReply" {
v, err := mgr.DeserializeCanReplyGoToSocial()(m, aliasMap)
if err != nil {
return err
}
for _, i := range this.callbacks {
if fn, ok := i.(func(context.Context, vocab.GoToSocialCanReply) error); ok {
return fn(ctx, v)
}
}
return ErrNoCallbackMatch
} else if typeString == ActivityStreamsAlias+"Collection" {
v, err := mgr.DeserializeCollectionActivityStreams()(m, aliasMap)
if err != nil {
@ -527,6 +575,17 @@ func (this JSONResolver) Resolve(ctx context.Context, m map[string]interface{})
}
}
return ErrNoCallbackMatch
} else if typeString == GoToSocialAlias+"InteractionPolicy" {
v, err := mgr.DeserializeInteractionPolicyGoToSocial()(m, aliasMap)
if err != nil {
return err
}
for _, i := range this.callbacks {
if fn, ok := i.(func(context.Context, vocab.GoToSocialInteractionPolicy) error); ok {
return fn(ctx, v)
}
}
return ErrNoCallbackMatch
} else if typeString == ActivityStreamsAlias+"IntransitiveActivity" {
v, err := mgr.DeserializeIntransitiveActivityActivityStreams()(m, aliasMap)
if err != nil {

View file

@ -135,6 +135,17 @@ import (
typeupdate "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_update"
typevideo "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video"
typeview "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_view"
propertyalways "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always"
propertyapprovalrequired "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired"
propertyapprovedby "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby"
propertycanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce"
propertycanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike"
propertycanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply"
propertyinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy"
typecanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce"
typecanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike"
typecanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply"
typeinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy"
propertyid "github.com/superseriousbusiness/activity/streams/impl/jsonld/property_id"
propertytype "github.com/superseriousbusiness/activity/streams/impl/jsonld/property_type"
propertyvalue "github.com/superseriousbusiness/activity/streams/impl/schema/property_value"
@ -252,6 +263,19 @@ func (this Manager) DeserializeAltitudePropertyActivityStreams() func(map[string
}
}
// DeserializeAlwaysPropertyGoToSocial returns the deserialization method for the
// "GoToSocialAlwaysProperty" non-functional property in the vocabulary
// "GoToSocial"
func (this Manager) DeserializeAlwaysPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialAlwaysProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialAlwaysProperty, error) {
i, err := propertyalways.DeserializeAlwaysProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeAnnounceActivityStreams returns the deserialization method for the
// "ActivityStreamsAnnounce" non-functional property in the vocabulary
// "ActivityStreams"
@ -291,6 +315,32 @@ func (this Manager) DeserializeApplicationActivityStreams() func(map[string]inte
}
}
// DeserializeApprovalRequiredPropertyGoToSocial returns the deserialization
// method for the "GoToSocialApprovalRequiredProperty" non-functional property
// in the vocabulary "GoToSocial"
func (this Manager) DeserializeApprovalRequiredPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovalRequiredProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialApprovalRequiredProperty, error) {
i, err := propertyapprovalrequired.DeserializeApprovalRequiredProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeApprovedByPropertyGoToSocial returns the deserialization method for
// the "GoToSocialApprovedByProperty" non-functional property in the
// vocabulary "GoToSocial"
func (this Manager) DeserializeApprovedByPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialApprovedByProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialApprovedByProperty, error) {
i, err := propertyapprovedby.DeserializeApprovedByProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeArriveActivityStreams returns the deserialization method for the
// "ActivityStreamsArrive" non-functional property in the vocabulary
// "ActivityStreams"
@ -420,6 +470,82 @@ func (this Manager) DeserializeBtoPropertyActivityStreams() func(map[string]inte
}
}
// DeserializeCanAnnounceGoToSocial returns the deserialization method for the
// "GoToSocialCanAnnounce" non-functional property in the vocabulary
// "GoToSocial"
func (this Manager) DeserializeCanAnnounceGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanAnnounce, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialCanAnnounce, error) {
i, err := typecanannounce.DeserializeCanAnnounce(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeCanAnnouncePropertyGoToSocial returns the deserialization method for
// the "GoToSocialCanAnnounceProperty" non-functional property in the
// vocabulary "GoToSocial"
func (this Manager) DeserializeCanAnnouncePropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanAnnounceProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialCanAnnounceProperty, error) {
i, err := propertycanannounce.DeserializeCanAnnounceProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeCanLikeGoToSocial returns the deserialization method for the
// "GoToSocialCanLike" non-functional property in the vocabulary "GoToSocial"
func (this Manager) DeserializeCanLikeGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanLike, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialCanLike, error) {
i, err := typecanlike.DeserializeCanLike(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeCanLikePropertyGoToSocial returns the deserialization method for the
// "GoToSocialCanLikeProperty" non-functional property in the vocabulary
// "GoToSocial"
func (this Manager) DeserializeCanLikePropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanLikeProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialCanLikeProperty, error) {
i, err := propertycanlike.DeserializeCanLikeProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeCanReplyGoToSocial returns the deserialization method for the
// "GoToSocialCanReply" non-functional property in the vocabulary "GoToSocial"
func (this Manager) DeserializeCanReplyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanReply, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialCanReply, error) {
i, err := typecanreply.DeserializeCanReply(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeCanReplyPropertyGoToSocial returns the deserialization method for
// the "GoToSocialCanReplyProperty" non-functional property in the vocabulary
// "GoToSocial"
func (this Manager) DeserializeCanReplyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialCanReplyProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialCanReplyProperty, error) {
i, err := propertycanreply.DeserializeCanReplyProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeCcPropertyActivityStreams returns the deserialization method for the
// "ActivityStreamsCcProperty" non-functional property in the vocabulary
// "ActivityStreams"
@ -960,6 +1086,32 @@ func (this Manager) DeserializeInstrumentPropertyActivityStreams() func(map[stri
}
}
// DeserializeInteractionPolicyGoToSocial returns the deserialization method for
// the "GoToSocialInteractionPolicy" non-functional property in the vocabulary
// "GoToSocial"
func (this Manager) DeserializeInteractionPolicyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicy, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialInteractionPolicy, error) {
i, err := typeinteractionpolicy.DeserializeInteractionPolicy(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeInteractionPolicyPropertyGoToSocial returns the deserialization
// method for the "GoToSocialInteractionPolicyProperty" non-functional
// property in the vocabulary "GoToSocial"
func (this Manager) DeserializeInteractionPolicyPropertyGoToSocial() func(map[string]interface{}, map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.GoToSocialInteractionPolicyProperty, error) {
i, err := propertyinteractionpolicy.DeserializeInteractionPolicyProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeIntransitiveActivityActivityStreams returns the deserialization
// method for the "ActivityStreamsIntransitiveActivity" non-functional
// property in the vocabulary "ActivityStreams"

View file

@ -0,0 +1,35 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typecanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce"
typecanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike"
typecanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply"
typeinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// GoToSocialCanAnnounceIsDisjointWith returns true if CanAnnounce is disjoint
// with the other's type.
func GoToSocialCanAnnounceIsDisjointWith(other vocab.Type) bool {
return typecanannounce.CanAnnounceIsDisjointWith(other)
}
// GoToSocialCanLikeIsDisjointWith returns true if CanLike is disjoint with the
// other's type.
func GoToSocialCanLikeIsDisjointWith(other vocab.Type) bool {
return typecanlike.CanLikeIsDisjointWith(other)
}
// GoToSocialCanReplyIsDisjointWith returns true if CanReply is disjoint with the
// other's type.
func GoToSocialCanReplyIsDisjointWith(other vocab.Type) bool {
return typecanreply.CanReplyIsDisjointWith(other)
}
// GoToSocialInteractionPolicyIsDisjointWith returns true if InteractionPolicy is
// disjoint with the other's type.
func GoToSocialInteractionPolicyIsDisjointWith(other vocab.Type) bool {
return typeinteractionpolicy.InteractionPolicyIsDisjointWith(other)
}

View file

@ -0,0 +1,39 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typecanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce"
typecanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike"
typecanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply"
typeinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// GoToSocialCanAnnounceIsExtendedBy returns true if the other's type extends from
// CanAnnounce. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func GoToSocialCanAnnounceIsExtendedBy(other vocab.Type) bool {
return typecanannounce.CanAnnounceIsExtendedBy(other)
}
// GoToSocialCanLikeIsExtendedBy returns true if the other's type extends from
// CanLike. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func GoToSocialCanLikeIsExtendedBy(other vocab.Type) bool {
return typecanlike.CanLikeIsExtendedBy(other)
}
// GoToSocialCanReplyIsExtendedBy returns true if the other's type extends from
// CanReply. Note that it returns false if the types are the same; see the
// "IsOrExtends" variant instead.
func GoToSocialCanReplyIsExtendedBy(other vocab.Type) bool {
return typecanreply.CanReplyIsExtendedBy(other)
}
// GoToSocialInteractionPolicyIsExtendedBy returns true if the other's type
// extends from InteractionPolicy. Note that it returns false if the types are
// the same; see the "IsOrExtends" variant instead.
func GoToSocialInteractionPolicyIsExtendedBy(other vocab.Type) bool {
return typeinteractionpolicy.InteractionPolicyIsExtendedBy(other)
}

View file

@ -0,0 +1,35 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typecanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce"
typecanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike"
typecanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply"
typeinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// GoToSocialGoToSocialCanAnnounceExtends returns true if CanAnnounce extends from
// the other's type.
func GoToSocialGoToSocialCanAnnounceExtends(other vocab.Type) bool {
return typecanannounce.GoToSocialCanAnnounceExtends(other)
}
// GoToSocialGoToSocialCanLikeExtends returns true if CanLike extends from the
// other's type.
func GoToSocialGoToSocialCanLikeExtends(other vocab.Type) bool {
return typecanlike.GoToSocialCanLikeExtends(other)
}
// GoToSocialGoToSocialCanReplyExtends returns true if CanReply extends from the
// other's type.
func GoToSocialGoToSocialCanReplyExtends(other vocab.Type) bool {
return typecanreply.GoToSocialCanReplyExtends(other)
}
// GoToSocialGoToSocialInteractionPolicyExtends returns true if InteractionPolicy
// extends from the other's type.
func GoToSocialGoToSocialInteractionPolicyExtends(other vocab.Type) bool {
return typeinteractionpolicy.GoToSocialInteractionPolicyExtends(other)
}

View file

@ -0,0 +1,35 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typecanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce"
typecanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike"
typecanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply"
typeinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// IsOrExtendsGoToSocialCanAnnounce returns true if the other provided type is the
// CanAnnounce type or extends from the CanAnnounce type.
func IsOrExtendsGoToSocialCanAnnounce(other vocab.Type) bool {
return typecanannounce.IsOrExtendsCanAnnounce(other)
}
// IsOrExtendsGoToSocialCanLike returns true if the other provided type is the
// CanLike type or extends from the CanLike type.
func IsOrExtendsGoToSocialCanLike(other vocab.Type) bool {
return typecanlike.IsOrExtendsCanLike(other)
}
// IsOrExtendsGoToSocialCanReply returns true if the other provided type is the
// CanReply type or extends from the CanReply type.
func IsOrExtendsGoToSocialCanReply(other vocab.Type) bool {
return typecanreply.IsOrExtendsCanReply(other)
}
// IsOrExtendsGoToSocialInteractionPolicy returns true if the other provided type
// is the InteractionPolicy type or extends from the InteractionPolicy type.
func IsOrExtendsGoToSocialInteractionPolicy(other vocab.Type) bool {
return typeinteractionpolicy.IsOrExtendsInteractionPolicy(other)
}

View file

@ -0,0 +1,53 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
propertyalways "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always"
propertyapprovalrequired "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired"
propertyapprovedby "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby"
propertycanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce"
propertycanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike"
propertycanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply"
propertyinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// NewGoToSocialGoToSocialAlwaysProperty creates a new GoToSocialAlwaysProperty
func NewGoToSocialAlwaysProperty() vocab.GoToSocialAlwaysProperty {
return propertyalways.NewGoToSocialAlwaysProperty()
}
// NewGoToSocialGoToSocialApprovalRequiredProperty creates a new
// GoToSocialApprovalRequiredProperty
func NewGoToSocialApprovalRequiredProperty() vocab.GoToSocialApprovalRequiredProperty {
return propertyapprovalrequired.NewGoToSocialApprovalRequiredProperty()
}
// NewGoToSocialGoToSocialApprovedByProperty creates a new
// GoToSocialApprovedByProperty
func NewGoToSocialApprovedByProperty() vocab.GoToSocialApprovedByProperty {
return propertyapprovedby.NewGoToSocialApprovedByProperty()
}
// NewGoToSocialGoToSocialCanAnnounceProperty creates a new
// GoToSocialCanAnnounceProperty
func NewGoToSocialCanAnnounceProperty() vocab.GoToSocialCanAnnounceProperty {
return propertycanannounce.NewGoToSocialCanAnnounceProperty()
}
// NewGoToSocialGoToSocialCanLikeProperty creates a new GoToSocialCanLikeProperty
func NewGoToSocialCanLikeProperty() vocab.GoToSocialCanLikeProperty {
return propertycanlike.NewGoToSocialCanLikeProperty()
}
// NewGoToSocialGoToSocialCanReplyProperty creates a new GoToSocialCanReplyProperty
func NewGoToSocialCanReplyProperty() vocab.GoToSocialCanReplyProperty {
return propertycanreply.NewGoToSocialCanReplyProperty()
}
// NewGoToSocialGoToSocialInteractionPolicyProperty creates a new
// GoToSocialInteractionPolicyProperty
func NewGoToSocialInteractionPolicyProperty() vocab.GoToSocialInteractionPolicyProperty {
return propertyinteractionpolicy.NewGoToSocialInteractionPolicyProperty()
}

View file

@ -0,0 +1,31 @@
// Code generated by astool. DO NOT EDIT.
package streams
import (
typecanannounce "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce"
typecanlike "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike"
typecanreply "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply"
typeinteractionpolicy "github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy"
vocab "github.com/superseriousbusiness/activity/streams/vocab"
)
// NewGoToSocialCanAnnounce creates a new GoToSocialCanAnnounce
func NewGoToSocialCanAnnounce() vocab.GoToSocialCanAnnounce {
return typecanannounce.NewGoToSocialCanAnnounce()
}
// NewGoToSocialCanLike creates a new GoToSocialCanLike
func NewGoToSocialCanLike() vocab.GoToSocialCanLike {
return typecanlike.NewGoToSocialCanLike()
}
// NewGoToSocialCanReply creates a new GoToSocialCanReply
func NewGoToSocialCanReply() vocab.GoToSocialCanReply {
return typecanreply.NewGoToSocialCanReply()
}
// NewGoToSocialInteractionPolicy creates a new GoToSocialInteractionPolicy
func NewGoToSocialInteractionPolicy() vocab.GoToSocialInteractionPolicy {
return typeinteractionpolicy.NewGoToSocialInteractionPolicy()
}

View file

@ -73,6 +73,15 @@ func ToType(c context.Context, m map[string]interface{}) (t vocab.Type, err erro
}, func(ctx context.Context, i vocab.ActivityStreamsBlock) error {
t = i
return nil
}, func(ctx context.Context, i vocab.GoToSocialCanAnnounce) error {
t = i
return nil
}, func(ctx context.Context, i vocab.GoToSocialCanLike) error {
t = i
return nil
}, func(ctx context.Context, i vocab.GoToSocialCanReply) error {
t = i
return nil
}, func(ctx context.Context, i vocab.ActivityStreamsCollection) error {
t = i
return nil
@ -121,6 +130,9 @@ func ToType(c context.Context, m map[string]interface{}) (t vocab.Type, err erro
}, func(ctx context.Context, i vocab.ActivityStreamsImage) error {
t = i
return nil
}, func(ctx context.Context, i vocab.GoToSocialInteractionPolicy) error {
t = i
return nil
}, func(ctx context.Context, i vocab.ActivityStreamsIntransitiveActivity) error {
t = i
return nil

View file

@ -47,6 +47,12 @@ func NewTypePredicatedResolver(delegate Resolver, predicate interface{}) (*TypeP
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.ActivityStreamsBlock) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.GoToSocialCanAnnounce) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.GoToSocialCanLike) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.GoToSocialCanReply) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.ActivityStreamsCollection) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.ActivityStreamsCollectionPage) (bool, error):
@ -79,6 +85,8 @@ func NewTypePredicatedResolver(delegate Resolver, predicate interface{}) (*TypeP
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.ActivityStreamsImage) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.GoToSocialInteractionPolicy) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.ActivityStreamsIntransitiveActivity) (bool, error):
// Do nothing, this predicate has a correct signature.
case func(context.Context, vocab.ActivityStreamsInvite) (bool, error):
@ -267,6 +275,39 @@ func (this TypePredicatedResolver) Apply(ctx context.Context, o ActivityStreamsI
} else {
return false, ErrPredicateUnmatched
}
} else if o.VocabularyURI() == "https://gotosocial.org/ns" && o.GetTypeName() == "CanAnnounce" {
if fn, ok := this.predicate.(func(context.Context, vocab.GoToSocialCanAnnounce) (bool, error)); ok {
if v, ok := o.(vocab.GoToSocialCanAnnounce); ok {
predicatePasses, err = fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false, errCannotTypeAssertType
}
} else {
return false, ErrPredicateUnmatched
}
} else if o.VocabularyURI() == "https://gotosocial.org/ns" && o.GetTypeName() == "CanLike" {
if fn, ok := this.predicate.(func(context.Context, vocab.GoToSocialCanLike) (bool, error)); ok {
if v, ok := o.(vocab.GoToSocialCanLike); ok {
predicatePasses, err = fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false, errCannotTypeAssertType
}
} else {
return false, ErrPredicateUnmatched
}
} else if o.VocabularyURI() == "https://gotosocial.org/ns" && o.GetTypeName() == "CanReply" {
if fn, ok := this.predicate.(func(context.Context, vocab.GoToSocialCanReply) (bool, error)); ok {
if v, ok := o.(vocab.GoToSocialCanReply); ok {
predicatePasses, err = fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false, errCannotTypeAssertType
}
} else {
return false, ErrPredicateUnmatched
}
} else if o.VocabularyURI() == "https://www.w3.org/ns/activitystreams" && o.GetTypeName() == "Collection" {
if fn, ok := this.predicate.(func(context.Context, vocab.ActivityStreamsCollection) (bool, error)); ok {
if v, ok := o.(vocab.ActivityStreamsCollection); ok {
@ -443,6 +484,17 @@ func (this TypePredicatedResolver) Apply(ctx context.Context, o ActivityStreamsI
} else {
return false, ErrPredicateUnmatched
}
} else if o.VocabularyURI() == "https://gotosocial.org/ns" && o.GetTypeName() == "InteractionPolicy" {
if fn, ok := this.predicate.(func(context.Context, vocab.GoToSocialInteractionPolicy) (bool, error)); ok {
if v, ok := o.(vocab.GoToSocialInteractionPolicy); ok {
predicatePasses, err = fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false, errCannotTypeAssertType
}
} else {
return false, ErrPredicateUnmatched
}
} else if o.VocabularyURI() == "https://www.w3.org/ns/activitystreams" && o.GetTypeName() == "IntransitiveActivity" {
if fn, ok := this.predicate.(func(context.Context, vocab.ActivityStreamsIntransitiveActivity) (bool, error)); ok {
if v, ok := o.(vocab.ActivityStreamsIntransitiveActivity); ok {

View file

@ -46,6 +46,12 @@ func NewTypeResolver(callbacks ...interface{}) (*TypeResolver, error) {
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsBlock) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.GoToSocialCanAnnounce) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.GoToSocialCanLike) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.GoToSocialCanReply) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsCollection) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsCollectionPage) error:
@ -78,6 +84,8 @@ func NewTypeResolver(callbacks ...interface{}) (*TypeResolver, error) {
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsImage) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.GoToSocialInteractionPolicy) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsIntransitiveActivity) error:
// Do nothing, this callback has a correct signature.
case func(context.Context, vocab.ActivityStreamsInvite) error:
@ -244,6 +252,33 @@ func (this TypeResolver) Resolve(ctx context.Context, o ActivityStreamsInterface
return errCannotTypeAssertType
}
}
} else if o.VocabularyURI() == "https://gotosocial.org/ns" && o.GetTypeName() == "CanAnnounce" {
if fn, ok := i.(func(context.Context, vocab.GoToSocialCanAnnounce) error); ok {
if v, ok := o.(vocab.GoToSocialCanAnnounce); ok {
return fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return errCannotTypeAssertType
}
}
} else if o.VocabularyURI() == "https://gotosocial.org/ns" && o.GetTypeName() == "CanLike" {
if fn, ok := i.(func(context.Context, vocab.GoToSocialCanLike) error); ok {
if v, ok := o.(vocab.GoToSocialCanLike); ok {
return fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return errCannotTypeAssertType
}
}
} else if o.VocabularyURI() == "https://gotosocial.org/ns" && o.GetTypeName() == "CanReply" {
if fn, ok := i.(func(context.Context, vocab.GoToSocialCanReply) error); ok {
if v, ok := o.(vocab.GoToSocialCanReply); ok {
return fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return errCannotTypeAssertType
}
}
} else if o.VocabularyURI() == "https://www.w3.org/ns/activitystreams" && o.GetTypeName() == "Collection" {
if fn, ok := i.(func(context.Context, vocab.ActivityStreamsCollection) error); ok {
if v, ok := o.(vocab.ActivityStreamsCollection); ok {
@ -388,6 +423,15 @@ func (this TypeResolver) Resolve(ctx context.Context, o ActivityStreamsInterface
return errCannotTypeAssertType
}
}
} else if o.VocabularyURI() == "https://gotosocial.org/ns" && o.GetTypeName() == "InteractionPolicy" {
if fn, ok := i.(func(context.Context, vocab.GoToSocialInteractionPolicy) error); ok {
if v, ok := o.(vocab.GoToSocialInteractionPolicy); ok {
return fn(ctx, v)
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return errCannotTypeAssertType
}
}
} else if o.VocabularyURI() == "https://www.w3.org/ns/activitystreams" && o.GetTypeName() == "IntransitiveActivity" {
if fn, ok := i.(func(context.Context, vocab.ActivityStreamsIntransitiveActivity) error); ok {
if v, ok := o.(vocab.ActivityStreamsIntransitiveActivity); ok {

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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
}

View file

@ -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]
}

View file

@ -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

View file

@ -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
}

View file

@ -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]
}

View file

@ -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

View file

@ -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
}

View file

@ -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)
}

View file

@ -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

View file

@ -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
}

View file

@ -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]
}

View file

@ -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

View file

@ -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
}

View file

@ -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]
}

View file

@ -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

View file

@ -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
}

View file

@ -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]
}

View file

@ -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

View file

@ -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
}

View file

@ -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]
}

View file

@ -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

View file

@ -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
}

View file

@ -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
}

View file

@ -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

View file

@ -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
}

View file

@ -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
}

View file

@ -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

View file

@ -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
}

View file

@ -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
}

View file

@ -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

View file

@ -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
}

View file

@ -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
}

View file

@ -0,0 +1,130 @@
// Code generated by astool. DO NOT EDIT.
package vocab
import "net/url"
// GoToSocialAlwaysPropertyIterator represents a single value for the "always"
// property.
type GoToSocialAlwaysPropertyIterator interface {
// Get returns the value of this property. When IsXMLSchemaAnyURI returns
// false, Get will return any arbitrary value.
Get() *url.URL
// GetIRI returns the IRI of this property. When IsIRI returns false,
// GetIRI will return any arbitrary value.
GetIRI() *url.URL
// HasAny returns true if the value or IRI is set.
HasAny() bool
// IsIRI returns true if this property is an IRI.
IsIRI() bool
// IsXMLSchemaAnyURI returns true if this property is set and not an IRI.
IsXMLSchemaAnyURI() bool
// 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
// 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.
KindIndex() int
// 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.
LessThan(o GoToSocialAlwaysPropertyIterator) bool
// Name returns the name of this property: "GoToSocialAlways".
Name() string
// Next returns the next iterator, or nil if there is no next iterator.
Next() GoToSocialAlwaysPropertyIterator
// Prev returns the previous iterator, or nil if there is no previous
// iterator.
Prev() GoToSocialAlwaysPropertyIterator
// Set sets the value of this property. Calling IsXMLSchemaAnyURI
// afterwards will return true.
Set(v *url.URL)
// SetIRI sets the value of this property. Calling IsIRI afterwards will
// return true.
SetIRI(v *url.URL)
}
// Indicates zero or more URI/IDs that can perform an interaction without
// requiring approval by the Object AttributedTo Actor.
type GoToSocialAlwaysProperty interface {
// AppendIRI appends an IRI value to the back of a list of the property
// "always"
AppendIRI(v *url.URL)
// AppendXMLSchemaAnyURI appends a anyURI value to the back of a list of
// the property "always". Invalidates iterators that are traversing
// using Prev.
AppendXMLSchemaAnyURI(v *url.URL)
// At returns the property value for the specified index. Panics if the
// index is out of bounds.
At(index int) GoToSocialAlwaysPropertyIterator
// 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.
Begin() GoToSocialAlwaysPropertyIterator
// Empty returns returns true if there are no elements.
Empty() bool
// 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.
End() GoToSocialAlwaysPropertyIterator
// 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.
InsertIRI(idx int, v *url.URL)
// 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.
InsertXMLSchemaAnyURI(idx int, v *url.URL)
// 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
// 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.
KindIndex(idx int) int
// Len returns the number of values that exist for the "always" property.
Len() (length int)
// Less computes whether another property is less than this one. Mixing
// types results in a consistent but arbitrary ordering
Less(i, j int) bool
// 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.
LessThan(o GoToSocialAlwaysProperty) bool
// Name returns the name of this property ("always") with any alias.
Name() string
// PrependIRI prepends an IRI value to the front of a list of the property
// "always".
PrependIRI(v *url.URL)
// PrependXMLSchemaAnyURI prepends a anyURI value to the front of a list
// of the property "always". Invalidates all iterators.
PrependXMLSchemaAnyURI(v *url.URL)
// 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.
Remove(idx int)
// 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.
Serialize() (interface{}, error)
// 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.
Set(idx int, v *url.URL)
// SetIRI sets an IRI value to be at the specified index for the property
// "always". Panics if the index is out of bounds.
SetIRI(idx int, v *url.URL)
// Swap swaps the location of values at two indices for the "always"
// property.
Swap(i, j int)
}

View file

@ -0,0 +1,132 @@
// Code generated by astool. DO NOT EDIT.
package vocab
import "net/url"
// GoToSocialApprovalRequiredPropertyIterator represents a single value for the
// "approvalRequired" property.
type GoToSocialApprovalRequiredPropertyIterator interface {
// Get returns the value of this property. When IsXMLSchemaAnyURI returns
// false, Get will return any arbitrary value.
Get() *url.URL
// GetIRI returns the IRI of this property. When IsIRI returns false,
// GetIRI will return any arbitrary value.
GetIRI() *url.URL
// HasAny returns true if the value or IRI is set.
HasAny() bool
// IsIRI returns true if this property is an IRI.
IsIRI() bool
// IsXMLSchemaAnyURI returns true if this property is set and not an IRI.
IsXMLSchemaAnyURI() bool
// 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
// 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.
KindIndex() int
// 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.
LessThan(o GoToSocialApprovalRequiredPropertyIterator) bool
// Name returns the name of this property: "GoToSocialApprovalRequired".
Name() string
// Next returns the next iterator, or nil if there is no next iterator.
Next() GoToSocialApprovalRequiredPropertyIterator
// Prev returns the previous iterator, or nil if there is no previous
// iterator.
Prev() GoToSocialApprovalRequiredPropertyIterator
// Set sets the value of this property. Calling IsXMLSchemaAnyURI
// afterwards will return true.
Set(v *url.URL)
// SetIRI sets the value of this property. Calling IsIRI afterwards will
// return true.
SetIRI(v *url.URL)
}
// Indicates zero or more URI/IDs that require approval by the Object AttributedTo
// Actor in order to perform an interaction.
type GoToSocialApprovalRequiredProperty interface {
// AppendIRI appends an IRI value to the back of a list of the property
// "approvalRequired"
AppendIRI(v *url.URL)
// AppendXMLSchemaAnyURI appends a anyURI value to the back of a list of
// the property "approvalRequired". Invalidates iterators that are
// traversing using Prev.
AppendXMLSchemaAnyURI(v *url.URL)
// At returns the property value for the specified index. Panics if the
// index is out of bounds.
At(index int) GoToSocialApprovalRequiredPropertyIterator
// 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.
Begin() GoToSocialApprovalRequiredPropertyIterator
// Empty returns returns true if there are no elements.
Empty() bool
// 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.
End() GoToSocialApprovalRequiredPropertyIterator
// 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.
InsertIRI(idx int, v *url.URL)
// 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.
InsertXMLSchemaAnyURI(idx int, v *url.URL)
// 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
// 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.
KindIndex(idx int) int
// Len returns the number of values that exist for the "approvalRequired"
// property.
Len() (length int)
// Less computes whether another property is less than this one. Mixing
// types results in a consistent but arbitrary ordering
Less(i, j int) bool
// 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.
LessThan(o GoToSocialApprovalRequiredProperty) bool
// Name returns the name of this property ("approvalRequired") with any
// alias.
Name() string
// PrependIRI prepends an IRI value to the front of a list of the property
// "approvalRequired".
PrependIRI(v *url.URL)
// PrependXMLSchemaAnyURI prepends a anyURI value to the front of a list
// of the property "approvalRequired". Invalidates all iterators.
PrependXMLSchemaAnyURI(v *url.URL)
// 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.
Remove(idx int)
// 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.
Serialize() (interface{}, error)
// 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.
Set(idx int, v *url.URL)
// SetIRI sets an IRI value to be at the specified index for the property
// "approvalRequired". Panics if the index is out of bounds.
SetIRI(idx int, v *url.URL)
// Swap swaps the location of values at two indices for the
// "approvalRequired" property.
Swap(i, j int)
}

View file

@ -0,0 +1,55 @@
// Code generated by astool. DO NOT EDIT.
package vocab
import "net/url"
// URI/ID of an Approve Activity, which itself points towards the ID of the
// Activity or Object to which this property is attached. The presence of this
// property on an Activity or Object indicates that an interaction has been
// Approve'd by the Actor whose Object this Activity or Object interacts with.
type GoToSocialApprovedByProperty interface {
// Clear ensures no value of this property is set. Calling
// IsXMLSchemaAnyURI afterwards will return false.
Clear()
// Get returns the value of this property. When IsXMLSchemaAnyURI returns
// false, Get will return any arbitrary value.
Get() *url.URL
// GetIRI returns the IRI of this property. When IsIRI returns false,
// GetIRI will return any arbitrary value.
GetIRI() *url.URL
// HasAny returns true if the value or IRI is set.
HasAny() bool
// IsIRI returns true if this property is an IRI.
IsIRI() bool
// IsXMLSchemaAnyURI returns true if this property is set and not an IRI.
IsXMLSchemaAnyURI() bool
// 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
// 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.
KindIndex() int
// 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.
LessThan(o GoToSocialApprovedByProperty) bool
// Name returns the name of this property: "approvedBy".
Name() string
// 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.
Serialize() (interface{}, error)
// Set sets the value of this property. Calling IsXMLSchemaAnyURI
// afterwards will return true.
Set(v *url.URL)
// SetIRI sets the value of this property. Calling IsIRI afterwards will
// return true.
SetIRI(v *url.URL)
}

View file

@ -0,0 +1,158 @@
// Code generated by astool. DO NOT EDIT.
package vocab
import "net/url"
// GoToSocialCanAnnouncePropertyIterator represents a single value for the
// "canAnnounce" property.
type GoToSocialCanAnnouncePropertyIterator interface {
// Get returns the value of this property. When IsGoToSocialCanAnnounce
// returns false, Get will return any arbitrary value.
Get() GoToSocialCanAnnounce
// GetIRI returns the IRI of this property. When IsIRI returns false,
// GetIRI will return any arbitrary value.
GetIRI() *url.URL
// 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.
GetType() Type
// HasAny returns true if the value or IRI is set.
HasAny() bool
// IsGoToSocialCanAnnounce returns true if this property is set and not an
// IRI.
IsGoToSocialCanAnnounce() bool
// IsIRI returns true if this property is an IRI.
IsIRI() bool
// 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
// 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.
KindIndex() int
// 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.
LessThan(o GoToSocialCanAnnouncePropertyIterator) bool
// Name returns the name of this property: "GoToSocialCanAnnounce".
Name() string
// Next returns the next iterator, or nil if there is no next iterator.
Next() GoToSocialCanAnnouncePropertyIterator
// Prev returns the previous iterator, or nil if there is no previous
// iterator.
Prev() GoToSocialCanAnnouncePropertyIterator
// Set sets the value of this property. Calling IsGoToSocialCanAnnounce
// afterwards will return true.
Set(v GoToSocialCanAnnounce)
// SetIRI sets the value of this property. Calling IsIRI afterwards will
// return true.
SetIRI(v *url.URL)
// 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.
SetType(t Type) error
}
// Defines who can Announce with an object property set to the URI/ID of the
// Object to which this interactionPolicy is attached.
type GoToSocialCanAnnounceProperty interface {
// AppendGoToSocialCanAnnounce appends a CanAnnounce value to the back of
// a list of the property "canAnnounce". Invalidates iterators that
// are traversing using Prev.
AppendGoToSocialCanAnnounce(v GoToSocialCanAnnounce)
// AppendIRI appends an IRI value to the back of a list of the property
// "canAnnounce"
AppendIRI(v *url.URL)
// 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.
AppendType(t Type) error
// At returns the property value for the specified index. Panics if the
// index is out of bounds.
At(index int) GoToSocialCanAnnouncePropertyIterator
// 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.
Begin() GoToSocialCanAnnouncePropertyIterator
// Empty returns returns true if there are no elements.
Empty() bool
// 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.
End() GoToSocialCanAnnouncePropertyIterator
// 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.
InsertGoToSocialCanAnnounce(idx int, v GoToSocialCanAnnounce)
// 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.
InsertIRI(idx int, v *url.URL)
// 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.
InsertType(idx int, t Type) error
// 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
// 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.
KindIndex(idx int) int
// Len returns the number of values that exist for the "canAnnounce"
// property.
Len() (length int)
// Less computes whether another property is less than this one. Mixing
// types results in a consistent but arbitrary ordering
Less(i, j int) bool
// 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.
LessThan(o GoToSocialCanAnnounceProperty) bool
// Name returns the name of this property ("canAnnounce") with any alias.
Name() string
// PrependGoToSocialCanAnnounce prepends a CanAnnounce value to the front
// of a list of the property "canAnnounce". Invalidates all iterators.
PrependGoToSocialCanAnnounce(v GoToSocialCanAnnounce)
// PrependIRI prepends an IRI value to the front of a list of the property
// "canAnnounce".
PrependIRI(v *url.URL)
// 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.
PrependType(t Type) error
// 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.
Remove(idx int)
// 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.
Serialize() (interface{}, error)
// 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.
Set(idx int, v GoToSocialCanAnnounce)
// SetIRI sets an IRI value to be at the specified index for the property
// "canAnnounce". Panics if the index is out of bounds.
SetIRI(idx int, v *url.URL)
// 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.
SetType(idx int, t Type) error
// Swap swaps the location of values at two indices for the "canAnnounce"
// property.
Swap(i, j int)
}

View file

@ -0,0 +1,155 @@
// Code generated by astool. DO NOT EDIT.
package vocab
import "net/url"
// GoToSocialCanLikePropertyIterator represents a single value for the "canLike"
// property.
type GoToSocialCanLikePropertyIterator interface {
// Get returns the value of this property. When IsGoToSocialCanLike
// returns false, Get will return any arbitrary value.
Get() GoToSocialCanLike
// GetIRI returns the IRI of this property. When IsIRI returns false,
// GetIRI will return any arbitrary value.
GetIRI() *url.URL
// 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.
GetType() Type
// HasAny returns true if the value or IRI is set.
HasAny() bool
// IsGoToSocialCanLike returns true if this property is set and not an IRI.
IsGoToSocialCanLike() bool
// IsIRI returns true if this property is an IRI.
IsIRI() bool
// 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
// 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.
KindIndex() int
// 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.
LessThan(o GoToSocialCanLikePropertyIterator) bool
// Name returns the name of this property: "GoToSocialCanLike".
Name() string
// Next returns the next iterator, or nil if there is no next iterator.
Next() GoToSocialCanLikePropertyIterator
// Prev returns the previous iterator, or nil if there is no previous
// iterator.
Prev() GoToSocialCanLikePropertyIterator
// Set sets the value of this property. Calling IsGoToSocialCanLike
// afterwards will return true.
Set(v GoToSocialCanLike)
// SetIRI sets the value of this property. Calling IsIRI afterwards will
// return true.
SetIRI(v *url.URL)
// 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.
SetType(t Type) error
}
// Defines who can Like with an object property set to the URI/ID of the Object to
// which this interactionPolicy is attached.
type GoToSocialCanLikeProperty interface {
// AppendGoToSocialCanLike appends a CanLike value to the back of a list
// of the property "canLike". Invalidates iterators that are
// traversing using Prev.
AppendGoToSocialCanLike(v GoToSocialCanLike)
// AppendIRI appends an IRI value to the back of a list of the property
// "canLike"
AppendIRI(v *url.URL)
// 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.
AppendType(t Type) error
// At returns the property value for the specified index. Panics if the
// index is out of bounds.
At(index int) GoToSocialCanLikePropertyIterator
// 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.
Begin() GoToSocialCanLikePropertyIterator
// Empty returns returns true if there are no elements.
Empty() bool
// 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.
End() GoToSocialCanLikePropertyIterator
// 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.
InsertGoToSocialCanLike(idx int, v GoToSocialCanLike)
// 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.
InsertIRI(idx int, v *url.URL)
// 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.
InsertType(idx int, t Type) error
// 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
// 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.
KindIndex(idx int) int
// Len returns the number of values that exist for the "canLike" property.
Len() (length int)
// Less computes whether another property is less than this one. Mixing
// types results in a consistent but arbitrary ordering
Less(i, j int) bool
// 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.
LessThan(o GoToSocialCanLikeProperty) bool
// Name returns the name of this property ("canLike") with any alias.
Name() string
// PrependGoToSocialCanLike prepends a CanLike value to the front of a
// list of the property "canLike". Invalidates all iterators.
PrependGoToSocialCanLike(v GoToSocialCanLike)
// PrependIRI prepends an IRI value to the front of a list of the property
// "canLike".
PrependIRI(v *url.URL)
// 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.
PrependType(t Type) error
// 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.
Remove(idx int)
// 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.
Serialize() (interface{}, error)
// 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.
Set(idx int, v GoToSocialCanLike)
// SetIRI sets an IRI value to be at the specified index for the property
// "canLike". Panics if the index is out of bounds.
SetIRI(idx int, v *url.URL)
// 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.
SetType(idx int, t Type) error
// Swap swaps the location of values at two indices for the "canLike"
// property.
Swap(i, j int)
}

View file

@ -0,0 +1,156 @@
// Code generated by astool. DO NOT EDIT.
package vocab
import "net/url"
// GoToSocialCanReplyPropertyIterator represents a single value for the "canReply"
// property.
type GoToSocialCanReplyPropertyIterator interface {
// Get returns the value of this property. When IsGoToSocialCanReply
// returns false, Get will return any arbitrary value.
Get() GoToSocialCanReply
// GetIRI returns the IRI of this property. When IsIRI returns false,
// GetIRI will return any arbitrary value.
GetIRI() *url.URL
// 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.
GetType() Type
// HasAny returns true if the value or IRI is set.
HasAny() bool
// IsGoToSocialCanReply returns true if this property is set and not an
// IRI.
IsGoToSocialCanReply() bool
// IsIRI returns true if this property is an IRI.
IsIRI() bool
// 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
// 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.
KindIndex() int
// 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.
LessThan(o GoToSocialCanReplyPropertyIterator) bool
// Name returns the name of this property: "GoToSocialCanReply".
Name() string
// Next returns the next iterator, or nil if there is no next iterator.
Next() GoToSocialCanReplyPropertyIterator
// Prev returns the previous iterator, or nil if there is no previous
// iterator.
Prev() GoToSocialCanReplyPropertyIterator
// Set sets the value of this property. Calling IsGoToSocialCanReply
// afterwards will return true.
Set(v GoToSocialCanReply)
// SetIRI sets the value of this property. Calling IsIRI afterwards will
// return true.
SetIRI(v *url.URL)
// 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.
SetType(t Type) error
}
// Defines who can Create a new Object with an inReplyTo property set to the
// URI/ID of the Object to which this interactionPolicy is attached.
type GoToSocialCanReplyProperty interface {
// AppendGoToSocialCanReply appends a CanReply value to the back of a list
// of the property "canReply". Invalidates iterators that are
// traversing using Prev.
AppendGoToSocialCanReply(v GoToSocialCanReply)
// AppendIRI appends an IRI value to the back of a list of the property
// "canReply"
AppendIRI(v *url.URL)
// 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.
AppendType(t Type) error
// At returns the property value for the specified index. Panics if the
// index is out of bounds.
At(index int) GoToSocialCanReplyPropertyIterator
// 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.
Begin() GoToSocialCanReplyPropertyIterator
// Empty returns returns true if there are no elements.
Empty() bool
// 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.
End() GoToSocialCanReplyPropertyIterator
// 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.
InsertGoToSocialCanReply(idx int, v GoToSocialCanReply)
// 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.
InsertIRI(idx int, v *url.URL)
// 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.
InsertType(idx int, t Type) error
// 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
// 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.
KindIndex(idx int) int
// Len returns the number of values that exist for the "canReply" property.
Len() (length int)
// Less computes whether another property is less than this one. Mixing
// types results in a consistent but arbitrary ordering
Less(i, j int) bool
// 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.
LessThan(o GoToSocialCanReplyProperty) bool
// Name returns the name of this property ("canReply") with any alias.
Name() string
// PrependGoToSocialCanReply prepends a CanReply value to the front of a
// list of the property "canReply". Invalidates all iterators.
PrependGoToSocialCanReply(v GoToSocialCanReply)
// PrependIRI prepends an IRI value to the front of a list of the property
// "canReply".
PrependIRI(v *url.URL)
// 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.
PrependType(t Type) error
// 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.
Remove(idx int)
// 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.
Serialize() (interface{}, error)
// 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.
Set(idx int, v GoToSocialCanReply)
// SetIRI sets an IRI value to be at the specified index for the property
// "canReply". Panics if the index is out of bounds.
SetIRI(idx int, v *url.URL)
// 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.
SetType(idx int, t Type) error
// Swap swaps the location of values at two indices for the "canReply"
// property.
Swap(i, j int)
}

View file

@ -0,0 +1,164 @@
// Code generated by astool. DO NOT EDIT.
package vocab
import "net/url"
// GoToSocialInteractionPolicyPropertyIterator represents a single value for the
// "interactionPolicy" property.
type GoToSocialInteractionPolicyPropertyIterator interface {
// Get returns the value of this property. When
// IsGoToSocialInteractionPolicy returns false, Get will return any
// arbitrary value.
Get() GoToSocialInteractionPolicy
// GetIRI returns the IRI of this property. When IsIRI returns false,
// GetIRI will return any arbitrary value.
GetIRI() *url.URL
// 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.
GetType() Type
// HasAny returns true if the value or IRI is set.
HasAny() bool
// IsGoToSocialInteractionPolicy returns true if this property is set and
// not an IRI.
IsGoToSocialInteractionPolicy() bool
// IsIRI returns true if this property is an IRI.
IsIRI() bool
// 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
// 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.
KindIndex() int
// 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.
LessThan(o GoToSocialInteractionPolicyPropertyIterator) bool
// Name returns the name of this property: "GoToSocialInteractionPolicy".
Name() string
// Next returns the next iterator, or nil if there is no next iterator.
Next() GoToSocialInteractionPolicyPropertyIterator
// Prev returns the previous iterator, or nil if there is no previous
// iterator.
Prev() GoToSocialInteractionPolicyPropertyIterator
// Set sets the value of this property. Calling
// IsGoToSocialInteractionPolicy afterwards will return true.
Set(v GoToSocialInteractionPolicy)
// SetIRI sets the value of this property. Calling IsIRI afterwards will
// return true.
SetIRI(v *url.URL)
// 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.
SetType(t Type) error
}
// InteractionPolicy for an ActivityStreams Object.
//
// null
type GoToSocialInteractionPolicyProperty interface {
// AppendGoToSocialInteractionPolicy appends a InteractionPolicy value to
// the back of a list of the property "interactionPolicy". Invalidates
// iterators that are traversing using Prev.
AppendGoToSocialInteractionPolicy(v GoToSocialInteractionPolicy)
// AppendIRI appends an IRI value to the back of a list of the property
// "interactionPolicy"
AppendIRI(v *url.URL)
// 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.
AppendType(t Type) error
// At returns the property value for the specified index. Panics if the
// index is out of bounds.
At(index int) GoToSocialInteractionPolicyPropertyIterator
// 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.
Begin() GoToSocialInteractionPolicyPropertyIterator
// Empty returns returns true if there are no elements.
Empty() bool
// 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.
End() GoToSocialInteractionPolicyPropertyIterator
// 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.
InsertGoToSocialInteractionPolicy(idx int, v GoToSocialInteractionPolicy)
// 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.
InsertIRI(idx int, v *url.URL)
// 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.
InsertType(idx int, t Type) error
// 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
// 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.
KindIndex(idx int) int
// Len returns the number of values that exist for the "interactionPolicy"
// property.
Len() (length int)
// Less computes whether another property is less than this one. Mixing
// types results in a consistent but arbitrary ordering
Less(i, j int) bool
// 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.
LessThan(o GoToSocialInteractionPolicyProperty) bool
// Name returns the name of this property ("interactionPolicy") with any
// alias.
Name() string
// PrependGoToSocialInteractionPolicy prepends a InteractionPolicy value
// to the front of a list of the property "interactionPolicy".
// Invalidates all iterators.
PrependGoToSocialInteractionPolicy(v GoToSocialInteractionPolicy)
// PrependIRI prepends an IRI value to the front of a list of the property
// "interactionPolicy".
PrependIRI(v *url.URL)
// 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.
PrependType(t Type) error
// 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.
Remove(idx int)
// 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.
Serialize() (interface{}, error)
// 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.
Set(idx int, v GoToSocialInteractionPolicy)
// SetIRI sets an IRI value to be at the specified index for the property
// "interactionPolicy". Panics if the index is out of bounds.
SetIRI(idx int, v *url.URL)
// 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.
SetType(idx int, t Type) error
// Swap swaps the location of values at two indices for the
// "interactionPolicy" property.
Swap(i, j int)
}

View file

@ -109,6 +109,12 @@ type ActivityStreamsArticle interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -201,6 +207,10 @@ type ActivityStreamsArticle interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -111,6 +111,12 @@ type ActivityStreamsAudio interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -205,6 +211,10 @@ type ActivityStreamsAudio interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -107,6 +107,12 @@ type ActivityStreamsDocument interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -202,6 +208,10 @@ type ActivityStreamsDocument interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -108,6 +108,12 @@ type ActivityStreamsEvent interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -199,6 +205,10 @@ type ActivityStreamsEvent interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -124,6 +124,12 @@ type ActivityStreamsImage interface {
// GetActivityStreamsWidth returns the "width" property if it exists, and
// nil otherwise.
GetActivityStreamsWidth() ActivityStreamsWidthProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -222,6 +228,10 @@ type ActivityStreamsImage interface {
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetActivityStreamsWidth sets the "width" property.
SetActivityStreamsWidth(i ActivityStreamsWidthProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -127,6 +127,9 @@ type ActivityStreamsLike interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -228,6 +231,8 @@ type ActivityStreamsLike interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -108,6 +108,12 @@ type ActivityStreamsNote interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -199,6 +205,10 @@ type ActivityStreamsNote interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -107,6 +107,12 @@ type ActivityStreamsPage interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -201,6 +207,10 @@ type ActivityStreamsPage interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -132,6 +132,12 @@ type ActivityStreamsPlace interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -233,6 +239,10 @@ type ActivityStreamsPlace interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -115,6 +115,12 @@ type ActivityStreamsProfile interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -209,6 +215,10 @@ type ActivityStreamsProfile interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -149,6 +149,12 @@ type ActivityStreamsQuestion interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -258,6 +264,10 @@ type ActivityStreamsQuestion interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -108,6 +108,12 @@ type ActivityStreamsVideo interface {
// GetActivityStreamsUrl returns the "url" property if it exists, and nil
// otherwise.
GetActivityStreamsUrl() ActivityStreamsUrlProperty
// GetGoToSocialApprovedBy returns the "approvedBy" property if it exists,
// and nil otherwise.
GetGoToSocialApprovedBy() GoToSocialApprovedByProperty
// GetGoToSocialInteractionPolicy returns the "interactionPolicy" property
// if it exists, and nil otherwise.
GetGoToSocialInteractionPolicy() GoToSocialInteractionPolicyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetJSONLDType returns the "type" property if it exists, and nil
@ -202,6 +208,10 @@ type ActivityStreamsVideo interface {
SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty)
// SetActivityStreamsUrl sets the "url" property.
SetActivityStreamsUrl(i ActivityStreamsUrlProperty)
// SetGoToSocialApprovedBy sets the "approvedBy" property.
SetGoToSocialApprovedBy(i GoToSocialApprovedByProperty)
// SetGoToSocialInteractionPolicy sets the "interactionPolicy" property.
SetGoToSocialInteractionPolicy(i GoToSocialInteractionPolicyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// SetJSONLDType sets the "type" property.

View file

@ -0,0 +1,45 @@
// Code generated by astool. DO NOT EDIT.
package vocab
type GoToSocialCanAnnounce interface {
// GetGoToSocialAlways returns the "always" property if it exists, and nil
// otherwise.
GetGoToSocialAlways() GoToSocialAlwaysProperty
// GetGoToSocialApprovalRequired returns the "approvalRequired" property
// if it exists, and nil otherwise.
GetGoToSocialApprovalRequired() GoToSocialApprovalRequiredProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetTypeName returns the name of this type.
GetTypeName() string
// 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.
GetUnknownProperties() map[string]interface{}
// IsExtending returns true if the CanAnnounce type extends from the other
// type.
IsExtending(other Type) bool
// 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.
JSONLDContext() map[string]string
// LessThan computes if this CanAnnounce is lesser, with an arbitrary but
// stable determination.
LessThan(o GoToSocialCanAnnounce) bool
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format.
Serialize() (map[string]interface{}, error)
// SetGoToSocialAlways sets the "always" property.
SetGoToSocialAlways(i GoToSocialAlwaysProperty)
// SetGoToSocialApprovalRequired sets the "approvalRequired" property.
SetGoToSocialApprovalRequired(i GoToSocialApprovalRequiredProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// VocabularyURI returns the vocabulary's URI as a string.
VocabularyURI() string
}

View file

@ -0,0 +1,45 @@
// Code generated by astool. DO NOT EDIT.
package vocab
type GoToSocialCanLike interface {
// GetGoToSocialAlways returns the "always" property if it exists, and nil
// otherwise.
GetGoToSocialAlways() GoToSocialAlwaysProperty
// GetGoToSocialApprovalRequired returns the "approvalRequired" property
// if it exists, and nil otherwise.
GetGoToSocialApprovalRequired() GoToSocialApprovalRequiredProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetTypeName returns the name of this type.
GetTypeName() string
// 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.
GetUnknownProperties() map[string]interface{}
// IsExtending returns true if the CanLike type extends from the other
// type.
IsExtending(other Type) bool
// 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.
JSONLDContext() map[string]string
// LessThan computes if this CanLike is lesser, with an arbitrary but
// stable determination.
LessThan(o GoToSocialCanLike) bool
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format.
Serialize() (map[string]interface{}, error)
// SetGoToSocialAlways sets the "always" property.
SetGoToSocialAlways(i GoToSocialAlwaysProperty)
// SetGoToSocialApprovalRequired sets the "approvalRequired" property.
SetGoToSocialApprovalRequired(i GoToSocialApprovalRequiredProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// VocabularyURI returns the vocabulary's URI as a string.
VocabularyURI() string
}

View file

@ -0,0 +1,45 @@
// Code generated by astool. DO NOT EDIT.
package vocab
type GoToSocialCanReply interface {
// GetGoToSocialAlways returns the "always" property if it exists, and nil
// otherwise.
GetGoToSocialAlways() GoToSocialAlwaysProperty
// GetGoToSocialApprovalRequired returns the "approvalRequired" property
// if it exists, and nil otherwise.
GetGoToSocialApprovalRequired() GoToSocialApprovalRequiredProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetTypeName returns the name of this type.
GetTypeName() string
// 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.
GetUnknownProperties() map[string]interface{}
// IsExtending returns true if the CanReply type extends from the other
// type.
IsExtending(other Type) bool
// 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.
JSONLDContext() map[string]string
// LessThan computes if this CanReply is lesser, with an arbitrary but
// stable determination.
LessThan(o GoToSocialCanReply) bool
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format.
Serialize() (map[string]interface{}, error)
// SetGoToSocialAlways sets the "always" property.
SetGoToSocialAlways(i GoToSocialAlwaysProperty)
// SetGoToSocialApprovalRequired sets the "approvalRequired" property.
SetGoToSocialApprovalRequired(i GoToSocialApprovalRequiredProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// VocabularyURI returns the vocabulary's URI as a string.
VocabularyURI() string
}

View file

@ -0,0 +1,51 @@
// Code generated by astool. DO NOT EDIT.
package vocab
// InteractionPolicy for an ActivityStreams Object.
type GoToSocialInteractionPolicy interface {
// GetGoToSocialCanAnnounce returns the "canAnnounce" property if it
// exists, and nil otherwise.
GetGoToSocialCanAnnounce() GoToSocialCanAnnounceProperty
// GetGoToSocialCanLike returns the "canLike" property if it exists, and
// nil otherwise.
GetGoToSocialCanLike() GoToSocialCanLikeProperty
// GetGoToSocialCanReply returns the "canReply" property if it exists, and
// nil otherwise.
GetGoToSocialCanReply() GoToSocialCanReplyProperty
// GetJSONLDId returns the "id" property if it exists, and nil otherwise.
GetJSONLDId() JSONLDIdProperty
// GetTypeName returns the name of this type.
GetTypeName() string
// 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.
GetUnknownProperties() map[string]interface{}
// IsExtending returns true if the InteractionPolicy type extends from the
// other type.
IsExtending(other Type) bool
// 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.
JSONLDContext() map[string]string
// LessThan computes if this InteractionPolicy is lesser, with an
// arbitrary but stable determination.
LessThan(o GoToSocialInteractionPolicy) bool
// Serialize converts this into an interface representation suitable for
// marshalling into a text or binary format.
Serialize() (map[string]interface{}, error)
// SetGoToSocialCanAnnounce sets the "canAnnounce" property.
SetGoToSocialCanAnnounce(i GoToSocialCanAnnounceProperty)
// SetGoToSocialCanLike sets the "canLike" property.
SetGoToSocialCanLike(i GoToSocialCanLikeProperty)
// SetGoToSocialCanReply sets the "canReply" property.
SetGoToSocialCanReply(i GoToSocialCanReplyProperty)
// SetJSONLDId sets the "id" property.
SetJSONLDId(i JSONLDIdProperty)
// VocabularyURI returns the vocabulary's URI as a string.
VocabularyURI() string
}

13
vendor/modules.txt vendored
View file

@ -636,7 +636,7 @@ github.com/stretchr/testify/suite
# github.com/subosito/gotenv v1.6.0
## explicit; go 1.18
github.com/subosito/gotenv
# github.com/superseriousbusiness/activity v1.6.0-gts.0.20240408131430-247f7f7110f0
# github.com/superseriousbusiness/activity v1.7.0-gts
## explicit; go 1.18
github.com/superseriousbusiness/activity/pub
github.com/superseriousbusiness/activity/streams
@ -772,6 +772,17 @@ github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_undo
github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_update
github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_video
github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_view
github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_always
github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvalrequired
github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_approvedby
github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canannounce
github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canlike
github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_canreply
github.com/superseriousbusiness/activity/streams/impl/gotosocial/property_interactionpolicy
github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canannounce
github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canlike
github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_canreply
github.com/superseriousbusiness/activity/streams/impl/gotosocial/type_interactionpolicy
github.com/superseriousbusiness/activity/streams/impl/jsonld/property_id
github.com/superseriousbusiness/activity/streams/impl/jsonld/property_type
github.com/superseriousbusiness/activity/streams/impl/schema/property_value