diff options
| author | 2023-07-27 20:54:30 +0200 | |
|---|---|---|
| committer | 2023-07-27 20:54:30 +0200 | |
| commit | cf4bd700fb9fd1c6915eefe12437a9e074d84c9b (patch) | |
| tree | f755a27a405a9e000daa6bd6eac9f153518c02e0 /vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image | |
| parent | [chore] fix merge issue (#2029) (diff) | |
| download | gotosocial-cf4bd700fb9fd1c6915eefe12437a9e074d84c9b.tar.xz | |
[chore] Update activity dependency (#2031)
Diffstat (limited to 'vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image')
2 files changed, 108 insertions, 1 deletions
diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image/gen_pkg.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image/gen_pkg.go index 09ab5b927..dfcdb92a2 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image/gen_pkg.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image/gen_pkg.go @@ -9,6 +9,9 @@ var mgr privateManager // privateManager abstracts the code-generated manager that provides access to // concrete implementations. type privateManager interface { + // DeserializeHashtagToot returns the deserialization method for the + // "TootHashtag" non-functional property in the vocabulary "Toot" + DeserializeHashtagToot() func(map[string]interface{}, map[string]string) (vocab.TootHashtag, error) // DeserializeImageActivityStreams returns the deserialization method for // the "ActivityStreamsImage" non-functional property in the // vocabulary "ActivityStreams" diff --git a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image/gen_property_activitystreams_image.go b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image/gen_property_activitystreams_image.go index c9e7ee626..4650a8dd9 100644 --- a/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image/gen_property_activitystreams_image.go +++ b/vendor/github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_image/gen_property_activitystreams_image.go @@ -16,6 +16,7 @@ import ( type ActivityStreamsImagePropertyIterator struct { activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsLinkMember vocab.ActivityStreamsLink + tootHashtagMember vocab.TootHashtag activitystreamsMentionMember vocab.ActivityStreamsMention unknown interface{} iri *url.URL @@ -62,6 +63,12 @@ func deserializeActivityStreamsImagePropertyIterator(i interface{}, aliasMap map alias: alias, } return this, nil + } else if v, err := mgr.DeserializeHashtagToot()(m, aliasMap); err == nil { + this := &ActivityStreamsImagePropertyIterator{ + alias: alias, + tootHashtagMember: v, + } + return this, nil } else if v, err := mgr.DeserializeMentionActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsImagePropertyIterator{ activitystreamsMentionMember: v, @@ -104,6 +111,12 @@ func (this ActivityStreamsImagePropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootHashtag returns the value of this property. When IsTootHashtag returns +// false, GetTootHashtag will return an arbitrary value. +func (this ActivityStreamsImagePropertyIterator) GetTootHashtag() vocab.TootHashtag { + return this.tootHashtagMember +} + // 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 ActivityStreamsImagePropertyIterator) GetType() vocab.Type { @@ -113,6 +126,9 @@ func (this ActivityStreamsImagePropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsLink() { return this.GetActivityStreamsLink() } + if this.IsTootHashtag() { + return this.GetTootHashtag() + } if this.IsActivityStreamsMention() { return this.GetActivityStreamsMention() } @@ -124,6 +140,7 @@ func (this ActivityStreamsImagePropertyIterator) GetType() vocab.Type { func (this ActivityStreamsImagePropertyIterator) HasAny() bool { return this.IsActivityStreamsImage() || this.IsActivityStreamsLink() || + this.IsTootHashtag() || this.IsActivityStreamsMention() || this.iri != nil } @@ -155,6 +172,13 @@ func (this ActivityStreamsImagePropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootHashtag returns true if this property has a type of "Hashtag". When true, +// use the GetTootHashtag and SetTootHashtag methods to access and set this +// property. +func (this ActivityStreamsImagePropertyIterator) IsTootHashtag() bool { + return this.tootHashtagMember != 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. @@ -165,6 +189,8 @@ func (this ActivityStreamsImagePropertyIterator) JSONLDContext() map[string]stri child = this.GetActivityStreamsImage().JSONLDContext() } else if this.IsActivityStreamsLink() { child = this.GetActivityStreamsLink().JSONLDContext() + } else if this.IsTootHashtag() { + child = this.GetTootHashtag().JSONLDContext() } else if this.IsActivityStreamsMention() { child = this.GetActivityStreamsMention().JSONLDContext() } @@ -189,9 +215,12 @@ func (this ActivityStreamsImagePropertyIterator) KindIndex() int { if this.IsActivityStreamsLink() { return 1 } - if this.IsActivityStreamsMention() { + if this.IsTootHashtag() { return 2 } + if this.IsActivityStreamsMention() { + return 3 + } if this.IsIRI() { return -2 } @@ -213,6 +242,8 @@ func (this ActivityStreamsImagePropertyIterator) LessThan(o vocab.ActivityStream return this.GetActivityStreamsImage().LessThan(o.GetActivityStreamsImage()) } else if this.IsActivityStreamsLink() { return this.GetActivityStreamsLink().LessThan(o.GetActivityStreamsLink()) + } else if this.IsTootHashtag() { + return this.GetTootHashtag().LessThan(o.GetTootHashtag()) } else if this.IsActivityStreamsMention() { return this.GetActivityStreamsMention().LessThan(o.GetActivityStreamsMention()) } else if this.IsIRI() { @@ -275,6 +306,13 @@ func (this *ActivityStreamsImagePropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootHashtag sets the value of this property. Calling IsTootHashtag +// afterwards returns true. +func (this *ActivityStreamsImagePropertyIterator) SetTootHashtag(v vocab.TootHashtag) { + this.clear() + this.tootHashtagMember = 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 *ActivityStreamsImagePropertyIterator) SetType(t vocab.Type) error { @@ -286,6 +324,10 @@ func (this *ActivityStreamsImagePropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsLink(v) return nil } + if v, ok := t.(vocab.TootHashtag); ok { + this.SetTootHashtag(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsMention); ok { this.SetActivityStreamsMention(v) return nil @@ -299,6 +341,7 @@ func (this *ActivityStreamsImagePropertyIterator) SetType(t vocab.Type) error { func (this *ActivityStreamsImagePropertyIterator) clear() { this.activitystreamsImageMember = nil this.activitystreamsLinkMember = nil + this.tootHashtagMember = nil this.activitystreamsMentionMember = nil this.unknown = nil this.iri = nil @@ -313,6 +356,8 @@ func (this ActivityStreamsImagePropertyIterator) serialize() (interface{}, error return this.GetActivityStreamsImage().Serialize() } else if this.IsActivityStreamsLink() { return this.GetActivityStreamsLink().Serialize() + } else if this.IsTootHashtag() { + return this.GetTootHashtag().Serialize() } else if this.IsActivityStreamsMention() { return this.GetActivityStreamsMention().Serialize() } else if this.IsIRI() { @@ -419,6 +464,17 @@ func (this *ActivityStreamsImageProperty) AppendIRI(v *url.URL) { }) } +// AppendTootHashtag appends a Hashtag value to the back of a list of the property +// "image". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsImageProperty) AppendTootHashtag(v vocab.TootHashtag) { + this.properties = append(this.properties, &ActivityStreamsImagePropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootHashtagMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "image". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -532,6 +588,23 @@ func (this *ActivityStreamsImageProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootHashtag inserts a Hashtag value at the specified index for a property +// "image". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsImageProperty) InsertTootHashtag(idx int, v vocab.TootHashtag) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsImagePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootHashtagMember: v, + } + 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 "image". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -602,6 +675,10 @@ func (this ActivityStreamsImageProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsLink() return lhs.LessThan(rhs) } else if idx1 == 2 { + lhs := this.properties[i].GetTootHashtag() + rhs := this.properties[j].GetTootHashtag() + return lhs.LessThan(rhs) + } else if idx1 == 3 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) @@ -699,6 +776,20 @@ func (this *ActivityStreamsImageProperty) PrependIRI(v *url.URL) { } } +// PrependTootHashtag prepends a Hashtag value to the front of a list of the +// property "image". Invalidates all iterators. +func (this *ActivityStreamsImageProperty) PrependTootHashtag(v vocab.TootHashtag) { + this.properties = append([]*ActivityStreamsImagePropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootHashtagMember: v, + }}, 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 "image". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -802,6 +893,19 @@ func (this *ActivityStreamsImageProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootHashtag sets a Hashtag value to be at the specified index for the +// property "image". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *ActivityStreamsImageProperty) SetTootHashtag(idx int, v vocab.TootHashtag) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsImagePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootHashtagMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "image". 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. |
