diff options
Diffstat (limited to 'vendor/github.com/superseriousbusiness/activity/streams/impl/toot')
7 files changed, 838 insertions, 276 deletions
diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_emoji/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_emoji/gen_pkg.go index 44cab9702..c43347c62 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_emoji/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_emoji/gen_pkg.go @@ -132,22 +132,10 @@ type privateManager interface { // method for the "ActivityStreamsTagProperty" non-functional property // in the vocabulary "ActivityStreams" DeserializeTagPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTagProperty, error) - // DeserializeTeamPropertyForgeFed returns the deserialization method for - // the "ForgeFedTeamProperty" non-functional property in the - // vocabulary "ForgeFed" - DeserializeTeamPropertyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTeamProperty, error) - // DeserializeTicketsTrackedByPropertyForgeFed returns the deserialization - // method for the "ForgeFedTicketsTrackedByProperty" non-functional - // property in the vocabulary "ForgeFed" - DeserializeTicketsTrackedByPropertyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketsTrackedByProperty, error) // DeserializeToPropertyActivityStreams returns the deserialization method // for the "ActivityStreamsToProperty" non-functional property in the // vocabulary "ActivityStreams" DeserializeToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsToProperty, error) - // DeserializeTracksTicketsForPropertyForgeFed returns the deserialization - // method for the "ForgeFedTracksTicketsForProperty" non-functional - // property in the vocabulary "ForgeFed" - DeserializeTracksTicketsForPropertyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTracksTicketsForProperty, error) // DeserializeTypePropertyJSONLD returns the deserialization method for // the "JSONLDTypeProperty" non-functional property in the vocabulary // "JSONLD" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_emoji/gen_type_toot_emoji.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_emoji/gen_type_toot_emoji.go index 22f89939b..797649b0b 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_emoji/gen_type_toot_emoji.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_emoji/gen_type_toot_emoji.go @@ -58,10 +58,7 @@ type TootEmoji struct { ActivityStreamsStartTime vocab.ActivityStreamsStartTimeProperty ActivityStreamsSummary vocab.ActivityStreamsSummaryProperty ActivityStreamsTag vocab.ActivityStreamsTagProperty - ForgeFedTeam vocab.ForgeFedTeamProperty - ForgeFedTicketsTrackedBy vocab.ForgeFedTicketsTrackedByProperty ActivityStreamsTo vocab.ActivityStreamsToProperty - ForgeFedTracksTicketsFor vocab.ForgeFedTracksTicketsForProperty JSONLDType vocab.JSONLDTypeProperty ActivityStreamsUpdated vocab.ActivityStreamsUpdatedProperty ActivityStreamsUrl vocab.ActivityStreamsUrlProperty @@ -256,26 +253,11 @@ func DeserializeEmoji(m map[string]interface{}, aliasMap map[string]string) (*To } else if p != nil { this.ActivityStreamsTag = p } - if p, err := mgr.DeserializeTeamPropertyForgeFed()(m, aliasMap); err != nil { - return nil, err - } else if p != nil { - this.ForgeFedTeam = p - } - if p, err := mgr.DeserializeTicketsTrackedByPropertyForgeFed()(m, aliasMap); err != nil { - return nil, err - } else if p != nil { - this.ForgeFedTicketsTrackedBy = p - } if p, err := mgr.DeserializeToPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { this.ActivityStreamsTo = p } - if p, err := mgr.DeserializeTracksTicketsForPropertyForgeFed()(m, aliasMap); err != nil { - return nil, err - } else if p != nil { - this.ForgeFedTracksTicketsFor = p - } if p, err := mgr.DeserializeTypePropertyJSONLD()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -362,14 +344,8 @@ func DeserializeEmoji(m map[string]interface{}, aliasMap map[string]string) (*To continue } else if k == "tag" { continue - } else if k == "team" { - continue - } else if k == "ticketsTrackedBy" { - continue } else if k == "to" { continue - } else if k == "tracksTicketsFor" { - continue } else if k == "type" { continue } else if k == "updated" { @@ -388,7 +364,7 @@ func DeserializeEmoji(m map[string]interface{}, aliasMap map[string]string) (*To // EmojiIsDisjointWith returns true if the other provided type is disjoint with // the Emoji type. func EmojiIsDisjointWith(other vocab.Type) bool { - disjointWith := []string{"Link", "Mention"} + disjointWith := []string{"Hashtag", "Link", "Mention"} for _, disjoint := range disjointWith { if disjoint == other.GetTypeName() { return true @@ -626,23 +602,6 @@ func (this TootEmoji) GetActivityStreamsUrl() vocab.ActivityStreamsUrlProperty { return this.ActivityStreamsUrl } -// GetForgeFedTeam returns the "team" property if it exists, and nil otherwise. -func (this TootEmoji) GetForgeFedTeam() vocab.ForgeFedTeamProperty { - return this.ForgeFedTeam -} - -// GetForgeFedTicketsTrackedBy returns the "ticketsTrackedBy" property if it -// exists, and nil otherwise. -func (this TootEmoji) GetForgeFedTicketsTrackedBy() vocab.ForgeFedTicketsTrackedByProperty { - return this.ForgeFedTicketsTrackedBy -} - -// GetForgeFedTracksTicketsFor returns the "tracksTicketsFor" property if it -// exists, and nil otherwise. -func (this TootEmoji) GetForgeFedTracksTicketsFor() vocab.ForgeFedTracksTicketsForProperty { - return this.ForgeFedTracksTicketsFor -} - // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this TootEmoji) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -708,10 +667,7 @@ func (this TootEmoji) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsStartTime, m) m = this.helperJSONLDContext(this.ActivityStreamsSummary, m) m = this.helperJSONLDContext(this.ActivityStreamsTag, m) - m = this.helperJSONLDContext(this.ForgeFedTeam, m) - m = this.helperJSONLDContext(this.ForgeFedTicketsTrackedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsTo, m) - m = this.helperJSONLDContext(this.ForgeFedTracksTicketsFor, m) m = this.helperJSONLDContext(this.JSONLDType, m) m = this.helperJSONLDContext(this.ActivityStreamsUpdated, m) m = this.helperJSONLDContext(this.ActivityStreamsUrl, m) @@ -1143,34 +1099,6 @@ func (this TootEmoji) LessThan(o vocab.TootEmoji) bool { // Anything else is greater than nil return false } // Else: Both are nil - // Compare property "team" - if lhs, rhs := this.ForgeFedTeam, o.GetForgeFedTeam(); 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 "ticketsTrackedBy" - if lhs, rhs := this.ForgeFedTicketsTrackedBy, o.GetForgeFedTicketsTrackedBy(); 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 "to" if lhs, rhs := this.ActivityStreamsTo, o.GetActivityStreamsTo(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1185,20 +1113,6 @@ func (this TootEmoji) LessThan(o vocab.TootEmoji) bool { // Anything else is greater than nil return false } // Else: Both are nil - // Compare property "tracksTicketsFor" - if lhs, rhs := this.ForgeFedTracksTicketsFor, o.GetForgeFedTracksTicketsFor(); 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 "type" if lhs, rhs := this.JSONLDType, o.GetJSONLDType(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1504,22 +1418,6 @@ func (this TootEmoji) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsTag.Name()] = i } } - // Maybe serialize property "team" - if this.ForgeFedTeam != nil { - if i, err := this.ForgeFedTeam.Serialize(); err != nil { - return nil, err - } else if i != nil { - m[this.ForgeFedTeam.Name()] = i - } - } - // Maybe serialize property "ticketsTrackedBy" - if this.ForgeFedTicketsTrackedBy != nil { - if i, err := this.ForgeFedTicketsTrackedBy.Serialize(); err != nil { - return nil, err - } else if i != nil { - m[this.ForgeFedTicketsTrackedBy.Name()] = i - } - } // Maybe serialize property "to" if this.ActivityStreamsTo != nil { if i, err := this.ActivityStreamsTo.Serialize(); err != nil { @@ -1528,14 +1426,6 @@ func (this TootEmoji) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsTo.Name()] = i } } - // Maybe serialize property "tracksTicketsFor" - if this.ForgeFedTracksTicketsFor != nil { - if i, err := this.ForgeFedTracksTicketsFor.Serialize(); err != nil { - return nil, err - } else if i != nil { - m[this.ForgeFedTracksTicketsFor.Name()] = i - } - } // Maybe serialize property "type" if this.JSONLDType != nil { if i, err := this.JSONLDType.Serialize(); err != nil { @@ -1734,21 +1624,6 @@ func (this *TootEmoji) SetActivityStreamsUrl(i vocab.ActivityStreamsUrlProperty) this.ActivityStreamsUrl = i } -// SetForgeFedTeam sets the "team" property. -func (this *TootEmoji) SetForgeFedTeam(i vocab.ForgeFedTeamProperty) { - this.ForgeFedTeam = i -} - -// SetForgeFedTicketsTrackedBy sets the "ticketsTrackedBy" property. -func (this *TootEmoji) SetForgeFedTicketsTrackedBy(i vocab.ForgeFedTicketsTrackedByProperty) { - this.ForgeFedTicketsTrackedBy = i -} - -// SetForgeFedTracksTicketsFor sets the "tracksTicketsFor" property. -func (this *TootEmoji) SetForgeFedTracksTicketsFor(i vocab.ForgeFedTracksTicketsForProperty) { - this.ForgeFedTracksTicketsFor = i -} - // SetJSONLDId sets the "id" property. func (this *TootEmoji) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_hashtag/gen_doc.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_hashtag/gen_doc.go new file mode 100644 index 000000000..ec71c25bc --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_hashtag/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package typehashtag contains the implementation for the Hashtag 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 typehashtag diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_hashtag/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_hashtag/gen_pkg.go new file mode 100644 index 000000000..40e803fd3 --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_hashtag/gen_pkg.go @@ -0,0 +1,91 @@ +// Code generated by astool. DO NOT EDIT. + +package typehashtag + +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 { + // DeserializeAttributedToPropertyActivityStreams returns the + // deserialization method for the + // "ActivityStreamsAttributedToProperty" non-functional property in + // the vocabulary "ActivityStreams" + DeserializeAttributedToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAttributedToProperty, error) + // DeserializeHeightPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsHeightProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeHeightPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsHeightProperty, error) + // DeserializeHrefPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsHrefProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeHrefPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsHrefProperty, error) + // DeserializeHreflangPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsHreflangProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeHreflangPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsHreflangProperty, 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) + // DeserializeMediaTypePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsMediaTypeProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeMediaTypePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsMediaTypeProperty, error) + // DeserializeNamePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsNameProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeNamePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsNameProperty, error) + // DeserializePreviewPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsPreviewProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializePreviewPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPreviewProperty, error) + // DeserializeRelPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsRelProperty" non-functional property + // in the vocabulary "ActivityStreams" + DeserializeRelPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRelProperty, error) + // DeserializeSummaryPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsSummaryProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeSummaryPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSummaryProperty, error) + // DeserializeTypePropertyJSONLD returns the deserialization method for + // the "JSONLDTypeProperty" non-functional property in the vocabulary + // "JSONLD" + DeserializeTypePropertyJSONLD() func(map[string]interface{}, map[string]string) (vocab.JSONLDTypeProperty, error) + // DeserializeWidthPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsWidthProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeWidthPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsWidthProperty, error) +} + +// jsonldContexter is a private interface to determine the JSON-LD contexts and +// aliases needed for functional and non-functional properties. It is a helper +// interface for this implementation. +type jsonldContexter interface { + // JSONLDContext returns the JSONLD URIs required in the context string + // for this property and the specific values that are set. The value + // in the map is the alias used to import the property's value or + // values. + JSONLDContext() map[string]string +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} + +// SetTypePropertyConstructor sets the "type" property's constructor in the +// package-global variable. For internal use only, do not use as part of +// Application behavior. Must be called at golang init time. Permits +// ActivityStreams types to correctly set their "type" property at +// construction time, so users don't have to remember to do so each time. It +// is dependency injected so other go-fed compatible implementations could +// inject their own type. +func SetTypePropertyConstructor(f func() vocab.JSONLDTypeProperty) { + typePropertyConstructor = f +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_hashtag/gen_type_toot_hashtag.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_hashtag/gen_type_toot_hashtag.go new file mode 100644 index 000000000..8cb8b993c --- /dev/null +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_hashtag/gen_type_toot_hashtag.go @@ -0,0 +1,728 @@ +// Code generated by astool. DO NOT EDIT. + +package typehashtag + +import ( + "fmt" + vocab "github.com/superseriousbusiness/activity/streams/vocab" + "strings" +) + +// +// +// { +// "content": "example", +// "id": "https://example.com/@alice/hello-world", +// "tag": [ +// { +// "href": "https://example.com/hashtag/example", +// "name": "#example", +// "type": "Hashtag" +// } +// ], +// "type": "Note" +// } +type TootHashtag struct { + ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty + ActivityStreamsHeight vocab.ActivityStreamsHeightProperty + ActivityStreamsHref vocab.ActivityStreamsHrefProperty + ActivityStreamsHreflang vocab.ActivityStreamsHreflangProperty + JSONLDId vocab.JSONLDIdProperty + ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty + ActivityStreamsName vocab.ActivityStreamsNameProperty + ActivityStreamsPreview vocab.ActivityStreamsPreviewProperty + ActivityStreamsRel vocab.ActivityStreamsRelProperty + ActivityStreamsSummary vocab.ActivityStreamsSummaryProperty + JSONLDType vocab.JSONLDTypeProperty + ActivityStreamsWidth vocab.ActivityStreamsWidthProperty + alias string + unknown map[string]interface{} +} + +// DeserializeHashtag creates a Hashtag from a map representation that has been +// unmarshalled from a text or binary format. +func DeserializeHashtag(m map[string]interface{}, aliasMap map[string]string) (*TootHashtag, error) { + alias := "" + aliasPrefix := "" + if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok { + alias = a + aliasPrefix = a + ":" + } + this := &TootHashtag{ + alias: alias, + unknown: make(map[string]interface{}), + } + if typeValue, ok := m["type"]; !ok { + return nil, fmt.Errorf("no \"type\" property in map") + } else if typeString, ok := typeValue.(string); ok { + typeName := strings.TrimPrefix(typeString, aliasPrefix) + if typeName != "Hashtag" { + return nil, fmt.Errorf("\"type\" property is not of %q type: %s", "Hashtag", typeName) + } + // Fall through, success in finding a proper Type + } else if arrType, ok := typeValue.([]interface{}); ok { + found := false + for _, elemVal := range arrType { + if typeString, ok := elemVal.(string); ok && strings.TrimPrefix(typeString, aliasPrefix) == "Hashtag" { + found = true + break + } + } + if !found { + return nil, fmt.Errorf("could not find a \"type\" property of value %q", "Hashtag") + } + // Fall through, success in finding a proper Type + } else { + return nil, fmt.Errorf("\"type\" property is unrecognized type: %T", typeValue) + } + // Begin: Known property deserialization + if p, err := mgr.DeserializeAttributedToPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsAttributedTo = p + } + if p, err := mgr.DeserializeHeightPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsHeight = p + } + if p, err := mgr.DeserializeHrefPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsHref = p + } + if p, err := mgr.DeserializeHreflangPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsHreflang = p + } + if p, err := mgr.DeserializeIdPropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDId = p + } + if p, err := mgr.DeserializeMediaTypePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsMediaType = p + } + if p, err := mgr.DeserializeNamePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsName = p + } + if p, err := mgr.DeserializePreviewPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsPreview = p + } + if p, err := mgr.DeserializeRelPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsRel = p + } + if p, err := mgr.DeserializeSummaryPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsSummary = p + } + if p, err := mgr.DeserializeTypePropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDType = p + } + if p, err := mgr.DeserializeWidthPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsWidth = p + } + // End: Known property deserialization + + // Begin: Unknown deserialization + for k, v := range m { + // Begin: Code that ensures a property name is unknown + if k == "attributedTo" { + continue + } else if k == "height" { + continue + } else if k == "href" { + continue + } else if k == "hreflang" { + continue + } else if k == "id" { + continue + } else if k == "mediaType" { + continue + } else if k == "name" { + continue + } else if k == "nameMap" { + continue + } else if k == "preview" { + continue + } else if k == "rel" { + continue + } else if k == "summary" { + continue + } else if k == "summaryMap" { + continue + } else if k == "type" { + continue + } else if k == "width" { + continue + } // End: Code that ensures a property name is unknown + + this.unknown[k] = v + } + // End: Unknown deserialization + + return this, nil +} + +// HashtagIsDisjointWith returns true if the other provided type is disjoint with +// the Hashtag type. +func HashtagIsDisjointWith(other vocab.Type) bool { + disjointWith := []string{"Accept", "Activity", "Add", "Announce", "Application", "Arrive", "Article", "Audio", "Block", "Collection", "CollectionPage", "Create", "Delete", "Dislike", "Document", "Emoji", "Event", "Flag", "Follow", "Group", "IdentityProof", "Ignore", "Image", "IntransitiveActivity", "Invite", "Join", "Leave", "Like", "Listen", "Move", "Note", "Object", "Offer", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage", "Organization", "Page", "Person", "Place", "Profile", "PropertyValue", "Question", "Read", "Reject", "Relationship", "Remove", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Travel", "Undo", "Update", "Video", "View"} + for _, disjoint := range disjointWith { + if disjoint == other.GetTypeName() { + return true + } + } + return false +} + +// HashtagIsExtendedBy returns true if the other provided type extends from the +// Hashtag type. Note that it returns false if the types are the same; see the +// "IsOrExtendsHashtag" variant instead. +func HashtagIsExtendedBy(other vocab.Type) bool { + // Shortcut implementation: is not extended by anything. + return false +} + +// IsOrExtendsHashtag returns true if the other provided type is the Hashtag type +// or extends from the Hashtag type. +func IsOrExtendsHashtag(other vocab.Type) bool { + if other.GetTypeName() == "Hashtag" { + return true + } + return HashtagIsExtendedBy(other) +} + +// NewTootHashtag creates a new Hashtag type +func NewTootHashtag() *TootHashtag { + typeProp := typePropertyConstructor() + typeProp.AppendXMLSchemaString("Hashtag") + return &TootHashtag{ + JSONLDType: typeProp, + alias: "", + unknown: make(map[string]interface{}), + } +} + +// TootHashtagExtends returns true if the Hashtag type extends from the other type. +func TootHashtagExtends(other vocab.Type) bool { + extensions := []string{"Link"} + for _, ext := range extensions { + if ext == other.GetTypeName() { + return true + } + } + return false +} + +// GetActivityStreamsAttributedTo returns the "attributedTo" property if it +// exists, and nil otherwise. +func (this TootHashtag) GetActivityStreamsAttributedTo() vocab.ActivityStreamsAttributedToProperty { + return this.ActivityStreamsAttributedTo +} + +// GetActivityStreamsHeight returns the "height" property if it exists, and nil +// otherwise. +func (this TootHashtag) GetActivityStreamsHeight() vocab.ActivityStreamsHeightProperty { + return this.ActivityStreamsHeight +} + +// GetActivityStreamsHref returns the "href" property if it exists, and nil +// otherwise. +func (this TootHashtag) GetActivityStreamsHref() vocab.ActivityStreamsHrefProperty { + return this.ActivityStreamsHref +} + +// GetActivityStreamsHreflang returns the "hreflang" property if it exists, and +// nil otherwise. +func (this TootHashtag) GetActivityStreamsHreflang() vocab.ActivityStreamsHreflangProperty { + return this.ActivityStreamsHreflang +} + +// GetActivityStreamsMediaType returns the "mediaType" property if it exists, and +// nil otherwise. +func (this TootHashtag) GetActivityStreamsMediaType() vocab.ActivityStreamsMediaTypeProperty { + return this.ActivityStreamsMediaType +} + +// GetActivityStreamsName returns the "name" property if it exists, and nil +// otherwise. +func (this TootHashtag) GetActivityStreamsName() vocab.ActivityStreamsNameProperty { + return this.ActivityStreamsName +} + +// GetActivityStreamsPreview returns the "preview" property if it exists, and nil +// otherwise. +func (this TootHashtag) GetActivityStreamsPreview() vocab.ActivityStreamsPreviewProperty { + return this.ActivityStreamsPreview +} + +// GetActivityStreamsRel returns the "rel" property if it exists, and nil +// otherwise. +func (this TootHashtag) GetActivityStreamsRel() vocab.ActivityStreamsRelProperty { + return this.ActivityStreamsRel +} + +// GetActivityStreamsSummary returns the "summary" property if it exists, and nil +// otherwise. +func (this TootHashtag) GetActivityStreamsSummary() vocab.ActivityStreamsSummaryProperty { + return this.ActivityStreamsSummary +} + +// GetActivityStreamsWidth returns the "width" property if it exists, and nil +// otherwise. +func (this TootHashtag) GetActivityStreamsWidth() vocab.ActivityStreamsWidthProperty { + return this.ActivityStreamsWidth +} + +// GetJSONLDId returns the "id" property if it exists, and nil otherwise. +func (this TootHashtag) GetJSONLDId() vocab.JSONLDIdProperty { + return this.JSONLDId +} + +// GetJSONLDType returns the "type" property if it exists, and nil otherwise. +func (this TootHashtag) GetJSONLDType() vocab.JSONLDTypeProperty { + return this.JSONLDType +} + +// GetTypeName returns the name of this type. +func (this TootHashtag) GetTypeName() string { + return "Hashtag" +} + +// GetUnknownProperties returns the unknown properties for the Hashtag 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 TootHashtag) GetUnknownProperties() map[string]interface{} { + return this.unknown +} + +// IsExtending returns true if the Hashtag type extends from the other type. +func (this TootHashtag) IsExtending(other vocab.Type) bool { + return TootHashtagExtends(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 TootHashtag) JSONLDContext() map[string]string { + m := map[string]string{"http://joinmastodon.org/ns": this.alias} + m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) + m = this.helperJSONLDContext(this.ActivityStreamsHeight, m) + m = this.helperJSONLDContext(this.ActivityStreamsHref, m) + m = this.helperJSONLDContext(this.ActivityStreamsHreflang, m) + m = this.helperJSONLDContext(this.JSONLDId, m) + m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) + m = this.helperJSONLDContext(this.ActivityStreamsName, m) + m = this.helperJSONLDContext(this.ActivityStreamsPreview, m) + m = this.helperJSONLDContext(this.ActivityStreamsRel, m) + m = this.helperJSONLDContext(this.ActivityStreamsSummary, m) + m = this.helperJSONLDContext(this.JSONLDType, m) + m = this.helperJSONLDContext(this.ActivityStreamsWidth, m) + + return m +} + +// LessThan computes if this Hashtag is lesser, with an arbitrary but stable +// determination. +func (this TootHashtag) LessThan(o vocab.TootHashtag) bool { + // Begin: Compare known properties + // Compare property "attributedTo" + if lhs, rhs := this.ActivityStreamsAttributedTo, o.GetActivityStreamsAttributedTo(); 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 "height" + if lhs, rhs := this.ActivityStreamsHeight, o.GetActivityStreamsHeight(); 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 "href" + if lhs, rhs := this.ActivityStreamsHref, o.GetActivityStreamsHref(); 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 "hreflang" + if lhs, rhs := this.ActivityStreamsHreflang, o.GetActivityStreamsHreflang(); 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 + // Compare property "mediaType" + if lhs, rhs := this.ActivityStreamsMediaType, o.GetActivityStreamsMediaType(); 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 "name" + if lhs, rhs := this.ActivityStreamsName, o.GetActivityStreamsName(); 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 "preview" + if lhs, rhs := this.ActivityStreamsPreview, o.GetActivityStreamsPreview(); 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 "rel" + if lhs, rhs := this.ActivityStreamsRel, o.GetActivityStreamsRel(); 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 "summary" + if lhs, rhs := this.ActivityStreamsSummary, o.GetActivityStreamsSummary(); 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 "type" + if lhs, rhs := this.JSONLDType, o.GetJSONLDType(); 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 "width" + if lhs, rhs := this.ActivityStreamsWidth, o.GetActivityStreamsWidth(); 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 TootHashtag) Serialize() (map[string]interface{}, error) { + m := make(map[string]interface{}) + typeName := "Hashtag" + if len(this.alias) > 0 { + typeName = this.alias + ":" + "Hashtag" + } + m["type"] = typeName + // Begin: Serialize known properties + // Maybe serialize property "attributedTo" + if this.ActivityStreamsAttributedTo != nil { + if i, err := this.ActivityStreamsAttributedTo.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsAttributedTo.Name()] = i + } + } + // Maybe serialize property "height" + if this.ActivityStreamsHeight != nil { + if i, err := this.ActivityStreamsHeight.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsHeight.Name()] = i + } + } + // Maybe serialize property "href" + if this.ActivityStreamsHref != nil { + if i, err := this.ActivityStreamsHref.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsHref.Name()] = i + } + } + // Maybe serialize property "hreflang" + if this.ActivityStreamsHreflang != nil { + if i, err := this.ActivityStreamsHreflang.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsHreflang.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 + } + } + // Maybe serialize property "mediaType" + if this.ActivityStreamsMediaType != nil { + if i, err := this.ActivityStreamsMediaType.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsMediaType.Name()] = i + } + } + // Maybe serialize property "name" + if this.ActivityStreamsName != nil { + if i, err := this.ActivityStreamsName.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsName.Name()] = i + } + } + // Maybe serialize property "preview" + if this.ActivityStreamsPreview != nil { + if i, err := this.ActivityStreamsPreview.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsPreview.Name()] = i + } + } + // Maybe serialize property "rel" + if this.ActivityStreamsRel != nil { + if i, err := this.ActivityStreamsRel.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsRel.Name()] = i + } + } + // Maybe serialize property "summary" + if this.ActivityStreamsSummary != nil { + if i, err := this.ActivityStreamsSummary.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsSummary.Name()] = i + } + } + // Maybe serialize property "type" + if this.JSONLDType != nil { + if i, err := this.JSONLDType.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.JSONLDType.Name()] = i + } + } + // Maybe serialize property "width" + if this.ActivityStreamsWidth != nil { + if i, err := this.ActivityStreamsWidth.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsWidth.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 +} + +// SetActivityStreamsAttributedTo sets the "attributedTo" property. +func (this *TootHashtag) SetActivityStreamsAttributedTo(i vocab.ActivityStreamsAttributedToProperty) { + this.ActivityStreamsAttributedTo = i +} + +// SetActivityStreamsHeight sets the "height" property. +func (this *TootHashtag) SetActivityStreamsHeight(i vocab.ActivityStreamsHeightProperty) { + this.ActivityStreamsHeight = i +} + +// SetActivityStreamsHref sets the "href" property. +func (this *TootHashtag) SetActivityStreamsHref(i vocab.ActivityStreamsHrefProperty) { + this.ActivityStreamsHref = i +} + +// SetActivityStreamsHreflang sets the "hreflang" property. +func (this *TootHashtag) SetActivityStreamsHreflang(i vocab.ActivityStreamsHreflangProperty) { + this.ActivityStreamsHreflang = i +} + +// SetActivityStreamsMediaType sets the "mediaType" property. +func (this *TootHashtag) SetActivityStreamsMediaType(i vocab.ActivityStreamsMediaTypeProperty) { + this.ActivityStreamsMediaType = i +} + +// SetActivityStreamsName sets the "name" property. +func (this *TootHashtag) SetActivityStreamsName(i vocab.ActivityStreamsNameProperty) { + this.ActivityStreamsName = i +} + +// SetActivityStreamsPreview sets the "preview" property. +func (this *TootHashtag) SetActivityStreamsPreview(i vocab.ActivityStreamsPreviewProperty) { + this.ActivityStreamsPreview = i +} + +// SetActivityStreamsRel sets the "rel" property. +func (this *TootHashtag) SetActivityStreamsRel(i vocab.ActivityStreamsRelProperty) { + this.ActivityStreamsRel = i +} + +// SetActivityStreamsSummary sets the "summary" property. +func (this *TootHashtag) SetActivityStreamsSummary(i vocab.ActivityStreamsSummaryProperty) { + this.ActivityStreamsSummary = i +} + +// SetActivityStreamsWidth sets the "width" property. +func (this *TootHashtag) SetActivityStreamsWidth(i vocab.ActivityStreamsWidthProperty) { + this.ActivityStreamsWidth = i +} + +// SetJSONLDId sets the "id" property. +func (this *TootHashtag) SetJSONLDId(i vocab.JSONLDIdProperty) { + this.JSONLDId = i +} + +// SetJSONLDType sets the "type" property. +func (this *TootHashtag) SetJSONLDType(i vocab.JSONLDTypeProperty) { + this.JSONLDType = i +} + +// VocabularyURI returns the vocabulary's URI as a string. +func (this TootHashtag) VocabularyURI() string { + return "http://joinmastodon.org/ns" +} + +// helperJSONLDContext obtains the context uris and their aliases from a property, +// if it is not nil. +func (this TootHashtag) helperJSONLDContext(i jsonldContexter, toMerge map[string]string) map[string]string { + if i == nil { + return toMerge + } + for k, v := range i.JSONLDContext() { + /* + Since the literal maps in this function are determined at + code-generation time, this loop should not overwrite an existing key with a + new value. + */ + toMerge[k] = v + } + return toMerge +} diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_identityproof/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_identityproof/gen_pkg.go index 1dca15931..269b30ee7 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_identityproof/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_identityproof/gen_pkg.go @@ -140,22 +140,10 @@ type privateManager interface { // method for the "ActivityStreamsTagProperty" non-functional property // in the vocabulary "ActivityStreams" DeserializeTagPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTagProperty, error) - // DeserializeTeamPropertyForgeFed returns the deserialization method for - // the "ForgeFedTeamProperty" non-functional property in the - // vocabulary "ForgeFed" - DeserializeTeamPropertyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTeamProperty, error) - // DeserializeTicketsTrackedByPropertyForgeFed returns the deserialization - // method for the "ForgeFedTicketsTrackedByProperty" non-functional - // property in the vocabulary "ForgeFed" - DeserializeTicketsTrackedByPropertyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTicketsTrackedByProperty, error) // DeserializeToPropertyActivityStreams returns the deserialization method // for the "ActivityStreamsToProperty" non-functional property in the // vocabulary "ActivityStreams" DeserializeToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsToProperty, error) - // DeserializeTracksTicketsForPropertyForgeFed returns the deserialization - // method for the "ForgeFedTracksTicketsForProperty" non-functional - // property in the vocabulary "ForgeFed" - DeserializeTracksTicketsForPropertyForgeFed() func(map[string]interface{}, map[string]string) (vocab.ForgeFedTracksTicketsForProperty, error) // DeserializeTypePropertyJSONLD returns the deserialization method for // the "JSONLDTypeProperty" non-functional property in the vocabulary // "JSONLD" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go index 98702374c..8aad01cae 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go @@ -44,10 +44,7 @@ type TootIdentityProof struct { ActivityStreamsStartTime vocab.ActivityStreamsStartTimeProperty ActivityStreamsSummary vocab.ActivityStreamsSummaryProperty ActivityStreamsTag vocab.ActivityStreamsTagProperty - ForgeFedTeam vocab.ForgeFedTeamProperty - ForgeFedTicketsTrackedBy vocab.ForgeFedTicketsTrackedByProperty ActivityStreamsTo vocab.ActivityStreamsToProperty - ForgeFedTracksTicketsFor vocab.ForgeFedTracksTicketsForProperty JSONLDType vocab.JSONLDTypeProperty ActivityStreamsUpdated vocab.ActivityStreamsUpdatedProperty ActivityStreamsUrl vocab.ActivityStreamsUrlProperty @@ -252,26 +249,11 @@ func DeserializeIdentityProof(m map[string]interface{}, aliasMap map[string]stri } else if p != nil { this.ActivityStreamsTag = p } - if p, err := mgr.DeserializeTeamPropertyForgeFed()(m, aliasMap); err != nil { - return nil, err - } else if p != nil { - this.ForgeFedTeam = p - } - if p, err := mgr.DeserializeTicketsTrackedByPropertyForgeFed()(m, aliasMap); err != nil { - return nil, err - } else if p != nil { - this.ForgeFedTicketsTrackedBy = p - } if p, err := mgr.DeserializeToPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { this.ActivityStreamsTo = p } - if p, err := mgr.DeserializeTracksTicketsForPropertyForgeFed()(m, aliasMap); err != nil { - return nil, err - } else if p != nil { - this.ForgeFedTracksTicketsFor = p - } if p, err := mgr.DeserializeTypePropertyJSONLD()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -362,14 +344,8 @@ func DeserializeIdentityProof(m map[string]interface{}, aliasMap map[string]stri continue } else if k == "tag" { continue - } else if k == "team" { - continue - } else if k == "ticketsTrackedBy" { - continue } else if k == "to" { continue - } else if k == "tracksTicketsFor" { - continue } else if k == "type" { continue } else if k == "updated" { @@ -388,7 +364,7 @@ func DeserializeIdentityProof(m map[string]interface{}, aliasMap map[string]stri // IdentityProofIsDisjointWith returns true if the other provided type is disjoint // with the IdentityProof type. func IdentityProofIsDisjointWith(other vocab.Type) bool { - disjointWith := []string{"Link", "Mention"} + disjointWith := []string{"Hashtag", "Link", "Mention"} for _, disjoint := range disjointWith { if disjoint == other.GetTypeName() { return true @@ -627,23 +603,6 @@ func (this TootIdentityProof) GetActivityStreamsUrl() vocab.ActivityStreamsUrlPr return this.ActivityStreamsUrl } -// GetForgeFedTeam returns the "team" property if it exists, and nil otherwise. -func (this TootIdentityProof) GetForgeFedTeam() vocab.ForgeFedTeamProperty { - return this.ForgeFedTeam -} - -// GetForgeFedTicketsTrackedBy returns the "ticketsTrackedBy" property if it -// exists, and nil otherwise. -func (this TootIdentityProof) GetForgeFedTicketsTrackedBy() vocab.ForgeFedTicketsTrackedByProperty { - return this.ForgeFedTicketsTrackedBy -} - -// GetForgeFedTracksTicketsFor returns the "tracksTicketsFor" property if it -// exists, and nil otherwise. -func (this TootIdentityProof) GetForgeFedTracksTicketsFor() vocab.ForgeFedTracksTicketsForProperty { - return this.ForgeFedTracksTicketsFor -} - // GetJSONLDId returns the "id" property if it exists, and nil otherwise. func (this TootIdentityProof) GetJSONLDId() vocab.JSONLDIdProperty { return this.JSONLDId @@ -723,10 +682,7 @@ func (this TootIdentityProof) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsStartTime, m) m = this.helperJSONLDContext(this.ActivityStreamsSummary, m) m = this.helperJSONLDContext(this.ActivityStreamsTag, m) - m = this.helperJSONLDContext(this.ForgeFedTeam, m) - m = this.helperJSONLDContext(this.ForgeFedTicketsTrackedBy, m) m = this.helperJSONLDContext(this.ActivityStreamsTo, m) - m = this.helperJSONLDContext(this.ForgeFedTracksTicketsFor, m) m = this.helperJSONLDContext(this.JSONLDType, m) m = this.helperJSONLDContext(this.ActivityStreamsUpdated, m) m = this.helperJSONLDContext(this.ActivityStreamsUrl, m) @@ -1186,34 +1142,6 @@ func (this TootIdentityProof) LessThan(o vocab.TootIdentityProof) bool { // Anything else is greater than nil return false } // Else: Both are nil - // Compare property "team" - if lhs, rhs := this.ForgeFedTeam, o.GetForgeFedTeam(); 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 "ticketsTrackedBy" - if lhs, rhs := this.ForgeFedTicketsTrackedBy, o.GetForgeFedTicketsTrackedBy(); 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 "to" if lhs, rhs := this.ActivityStreamsTo, o.GetActivityStreamsTo(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1228,20 +1156,6 @@ func (this TootIdentityProof) LessThan(o vocab.TootIdentityProof) bool { // Anything else is greater than nil return false } // Else: Both are nil - // Compare property "tracksTicketsFor" - if lhs, rhs := this.ForgeFedTracksTicketsFor, o.GetForgeFedTracksTicketsFor(); 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 "type" if lhs, rhs := this.JSONLDType, o.GetJSONLDType(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1563,22 +1477,6 @@ func (this TootIdentityProof) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsTag.Name()] = i } } - // Maybe serialize property "team" - if this.ForgeFedTeam != nil { - if i, err := this.ForgeFedTeam.Serialize(); err != nil { - return nil, err - } else if i != nil { - m[this.ForgeFedTeam.Name()] = i - } - } - // Maybe serialize property "ticketsTrackedBy" - if this.ForgeFedTicketsTrackedBy != nil { - if i, err := this.ForgeFedTicketsTrackedBy.Serialize(); err != nil { - return nil, err - } else if i != nil { - m[this.ForgeFedTicketsTrackedBy.Name()] = i - } - } // Maybe serialize property "to" if this.ActivityStreamsTo != nil { if i, err := this.ActivityStreamsTo.Serialize(); err != nil { @@ -1587,14 +1485,6 @@ func (this TootIdentityProof) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsTo.Name()] = i } } - // Maybe serialize property "tracksTicketsFor" - if this.ForgeFedTracksTicketsFor != nil { - if i, err := this.ForgeFedTracksTicketsFor.Serialize(); err != nil { - return nil, err - } else if i != nil { - m[this.ForgeFedTracksTicketsFor.Name()] = i - } - } // Maybe serialize property "type" if this.JSONLDType != nil { if i, err := this.JSONLDType.Serialize(); err != nil { @@ -1793,21 +1683,6 @@ func (this *TootIdentityProof) SetActivityStreamsUrl(i vocab.ActivityStreamsUrlP this.ActivityStreamsUrl = i } -// SetForgeFedTeam sets the "team" property. -func (this *TootIdentityProof) SetForgeFedTeam(i vocab.ForgeFedTeamProperty) { - this.ForgeFedTeam = i -} - -// SetForgeFedTicketsTrackedBy sets the "ticketsTrackedBy" property. -func (this *TootIdentityProof) SetForgeFedTicketsTrackedBy(i vocab.ForgeFedTicketsTrackedByProperty) { - this.ForgeFedTicketsTrackedBy = i -} - -// SetForgeFedTracksTicketsFor sets the "tracksTicketsFor" property. -func (this *TootIdentityProof) SetForgeFedTracksTicketsFor(i vocab.ForgeFedTracksTicketsForProperty) { - this.ForgeFedTracksTicketsFor = i -} - // SetJSONLDId sets the "id" property. func (this *TootIdentityProof) SetJSONLDId(i vocab.JSONLDIdProperty) { this.JSONLDId = i |
