From ffcaafbd9ff920f0d9bfe6455ed8aa8ffffb0aca Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Fri, 1 Nov 2019 13:39:08 -0500 Subject: [PATCH 01/28] regenerate streams package with no changes to avoid messy diffs --- streams/gen_doc.go | 8 ++++---- streams/gen_json_resolver.go | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/streams/gen_doc.go b/streams/gen_doc.go index ecce63c..40fce72 100644 --- a/streams/gen_doc.go +++ b/streams/gen_doc.go @@ -1,9 +1,9 @@ // Code generated by astool. DO NOT EDIT. -// Package contains constructors and functions necessary for applications to -// serialize, deserialize, and use ActivityStreams types in Go. This package -// is code-generated and subject to the same license as the go-fed tool used -// to generate it. +// Package streams contains constructors and functions necessary for applications +// to serialize, deserialize, and use ActivityStreams types in Go. This +// package is code-generated and subject to the same license as the go-fed +// tool used to generate it. // // This package is useful to three classes of developers: end-user-application // developers, specification writers creating an ActivityStream Extension, and diff --git a/streams/gen_json_resolver.go b/streams/gen_json_resolver.go index 76544c6..0654835 100644 --- a/streams/gen_json_resolver.go +++ b/streams/gen_json_resolver.go @@ -166,7 +166,6 @@ func toAliasMap(i interface{}) (m map[string]string) { switch v := i.(type) { case string: // Single entry, no alias. - if ok, http, https := toHttpHttpsFn(v); ok { m[http] = "" m[https] = "" @@ -175,7 +174,6 @@ func toAliasMap(i interface{}) (m map[string]string) { } case []interface{}: // Recursively apply. - for _, elem := range v { r := toAliasMap(elem) for k, val := range r { @@ -184,7 +182,6 @@ func toAliasMap(i interface{}) (m map[string]string) { } case map[string]interface{}: // Map any aliases. - for k, val := range v { // Only handle string aliases. switch conc := val.(type) { From b27393e8dd3ab68030044cd32dd9e2a19a358265 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Fri, 1 Nov 2019 13:40:21 -0500 Subject: [PATCH 02/28] add toot-namespaced types and objects except toot:focalPoint for #122 --- astool/toot.jsonld | 270 +++ streams/gen_consts.go | 24 + streams/gen_init.go | 18 + streams/gen_json_resolver.go | 33 + streams/gen_manager.go | 106 ++ streams/gen_pkg_toot_disjoint.go | 20 + streams/gen_pkg_toot_extendedby.go | 23 + streams/gen_pkg_toot_extends.go | 20 + streams/gen_pkg_toot_isorextends.go | 21 + streams/gen_pkg_toot_property_constructors.go | 44 + streams/gen_pkg_toot_type_constructors.go | 19 + streams/gen_resolver_utils.go | 6 + streams/gen_type_predicated_resolver.go | 26 + streams/gen_type_resolver.go | 22 + .../activitystreams/property_actor/gen_pkg.go | 6 + .../gen_property_activitystreams_actor.go | 353 +++- .../activitystreams/property_anyof/gen_pkg.go | 6 + .../gen_property_activitystreams_anyOf.go | 353 +++- .../property_attachment/gen_pkg.go | 6 + ...gen_property_activitystreams_attachment.go | 355 +++- .../property_attributedto/gen_pkg.go | 6 + ...n_property_activitystreams_attributedTo.go | 355 +++- .../property_audience/gen_pkg.go | 6 + .../gen_property_activitystreams_audience.go | 354 +++- .../activitystreams/property_bcc/gen_pkg.go | 6 + .../gen_property_activitystreams_bcc.go | 353 +++- .../activitystreams/property_bto/gen_pkg.go | 6 + .../gen_property_activitystreams_bto.go | 353 +++- .../activitystreams/property_cc/gen_pkg.go | 6 + .../gen_property_activitystreams_cc.go | 353 +++- .../property_closed/gen_pkg.go | 6 + .../gen_property_activitystreams_closed.go | 353 +++- .../property_context/gen_pkg.go | 6 + .../gen_property_activitystreams_context.go | 354 +++- .../property_describes/gen_pkg.go | 6 + .../gen_property_activitystreams_describes.go | 162 +- .../property_formertype/gen_pkg.go | 6 + ...gen_property_activitystreams_formerType.go | 351 +++- .../property_generator/gen_pkg.go | 6 + .../gen_property_activitystreams_generator.go | 355 +++- .../property_inreplyto/gen_pkg.go | 6 + .../gen_property_activitystreams_inReplyTo.go | 355 +++- .../property_instrument/gen_pkg.go | 6 + ...gen_property_activitystreams_instrument.go | 355 +++- .../activitystreams/property_items/gen_pkg.go | 6 + .../gen_property_activitystreams_items.go | 353 +++- .../property_location/gen_pkg.go | 6 + .../gen_property_activitystreams_location.go | 354 +++- .../property_object/gen_pkg.go | 6 + .../gen_property_activitystreams_object.go | 353 +++- .../activitystreams/property_oneof/gen_pkg.go | 6 + .../gen_property_activitystreams_oneOf.go | 353 +++- .../property_ordereditems/gen_pkg.go | 6 + ...n_property_activitystreams_orderedItems.go | 355 +++- .../property_origin/gen_pkg.go | 6 + .../gen_property_activitystreams_origin.go | 353 +++- .../property_preview/gen_pkg.go | 6 + .../gen_property_activitystreams_preview.go | 354 +++- .../property_relationship/gen_pkg.go | 6 + ...n_property_activitystreams_relationship.go | 351 +++- .../property_result/gen_pkg.go | 6 + .../gen_property_activitystreams_result.go | 353 +++- .../property_subject/gen_pkg.go | 6 + .../gen_property_activitystreams_subject.go | 164 +- .../activitystreams/property_tag/gen_pkg.go | 6 + .../gen_property_activitystreams_tag.go | 353 +++- .../property_target/gen_pkg.go | 6 + .../gen_property_activitystreams_target.go | 353 +++- .../activitystreams/property_to/gen_pkg.go | 6 + .../gen_property_activitystreams_to.go | 353 +++- .../type_application/gen_pkg.go | 8 + .../gen_type_activitystreams_application.go | 83 + .../activitystreams/type_audio/gen_pkg.go | 4 + .../gen_type_activitystreams_audio.go | 41 + .../activitystreams/type_document/gen_pkg.go | 4 + .../gen_type_activitystreams_document.go | 41 + .../activitystreams/type_group/gen_pkg.go | 8 + .../gen_type_activitystreams_group.go | 83 + .../activitystreams/type_image/gen_pkg.go | 4 + .../gen_type_activitystreams_image.go | 41 + .../gen_type_activitystreams_link.go | 2 +- .../gen_type_activitystreams_mention.go | 2 +- .../gen_type_activitystreams_object.go | 2 +- .../type_organization/gen_pkg.go | 8 + .../gen_type_activitystreams_organization.go | 83 + .../impl/activitystreams/type_page/gen_pkg.go | 4 + .../gen_type_activitystreams_page.go | 41 + .../activitystreams/type_person/gen_pkg.go | 8 + .../gen_type_activitystreams_person.go | 83 + .../activitystreams/type_question/gen_pkg.go | 4 + .../gen_type_activitystreams_question.go | 42 + .../activitystreams/type_service/gen_pkg.go | 8 + .../gen_type_activitystreams_service.go | 83 + .../activitystreams/type_video/gen_pkg.go | 4 + .../gen_type_activitystreams_video.go | 41 + .../impl/toot/property_blurhash/gen_doc.go | 17 + .../impl/toot/property_blurhash/gen_pkg.go | 15 + .../gen_property_toot_blurhash.go | 203 ++ .../toot/property_discoverable/gen_doc.go | 17 + .../toot/property_discoverable/gen_pkg.go | 15 + .../gen_property_toot_discoverable.go | 204 ++ .../impl/toot/property_featured/gen_doc.go | 17 + .../impl/toot/property_featured/gen_pkg.go | 27 + .../gen_property_toot_featured.go | 268 +++ .../property_signaturealgorithm/gen_doc.go | 17 + .../property_signaturealgorithm/gen_pkg.go | 15 + .../gen_property_toot_signatureAlgorithm.go | 204 ++ .../toot/property_signaturevalue/gen_doc.go | 17 + .../toot/property_signaturevalue/gen_pkg.go | 15 + .../gen_property_toot_signatureValue.go | 204 ++ .../impl/toot/property_voterscount/gen_doc.go | 17 + .../impl/toot/property_voterscount/gen_pkg.go | 15 + .../gen_property_toot_votersCount.go | 205 ++ streams/impl/toot/type_emoji/gen_doc.go | 17 + streams/impl/toot/type_emoji/gen_pkg.go | 171 ++ .../toot/type_emoji/gen_type_toot_emoji.go | 1573 ++++++++++++++++ .../impl/toot/type_identityproof/gen_doc.go | 17 + .../impl/toot/type_identityproof/gen_pkg.go | 179 ++ .../gen_type_toot_identityproof.go | 1642 +++++++++++++++++ ...roperty_activitystreams_actor_interface.go | 51 + ...roperty_activitystreams_anyOf_interface.go | 51 + ...ty_activitystreams_attachment_interface.go | 51 + ..._activitystreams_attributedTo_interface.go | 51 + ...erty_activitystreams_audience_interface.go | 51 + ..._property_activitystreams_bcc_interface.go | 51 + ..._property_activitystreams_bto_interface.go | 51 + ...n_property_activitystreams_cc_interface.go | 50 + ...operty_activitystreams_closed_interface.go | 51 + ...perty_activitystreams_context_interface.go | 51 + ...rty_activitystreams_describes_interface.go | 21 + ...ty_activitystreams_formerType_interface.go | 51 + ...rty_activitystreams_generator_interface.go | 51 + ...rty_activitystreams_inReplyTo_interface.go | 51 + ...ty_activitystreams_instrument_interface.go | 51 + ...roperty_activitystreams_items_interface.go | 51 + ...erty_activitystreams_location_interface.go | 51 + ...operty_activitystreams_object_interface.go | 51 + ...roperty_activitystreams_oneOf_interface.go | 51 + ..._activitystreams_orderedItems_interface.go | 51 + ...operty_activitystreams_origin_interface.go | 51 + ...perty_activitystreams_preview_interface.go | 51 + ..._activitystreams_relationship_interface.go | 51 + ...operty_activitystreams_result_interface.go | 51 + ...perty_activitystreams_subject_interface.go | 21 + ..._property_activitystreams_tag_interface.go | 51 + ...operty_activitystreams_target_interface.go | 51 + ...n_property_activitystreams_to_interface.go | 50 + .../gen_property_toot_blurhash_interface.go | 54 + ...en_property_toot_discoverable_interface.go | 54 + .../gen_property_toot_featured_interface.go | 82 + ...perty_toot_signatureAlgorithm_interface.go | 54 + ..._property_toot_signatureValue_interface.go | 54 + ...gen_property_toot_votersCount_interface.go | 56 + ...e_activitystreams_application_interface.go | 10 + ...en_type_activitystreams_audio_interface.go | 5 + ...type_activitystreams_document_interface.go | 5 + ...en_type_activitystreams_group_interface.go | 10 + ...en_type_activitystreams_image_interface.go | 5 + ..._activitystreams_organization_interface.go | 10 + ...gen_type_activitystreams_page_interface.go | 5 + ...n_type_activitystreams_person_interface.go | 10 + ...type_activitystreams_question_interface.go | 5 + ..._type_activitystreams_service_interface.go | 10 + ...en_type_activitystreams_video_interface.go | 5 + .../vocab/gen_type_toot_emoji_interface.go | 208 +++ .../gen_type_toot_identityproof_interface.go | 203 ++ 166 files changed, 16400 insertions(+), 1970 deletions(-) create mode 100644 astool/toot.jsonld create mode 100644 streams/gen_pkg_toot_disjoint.go create mode 100644 streams/gen_pkg_toot_extendedby.go create mode 100644 streams/gen_pkg_toot_extends.go create mode 100644 streams/gen_pkg_toot_isorextends.go create mode 100644 streams/gen_pkg_toot_property_constructors.go create mode 100644 streams/gen_pkg_toot_type_constructors.go create mode 100644 streams/impl/toot/property_blurhash/gen_doc.go create mode 100644 streams/impl/toot/property_blurhash/gen_pkg.go create mode 100644 streams/impl/toot/property_blurhash/gen_property_toot_blurhash.go create mode 100644 streams/impl/toot/property_discoverable/gen_doc.go create mode 100644 streams/impl/toot/property_discoverable/gen_pkg.go create mode 100644 streams/impl/toot/property_discoverable/gen_property_toot_discoverable.go create mode 100644 streams/impl/toot/property_featured/gen_doc.go create mode 100644 streams/impl/toot/property_featured/gen_pkg.go create mode 100644 streams/impl/toot/property_featured/gen_property_toot_featured.go create mode 100644 streams/impl/toot/property_signaturealgorithm/gen_doc.go create mode 100644 streams/impl/toot/property_signaturealgorithm/gen_pkg.go create mode 100644 streams/impl/toot/property_signaturealgorithm/gen_property_toot_signatureAlgorithm.go create mode 100644 streams/impl/toot/property_signaturevalue/gen_doc.go create mode 100644 streams/impl/toot/property_signaturevalue/gen_pkg.go create mode 100644 streams/impl/toot/property_signaturevalue/gen_property_toot_signatureValue.go create mode 100644 streams/impl/toot/property_voterscount/gen_doc.go create mode 100644 streams/impl/toot/property_voterscount/gen_pkg.go create mode 100644 streams/impl/toot/property_voterscount/gen_property_toot_votersCount.go create mode 100644 streams/impl/toot/type_emoji/gen_doc.go create mode 100644 streams/impl/toot/type_emoji/gen_pkg.go create mode 100644 streams/impl/toot/type_emoji/gen_type_toot_emoji.go create mode 100644 streams/impl/toot/type_identityproof/gen_doc.go create mode 100644 streams/impl/toot/type_identityproof/gen_pkg.go create mode 100644 streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go create mode 100644 streams/vocab/gen_property_toot_blurhash_interface.go create mode 100644 streams/vocab/gen_property_toot_discoverable_interface.go create mode 100644 streams/vocab/gen_property_toot_featured_interface.go create mode 100644 streams/vocab/gen_property_toot_signatureAlgorithm_interface.go create mode 100644 streams/vocab/gen_property_toot_signatureValue_interface.go create mode 100644 streams/vocab/gen_property_toot_votersCount_interface.go create mode 100644 streams/vocab/gen_type_toot_emoji_interface.go create mode 100644 streams/vocab/gen_type_toot_identityproof_interface.go diff --git a/astool/toot.jsonld b/astool/toot.jsonld new file mode 100644 index 0000000..0d6192e --- /dev/null +++ b/astool/toot.jsonld @@ -0,0 +1,270 @@ +{ + "@context": [ + { + "as": "https://www.w3.org/ns/activitystreams", + "owl": "http://www.w3.org/2002/07/owl#", + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "rfc": "https://tools.ietf.org/html/", + "schema": "http://schema.org/", + "xsd": "http://www.w3.org/2001/XMLSchema#" + }, + { + "domain": "rdfs:domain", + "example": "schema:workExample", + "isDefinedBy": "rdfs:isDefinedBy", + "mainEntity": "schema:mainEntity", + "members": "owl:members", + "name": "schema:name", + "notes": "rdfs:comment", + "range": "rdfs:range", + "subClassOf": "rdfs:subClassOf", + "disjointWith": "owl:disjointWith", + "subPropertyOf": "rdfs:subPropertyOf", + "unionOf": "owl:unionOf", + "url": "schema:URL" + } + ], + "id": "http://joinmastodon.org/ns#", + "type": "owl:Ontology", + "name": "Toot", + "members": [ + { + "id": "http://joinmastodon.org/ns#Emoji", + "type": "owl:Class", + "example": [ + { + "type": "http://schema.org/CreativeWork", + "mainEntity": { + "id": "https://example.com/@alice/hello-world", + "type": "Note", + "content": "Hello world :Kappa:", + "tag": [ + { + "id": "https://example.com/emoji/123", + "type": "Emoji", + "name": ":Kappa:", + "icon": { + "type": "Image", + "mediaType": "image/png", + "url": "https://example.com/files/kappa.png" + } + } + ] + } + } + ], + "subClassOf": { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Object", + "name": "as:Object" + }, + "disjointWith": [], + "name": "Emoji", + "url": "https://docs.joinmastodon.org/development/activitypub/#custom-emojis" + }, + { + "id": "http://joinmastodon.org/ns#featured", + "type": [ + "rdf:Property", + "owl:FunctionalProperty" + ], + "example": { + }, + "domain": { + "type": "owl:Class", + "unionOf": [ + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Application", + "name": "as:Application" + }, + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Group", + "name": "as:Group" + }, + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Organization", + "name": "as:Organization" + }, + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Person", + "name": "as:Person" + }, + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Service", + "name": "as:Service" + } + ] + }, + "isDefinedBy": "https://docs.joinmastodon.org/development/activitypub/#featured-collection", + "range": { + "type": "owl:Class", + "unionOf": { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#OrderedCollection", + "name": "as:OrderedCollection" + } + }, + "name": "featured", + "url": "https://docs.joinmastodon.org/development/activitypub/#featured-collection" + }, + { + "id": "http://joinmastodon.org/ns#votersCount", + "type": [ + "rdf:Property", + "owl:FunctionalProperty" + ], + "example": { + }, + "domain": { + "type": "owl:Class", + "unionOf": [ + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Question", + "name": "as:Question" + } + ] + }, + "range": { + "type": "owl:Class", + "unionOf": "xsd:nonNegativeInteger" + }, + "name": "votersCount" + }, + { + "id": "http://joinmastodon.org/ns#blurhash", + "type": [ + "rdf:Property", + "owl:FunctionalProperty" + ], + "example": { + }, + "domain": { + "type": "owl:Class", + "unionOf": [ + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Document", + "name": "as:Document" + } + ] + }, + "range": { + "type": "owl:Class", + "unionOf": "xsd:string" + }, + "name": "blurhash" + }, + { + "id": "http://joinmastodon.org/ns#IdentityProof", + "type": "owl:Class", + "example": { + }, + "subClassOf": { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Object", + "name": "as:Object" + }, + "disjointWith": [], + "name": "IdentityProof" + }, + { + "id": "http://joinmastodon.org/ns#signatureAlgorithm", + "type": [ + "rdf:Property", + "owl:FunctionalProperty" + ], + "example": { + }, + "domain": { + "type": "owl:Class", + "unionOf": [ + { + "type": "owl:Class", + "url": "http://joinmastodon.org/ns#IdentityProof", + "name": "IdentityProof" + } + ] + }, + "range": { + "type": "owl:Class", + "unionOf": "xsd:string" + }, + "name": "signatureAlgorithm" + }, + { + "id": "http://joinmastodon.org/ns#signatureValue", + "type": [ + "rdf:Property", + "owl:FunctionalProperty" + ], + "example": { + }, + "domain": { + "type": "owl:Class", + "unionOf": [ + { + "type": "owl:Class", + "url": "http://joinmastodon.org/ns#IdentityProof", + "name": "IdentityProof" + } + ] + }, + "range": { + "type": "owl:Class", + "unionOf": "xsd:string" + }, + "name": "signatureValue" + }, + { + "id": "http://joinmastodon.org/ns#discoverable", + "type": [ + "rdf:Property", + "owl:FunctionalProperty" + ], + "example": { + }, + "domain": { + "type": "owl:Class", + "unionOf": [ + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Application", + "name": "as:Application" + }, + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Group", + "name": "as:Group" + }, + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Organization", + "name": "as:Organization" + }, + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Person", + "name": "as:Person" + }, + { + "type": "owl:Class", + "url": "https://www.w3.org/ns/activitystreams#Service", + "name": "as:Service" + } + ] + }, + "range": { + "type": "owl:Class", + "unionOf": "xsd:boolean" + }, + "name": "discoverable" + } + ] +} diff --git a/streams/gen_consts.go b/streams/gen_consts.go index 3fed2fa..2402d40 100644 --- a/streams/gen_consts.go +++ b/streams/gen_consts.go @@ -47,6 +47,9 @@ var ActivityStreamsDislikeName string = "Dislike" // ActivityStreamsDocumentName is the string literal of the name for the Document type in the ActivityStreams vocabulary. var ActivityStreamsDocumentName string = "Document" +// TootEmojiName is the string literal of the name for the Emoji type in the Toot vocabulary. +var TootEmojiName string = "Emoji" + // ActivityStreamsEventName is the string literal of the name for the Event type in the ActivityStreams vocabulary. var ActivityStreamsEventName string = "Event" @@ -59,6 +62,9 @@ var ActivityStreamsFollowName string = "Follow" // ActivityStreamsGroupName is the string literal of the name for the Group type in the ActivityStreams vocabulary. var ActivityStreamsGroupName string = "Group" +// TootIdentityProofName is the string literal of the name for the IdentityProof type in the Toot vocabulary. +var TootIdentityProofName string = "IdentityProof" + // ActivityStreamsIgnoreName is the string literal of the name for the Ignore type in the ActivityStreams vocabulary. var ActivityStreamsIgnoreName string = "Ignore" @@ -191,6 +197,9 @@ var ActivityStreamsAudiencePropertyName string = "audience" // ActivityStreamsBccPropertyName is the string literal of the name for the bcc property in the ActivityStreams vocabulary. var ActivityStreamsBccPropertyName string = "bcc" +// TootBlurhashPropertyName is the string literal of the name for the blurhash property in the Toot vocabulary. +var TootBlurhashPropertyName string = "blurhash" + // ActivityStreamsBtoPropertyName is the string literal of the name for the bto property in the ActivityStreams vocabulary. var ActivityStreamsBtoPropertyName string = "bto" @@ -218,12 +227,18 @@ var ActivityStreamsDeletedPropertyName string = "deleted" // ActivityStreamsDescribesPropertyName is the string literal of the name for the describes property in the ActivityStreams vocabulary. var ActivityStreamsDescribesPropertyName string = "describes" +// TootDiscoverablePropertyName is the string literal of the name for the discoverable property in the Toot vocabulary. +var TootDiscoverablePropertyName string = "discoverable" + // ActivityStreamsDurationPropertyName is the string literal of the name for the duration property in the ActivityStreams vocabulary. var ActivityStreamsDurationPropertyName string = "duration" // ActivityStreamsEndTimePropertyName is the string literal of the name for the endTime property in the ActivityStreams vocabulary. var ActivityStreamsEndTimePropertyName string = "endTime" +// TootFeaturedPropertyName is the string literal of the name for the featured property in the Toot vocabulary. +var TootFeaturedPropertyName string = "featured" + // ActivityStreamsFirstPropertyName is the string literal of the name for the first property in the ActivityStreams vocabulary. var ActivityStreamsFirstPropertyName string = "first" @@ -356,6 +371,12 @@ var ActivityStreamsResultPropertyName string = "result" // ActivityStreamsSharesPropertyName is the string literal of the name for the shares property in the ActivityStreams vocabulary. var ActivityStreamsSharesPropertyName string = "shares" +// TootSignatureAlgorithmPropertyName is the string literal of the name for the signatureAlgorithm property in the Toot vocabulary. +var TootSignatureAlgorithmPropertyName string = "signatureAlgorithm" + +// TootSignatureValuePropertyName is the string literal of the name for the signatureValue property in the Toot vocabulary. +var TootSignatureValuePropertyName string = "signatureValue" + // ActivityStreamsStartIndexPropertyName is the string literal of the name for the startIndex property in the ActivityStreams vocabulary. var ActivityStreamsStartIndexPropertyName string = "startIndex" @@ -395,5 +416,8 @@ var ActivityStreamsUpdatedPropertyName string = "updated" // ActivityStreamsUrlPropertyName is the string literal of the name for the url property in the ActivityStreams vocabulary. var ActivityStreamsUrlPropertyName string = "url" +// TootVotersCountPropertyName is the string literal of the name for the votersCount property in the Toot vocabulary. +var TootVotersCountPropertyName string = "votersCount" + // ActivityStreamsWidthPropertyName is the string literal of the name for the width property in the ActivityStreams vocabulary. var ActivityStreamsWidthPropertyName string = "width" diff --git a/streams/gen_init.go b/streams/gen_init.go index 26ac3d1..b406e85 100644 --- a/streams/gen_init.go +++ b/streams/gen_init.go @@ -127,6 +127,14 @@ import ( typeupdate "github.com/go-fed/activity/streams/impl/activitystreams/type_update" typevideo "github.com/go-fed/activity/streams/impl/activitystreams/type_video" typeview "github.com/go-fed/activity/streams/impl/activitystreams/type_view" + propertyblurhash "github.com/go-fed/activity/streams/impl/toot/property_blurhash" + propertydiscoverable "github.com/go-fed/activity/streams/impl/toot/property_discoverable" + propertyfeatured "github.com/go-fed/activity/streams/impl/toot/property_featured" + propertysignaturealgorithm "github.com/go-fed/activity/streams/impl/toot/property_signaturealgorithm" + propertysignaturevalue "github.com/go-fed/activity/streams/impl/toot/property_signaturevalue" + propertyvoterscount "github.com/go-fed/activity/streams/impl/toot/property_voterscount" + typeemoji "github.com/go-fed/activity/streams/impl/toot/type_emoji" + typeidentityproof "github.com/go-fed/activity/streams/impl/toot/type_identityproof" propertyowner "github.com/go-fed/activity/streams/impl/w3idsecurityv1/property_owner" propertypublickey "github.com/go-fed/activity/streams/impl/w3idsecurityv1/property_publickey" propertypublickeypem "github.com/go-fed/activity/streams/impl/w3idsecurityv1/property_publickeypem" @@ -270,6 +278,14 @@ func init() { typeupdate.SetManager(mgr) typevideo.SetManager(mgr) typeview.SetManager(mgr) + propertyblurhash.SetManager(mgr) + propertydiscoverable.SetManager(mgr) + propertyfeatured.SetManager(mgr) + propertysignaturealgorithm.SetManager(mgr) + propertysignaturevalue.SetManager(mgr) + propertyvoterscount.SetManager(mgr) + typeemoji.SetManager(mgr) + typeidentityproof.SetManager(mgr) propertyowner.SetManager(mgr) propertypublickey.SetManager(mgr) propertypublickeypem.SetManager(mgr) @@ -328,5 +344,7 @@ func init() { typeupdate.SetTypePropertyConstructor(NewJSONLDTypeProperty) typevideo.SetTypePropertyConstructor(NewJSONLDTypeProperty) typeview.SetTypePropertyConstructor(NewJSONLDTypeProperty) + typeemoji.SetTypePropertyConstructor(NewJSONLDTypeProperty) + typeidentityproof.SetTypePropertyConstructor(NewJSONLDTypeProperty) typepublickey.SetTypePropertyConstructor(NewJSONLDTypeProperty) } diff --git a/streams/gen_json_resolver.go b/streams/gen_json_resolver.go index 0654835..f2e2b88 100644 --- a/streams/gen_json_resolver.go +++ b/streams/gen_json_resolver.go @@ -61,6 +61,8 @@ func NewJSONResolver(callbacks ...interface{}) (*JSONResolver, error) { // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsDocument) error: // Do nothing, this callback has a correct signature. + case func(context.Context, vocab.TootEmoji) error: + // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsEvent) error: // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsFlag) error: @@ -69,6 +71,8 @@ func NewJSONResolver(callbacks ...interface{}) (*JSONResolver, error) { // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsGroup) error: // Do nothing, this callback has a correct signature. + case func(context.Context, vocab.TootIdentityProof) error: + // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsIgnore) error: // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsImage) error: @@ -220,6 +224,13 @@ func (this JSONResolver) Resolve(ctx context.Context, m map[string]interface{}) if len(ActivityStreamsAlias) > 0 { ActivityStreamsAlias += ":" } + TootAlias, ok := aliasMap["https://joinmastodon.org/ns"] + if !ok { + TootAlias = aliasMap["http://joinmastodon.org/ns"] + } + if len(TootAlias) > 0 { + TootAlias += ":" + } W3IDSecurityV1Alias, ok := aliasMap["https://w3id.org/security/v1"] if !ok { W3IDSecurityV1Alias = aliasMap["http://w3id.org/security/v1"] @@ -393,6 +404,17 @@ func (this JSONResolver) Resolve(ctx context.Context, m map[string]interface{}) } } return ErrNoCallbackMatch + } else if typeString == TootAlias+"Emoji" { + v, err := mgr.DeserializeEmojiToot()(m, aliasMap) + if err != nil { + return err + } + for _, i := range this.callbacks { + if fn, ok := i.(func(context.Context, vocab.TootEmoji) error); ok { + return fn(ctx, v) + } + } + return ErrNoCallbackMatch } else if typeString == ActivityStreamsAlias+"Event" { v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap) if err != nil { @@ -437,6 +459,17 @@ func (this JSONResolver) Resolve(ctx context.Context, m map[string]interface{}) } } return ErrNoCallbackMatch + } else if typeString == TootAlias+"IdentityProof" { + v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap) + if err != nil { + return err + } + for _, i := range this.callbacks { + if fn, ok := i.(func(context.Context, vocab.TootIdentityProof) error); ok { + return fn(ctx, v) + } + } + return ErrNoCallbackMatch } else if typeString == ActivityStreamsAlias+"Ignore" { v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap) if err != nil { diff --git a/streams/gen_manager.go b/streams/gen_manager.go index 0fb7a68..08f5982 100644 --- a/streams/gen_manager.go +++ b/streams/gen_manager.go @@ -129,6 +129,14 @@ import ( typeview "github.com/go-fed/activity/streams/impl/activitystreams/type_view" propertyid "github.com/go-fed/activity/streams/impl/jsonld/property_id" propertytype "github.com/go-fed/activity/streams/impl/jsonld/property_type" + propertyblurhash "github.com/go-fed/activity/streams/impl/toot/property_blurhash" + propertydiscoverable "github.com/go-fed/activity/streams/impl/toot/property_discoverable" + propertyfeatured "github.com/go-fed/activity/streams/impl/toot/property_featured" + propertysignaturealgorithm "github.com/go-fed/activity/streams/impl/toot/property_signaturealgorithm" + propertysignaturevalue "github.com/go-fed/activity/streams/impl/toot/property_signaturevalue" + propertyvoterscount "github.com/go-fed/activity/streams/impl/toot/property_voterscount" + typeemoji "github.com/go-fed/activity/streams/impl/toot/type_emoji" + typeidentityproof "github.com/go-fed/activity/streams/impl/toot/type_identityproof" propertyowner "github.com/go-fed/activity/streams/impl/w3idsecurityv1/property_owner" propertypublickey "github.com/go-fed/activity/streams/impl/w3idsecurityv1/property_publickey" propertypublickeypem "github.com/go-fed/activity/streams/impl/w3idsecurityv1/property_publickeypem" @@ -363,6 +371,18 @@ func (this Manager) DeserializeBlockActivityStreams() func(map[string]interface{ } } +// DeserializeBlurhashPropertyToot returns the deserialization method for the +// "TootBlurhashProperty" non-functional property in the vocabulary "Toot" +func (this Manager) DeserializeBlurhashPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootBlurhashProperty, error) { + return func(m map[string]interface{}, aliasMap map[string]string) (vocab.TootBlurhashProperty, error) { + i, err := propertyblurhash.DeserializeBlurhashProperty(m, aliasMap) + if i == nil { + return nil, err + } + return i, err + } +} + // DeserializeBtoPropertyActivityStreams returns the deserialization method for // the "ActivityStreamsBtoProperty" non-functional property in the vocabulary // "ActivityStreams" @@ -519,6 +539,18 @@ func (this Manager) DeserializeDescribesPropertyActivityStreams() func(map[strin } } +// DeserializeDiscoverablePropertyToot returns the deserialization method for the +// "TootDiscoverableProperty" non-functional property in the vocabulary "Toot" +func (this Manager) DeserializeDiscoverablePropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootDiscoverableProperty, error) { + return func(m map[string]interface{}, aliasMap map[string]string) (vocab.TootDiscoverableProperty, error) { + i, err := propertydiscoverable.DeserializeDiscoverableProperty(m, aliasMap) + if i == nil { + return nil, err + } + return i, err + } +} + // DeserializeDislikeActivityStreams returns the deserialization method for the // "ActivityStreamsDislike" non-functional property in the vocabulary // "ActivityStreams" @@ -558,6 +590,18 @@ func (this Manager) DeserializeDurationPropertyActivityStreams() func(map[string } } +// DeserializeEmojiToot returns the deserialization method for the "TootEmoji" +// non-functional property in the vocabulary "Toot" +func (this Manager) DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) { + return func(m map[string]interface{}, aliasMap map[string]string) (vocab.TootEmoji, error) { + i, err := typeemoji.DeserializeEmoji(m, aliasMap) + if i == nil { + return nil, err + } + return i, err + } +} + // DeserializeEndTimePropertyActivityStreams returns the deserialization method // for the "ActivityStreamsEndTimeProperty" non-functional property in the // vocabulary "ActivityStreams" @@ -584,6 +628,18 @@ func (this Manager) DeserializeEventActivityStreams() func(map[string]interface{ } } +// DeserializeFeaturedPropertyToot returns the deserialization method for the +// "TootFeaturedProperty" non-functional property in the vocabulary "Toot" +func (this Manager) DeserializeFeaturedPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootFeaturedProperty, error) { + return func(m map[string]interface{}, aliasMap map[string]string) (vocab.TootFeaturedProperty, error) { + i, err := propertyfeatured.DeserializeFeaturedProperty(m, aliasMap) + if i == nil { + return nil, err + } + return i, err + } +} + // DeserializeFirstPropertyActivityStreams returns the deserialization method for // the "ActivityStreamsFirstProperty" non-functional property in the // vocabulary "ActivityStreams" @@ -752,6 +808,18 @@ func (this Manager) DeserializeIdPropertyJSONLD() func(map[string]interface{}, m } } +// DeserializeIdentityProofToot returns the deserialization method for the +// "TootIdentityProof" non-functional property in the vocabulary "Toot" +func (this Manager) DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) { + return func(m map[string]interface{}, aliasMap map[string]string) (vocab.TootIdentityProof, error) { + i, err := typeidentityproof.DeserializeIdentityProof(m, aliasMap) + if i == nil { + return nil, err + } + return i, err + } +} + // DeserializeIgnoreActivityStreams returns the deserialization method for the // "ActivityStreamsIgnore" non-functional property in the vocabulary // "ActivityStreams" @@ -1545,6 +1613,32 @@ func (this Manager) DeserializeSharesPropertyActivityStreams() func(map[string]i } } +// DeserializeSignatureAlgorithmPropertyToot returns the deserialization method +// for the "TootSignatureAlgorithmProperty" non-functional property in the +// vocabulary "Toot" +func (this Manager) DeserializeSignatureAlgorithmPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootSignatureAlgorithmProperty, error) { + return func(m map[string]interface{}, aliasMap map[string]string) (vocab.TootSignatureAlgorithmProperty, error) { + i, err := propertysignaturealgorithm.DeserializeSignatureAlgorithmProperty(m, aliasMap) + if i == nil { + return nil, err + } + return i, err + } +} + +// DeserializeSignatureValuePropertyToot returns the deserialization method for +// the "TootSignatureValueProperty" non-functional property in the vocabulary +// "Toot" +func (this Manager) DeserializeSignatureValuePropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootSignatureValueProperty, error) { + return func(m map[string]interface{}, aliasMap map[string]string) (vocab.TootSignatureValueProperty, error) { + i, err := propertysignaturevalue.DeserializeSignatureValueProperty(m, aliasMap) + if i == nil { + return nil, err + } + return i, err + } +} + // DeserializeStartIndexPropertyActivityStreams returns the deserialization method // for the "ActivityStreamsStartIndexProperty" non-functional property in the // vocabulary "ActivityStreams" @@ -1817,6 +1911,18 @@ func (this Manager) DeserializeViewActivityStreams() func(map[string]interface{} } } +// DeserializeVotersCountPropertyToot returns the deserialization method for the +// "TootVotersCountProperty" non-functional property in the vocabulary "Toot" +func (this Manager) DeserializeVotersCountPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootVotersCountProperty, error) { + return func(m map[string]interface{}, aliasMap map[string]string) (vocab.TootVotersCountProperty, error) { + i, err := propertyvoterscount.DeserializeVotersCountProperty(m, aliasMap) + if i == nil { + return nil, err + } + return i, err + } +} + // DeserializeWidthPropertyActivityStreams returns the deserialization method for // the "ActivityStreamsWidthProperty" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/gen_pkg_toot_disjoint.go b/streams/gen_pkg_toot_disjoint.go new file mode 100644 index 0000000..144f27f --- /dev/null +++ b/streams/gen_pkg_toot_disjoint.go @@ -0,0 +1,20 @@ +// Code generated by astool. DO NOT EDIT. + +package streams + +import ( + typeemoji "github.com/go-fed/activity/streams/impl/toot/type_emoji" + typeidentityproof "github.com/go-fed/activity/streams/impl/toot/type_identityproof" + vocab "github.com/go-fed/activity/streams/vocab" +) + +// TootEmojiIsDisjointWith returns true if Emoji is disjoint with the other's type. +func TootEmojiIsDisjointWith(other vocab.Type) bool { + return typeemoji.EmojiIsDisjointWith(other) +} + +// TootIdentityProofIsDisjointWith returns true if IdentityProof is disjoint with +// the other's type. +func TootIdentityProofIsDisjointWith(other vocab.Type) bool { + return typeidentityproof.IdentityProofIsDisjointWith(other) +} diff --git a/streams/gen_pkg_toot_extendedby.go b/streams/gen_pkg_toot_extendedby.go new file mode 100644 index 0000000..8327ce1 --- /dev/null +++ b/streams/gen_pkg_toot_extendedby.go @@ -0,0 +1,23 @@ +// Code generated by astool. DO NOT EDIT. + +package streams + +import ( + typeemoji "github.com/go-fed/activity/streams/impl/toot/type_emoji" + typeidentityproof "github.com/go-fed/activity/streams/impl/toot/type_identityproof" + vocab "github.com/go-fed/activity/streams/vocab" +) + +// TootEmojiIsExtendedBy returns true if the other's type extends from Emoji. Note +// that it returns false if the types are the same; see the "IsOrExtends" +// variant instead. +func TootEmojiIsExtendedBy(other vocab.Type) bool { + return typeemoji.EmojiIsExtendedBy(other) +} + +// TootIdentityProofIsExtendedBy returns true if the other's type extends from +// IdentityProof. Note that it returns false if the types are the same; see +// the "IsOrExtends" variant instead. +func TootIdentityProofIsExtendedBy(other vocab.Type) bool { + return typeidentityproof.IdentityProofIsExtendedBy(other) +} diff --git a/streams/gen_pkg_toot_extends.go b/streams/gen_pkg_toot_extends.go new file mode 100644 index 0000000..bef71b4 --- /dev/null +++ b/streams/gen_pkg_toot_extends.go @@ -0,0 +1,20 @@ +// Code generated by astool. DO NOT EDIT. + +package streams + +import ( + typeemoji "github.com/go-fed/activity/streams/impl/toot/type_emoji" + typeidentityproof "github.com/go-fed/activity/streams/impl/toot/type_identityproof" + vocab "github.com/go-fed/activity/streams/vocab" +) + +// TootTootEmojiExtends returns true if Emoji extends from the other's type. +func TootTootEmojiExtends(other vocab.Type) bool { + return typeemoji.TootEmojiExtends(other) +} + +// TootTootIdentityProofExtends returns true if IdentityProof extends from the +// other's type. +func TootTootIdentityProofExtends(other vocab.Type) bool { + return typeidentityproof.TootIdentityProofExtends(other) +} diff --git a/streams/gen_pkg_toot_isorextends.go b/streams/gen_pkg_toot_isorextends.go new file mode 100644 index 0000000..6890c59 --- /dev/null +++ b/streams/gen_pkg_toot_isorextends.go @@ -0,0 +1,21 @@ +// Code generated by astool. DO NOT EDIT. + +package streams + +import ( + typeemoji "github.com/go-fed/activity/streams/impl/toot/type_emoji" + typeidentityproof "github.com/go-fed/activity/streams/impl/toot/type_identityproof" + vocab "github.com/go-fed/activity/streams/vocab" +) + +// IsOrExtendsTootEmoji returns true if the other provided type is the Emoji type +// or extends from the Emoji type. +func IsOrExtendsTootEmoji(other vocab.Type) bool { + return typeemoji.IsOrExtendsEmoji(other) +} + +// IsOrExtendsTootIdentityProof returns true if the other provided type is the +// IdentityProof type or extends from the IdentityProof type. +func IsOrExtendsTootIdentityProof(other vocab.Type) bool { + return typeidentityproof.IsOrExtendsIdentityProof(other) +} diff --git a/streams/gen_pkg_toot_property_constructors.go b/streams/gen_pkg_toot_property_constructors.go new file mode 100644 index 0000000..b93c20c --- /dev/null +++ b/streams/gen_pkg_toot_property_constructors.go @@ -0,0 +1,44 @@ +// Code generated by astool. DO NOT EDIT. + +package streams + +import ( + propertyblurhash "github.com/go-fed/activity/streams/impl/toot/property_blurhash" + propertydiscoverable "github.com/go-fed/activity/streams/impl/toot/property_discoverable" + propertyfeatured "github.com/go-fed/activity/streams/impl/toot/property_featured" + propertysignaturealgorithm "github.com/go-fed/activity/streams/impl/toot/property_signaturealgorithm" + propertysignaturevalue "github.com/go-fed/activity/streams/impl/toot/property_signaturevalue" + propertyvoterscount "github.com/go-fed/activity/streams/impl/toot/property_voterscount" + vocab "github.com/go-fed/activity/streams/vocab" +) + +// NewTootTootBlurhashProperty creates a new TootBlurhashProperty +func NewTootBlurhashProperty() vocab.TootBlurhashProperty { + return propertyblurhash.NewTootBlurhashProperty() +} + +// NewTootTootDiscoverableProperty creates a new TootDiscoverableProperty +func NewTootDiscoverableProperty() vocab.TootDiscoverableProperty { + return propertydiscoverable.NewTootDiscoverableProperty() +} + +// NewTootTootFeaturedProperty creates a new TootFeaturedProperty +func NewTootFeaturedProperty() vocab.TootFeaturedProperty { + return propertyfeatured.NewTootFeaturedProperty() +} + +// NewTootTootSignatureAlgorithmProperty creates a new +// TootSignatureAlgorithmProperty +func NewTootSignatureAlgorithmProperty() vocab.TootSignatureAlgorithmProperty { + return propertysignaturealgorithm.NewTootSignatureAlgorithmProperty() +} + +// NewTootTootSignatureValueProperty creates a new TootSignatureValueProperty +func NewTootSignatureValueProperty() vocab.TootSignatureValueProperty { + return propertysignaturevalue.NewTootSignatureValueProperty() +} + +// NewTootTootVotersCountProperty creates a new TootVotersCountProperty +func NewTootVotersCountProperty() vocab.TootVotersCountProperty { + return propertyvoterscount.NewTootVotersCountProperty() +} diff --git a/streams/gen_pkg_toot_type_constructors.go b/streams/gen_pkg_toot_type_constructors.go new file mode 100644 index 0000000..77ba41c --- /dev/null +++ b/streams/gen_pkg_toot_type_constructors.go @@ -0,0 +1,19 @@ +// Code generated by astool. DO NOT EDIT. + +package streams + +import ( + typeemoji "github.com/go-fed/activity/streams/impl/toot/type_emoji" + typeidentityproof "github.com/go-fed/activity/streams/impl/toot/type_identityproof" + vocab "github.com/go-fed/activity/streams/vocab" +) + +// NewTootEmoji creates a new TootEmoji +func NewTootEmoji() vocab.TootEmoji { + return typeemoji.NewTootEmoji() +} + +// NewTootIdentityProof creates a new TootIdentityProof +func NewTootIdentityProof() vocab.TootIdentityProof { + return typeidentityproof.NewTootIdentityProof() +} diff --git a/streams/gen_resolver_utils.go b/streams/gen_resolver_utils.go index e1d8506..f4a7df0 100644 --- a/streams/gen_resolver_utils.go +++ b/streams/gen_resolver_utils.go @@ -91,6 +91,9 @@ func ToType(c context.Context, m map[string]interface{}) (t vocab.Type, err erro }, func(ctx context.Context, i vocab.ActivityStreamsDocument) error { t = i return nil + }, func(ctx context.Context, i vocab.TootEmoji) error { + t = i + return nil }, func(ctx context.Context, i vocab.ActivityStreamsEvent) error { t = i return nil @@ -103,6 +106,9 @@ func ToType(c context.Context, m map[string]interface{}) (t vocab.Type, err erro }, func(ctx context.Context, i vocab.ActivityStreamsGroup) error { t = i return nil + }, func(ctx context.Context, i vocab.TootIdentityProof) error { + t = i + return nil }, func(ctx context.Context, i vocab.ActivityStreamsIgnore) error { t = i return nil diff --git a/streams/gen_type_predicated_resolver.go b/streams/gen_type_predicated_resolver.go index 68db722..a943592 100644 --- a/streams/gen_type_predicated_resolver.go +++ b/streams/gen_type_predicated_resolver.go @@ -59,6 +59,8 @@ func NewTypePredicatedResolver(delegate Resolver, predicate interface{}) (*TypeP // Do nothing, this predicate has a correct signature. case func(context.Context, vocab.ActivityStreamsDocument) (bool, error): // Do nothing, this predicate has a correct signature. + case func(context.Context, vocab.TootEmoji) (bool, error): + // Do nothing, this predicate has a correct signature. case func(context.Context, vocab.ActivityStreamsEvent) (bool, error): // Do nothing, this predicate has a correct signature. case func(context.Context, vocab.ActivityStreamsFlag) (bool, error): @@ -67,6 +69,8 @@ func NewTypePredicatedResolver(delegate Resolver, predicate interface{}) (*TypeP // Do nothing, this predicate has a correct signature. case func(context.Context, vocab.ActivityStreamsGroup) (bool, error): // Do nothing, this predicate has a correct signature. + case func(context.Context, vocab.TootIdentityProof) (bool, error): + // Do nothing, this predicate has a correct signature. case func(context.Context, vocab.ActivityStreamsIgnore) (bool, error): // Do nothing, this predicate has a correct signature. case func(context.Context, vocab.ActivityStreamsImage) (bool, error): @@ -323,6 +327,17 @@ func (this TypePredicatedResolver) Apply(ctx context.Context, o ActivityStreamsI } else { return false, ErrPredicateUnmatched } + } else if o.VocabularyURI() == "http://joinmastodon.org/ns" && o.GetTypeName() == "Emoji" { + if fn, ok := this.predicate.(func(context.Context, vocab.TootEmoji) (bool, error)); ok { + if v, ok := o.(vocab.TootEmoji); 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() == "Event" { if fn, ok := this.predicate.(func(context.Context, vocab.ActivityStreamsEvent) (bool, error)); ok { if v, ok := o.(vocab.ActivityStreamsEvent); ok { @@ -367,6 +382,17 @@ func (this TypePredicatedResolver) Apply(ctx context.Context, o ActivityStreamsI } else { return false, ErrPredicateUnmatched } + } else if o.VocabularyURI() == "http://joinmastodon.org/ns" && o.GetTypeName() == "IdentityProof" { + if fn, ok := this.predicate.(func(context.Context, vocab.TootIdentityProof) (bool, error)); ok { + if v, ok := o.(vocab.TootIdentityProof); 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() == "Ignore" { if fn, ok := this.predicate.(func(context.Context, vocab.ActivityStreamsIgnore) (bool, error)); ok { if v, ok := o.(vocab.ActivityStreamsIgnore); ok { diff --git a/streams/gen_type_resolver.go b/streams/gen_type_resolver.go index 31c03f9..f6706ba 100644 --- a/streams/gen_type_resolver.go +++ b/streams/gen_type_resolver.go @@ -58,6 +58,8 @@ func NewTypeResolver(callbacks ...interface{}) (*TypeResolver, error) { // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsDocument) error: // Do nothing, this callback has a correct signature. + case func(context.Context, vocab.TootEmoji) error: + // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsEvent) error: // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsFlag) error: @@ -66,6 +68,8 @@ func NewTypeResolver(callbacks ...interface{}) (*TypeResolver, error) { // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsGroup) error: // Do nothing, this callback has a correct signature. + case func(context.Context, vocab.TootIdentityProof) error: + // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsIgnore) error: // Do nothing, this callback has a correct signature. case func(context.Context, vocab.ActivityStreamsImage) error: @@ -288,6 +292,15 @@ func (this TypeResolver) Resolve(ctx context.Context, o ActivityStreamsInterface return errCannotTypeAssertType } } + } else if o.VocabularyURI() == "http://joinmastodon.org/ns" && o.GetTypeName() == "Emoji" { + if fn, ok := i.(func(context.Context, vocab.TootEmoji) error); ok { + if v, ok := o.(vocab.TootEmoji); 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() == "Event" { if fn, ok := i.(func(context.Context, vocab.ActivityStreamsEvent) error); ok { if v, ok := o.(vocab.ActivityStreamsEvent); ok { @@ -324,6 +337,15 @@ func (this TypeResolver) Resolve(ctx context.Context, o ActivityStreamsInterface return errCannotTypeAssertType } } + } else if o.VocabularyURI() == "http://joinmastodon.org/ns" && o.GetTypeName() == "IdentityProof" { + if fn, ok := i.(func(context.Context, vocab.TootIdentityProof) error); ok { + if v, ok := o.(vocab.TootIdentityProof); 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() == "Ignore" { if fn, ok := i.(func(context.Context, vocab.ActivityStreamsIgnore) error); ok { if v, ok := o.(vocab.ActivityStreamsIgnore); ok { diff --git a/streams/impl/activitystreams/property_actor/gen_pkg.go b/streams/impl/activitystreams/property_actor/gen_pkg.go index aa48d14..8d83e86 100644 --- a/streams/impl/activitystreams/property_actor/gen_pkg.go +++ b/streams/impl/activitystreams/property_actor/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_actor/gen_property_activitystreams_actor.go b/streams/impl/activitystreams/property_actor/gen_property_activitystreams_actor.go index 6cfbefd..a16ab18 100644 --- a/streams/impl/activitystreams/property_actor/gen_property_activitystreams_actor.go +++ b/streams/impl/activitystreams/property_actor/gen_property_activitystreams_actor.go @@ -31,10 +31,12 @@ type ActivityStreamsActorPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsActorPropertyIterator(i interface{}, aliasMap map alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsActorPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsActorPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsActorPropertyIterator(i interface{}, aliasMap map alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsActorPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsActorPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsActorPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsActorPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsActorPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsActorPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsActorPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsActorPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsActorPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsActorPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsActorPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsActorPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsActorPropertyIterator) JSONLDContext() map[string]stri child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsActorPropertyIterator) JSONLDContext() map[string]stri child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsActorPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsActorPropertyIterator) LessThan(o vocab.ActivityStream return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsActorPropertyIterator) LessThan(o vocab.ActivityStream return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsActorPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsActorPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsActorPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsActorPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsActorPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsActorPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsActorPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsActorPropertyIterator) serialize() (interface{}, error return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsActorPropertyIterator) serialize() (interface{}, error return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3342,6 +3432,28 @@ func (this *ActivityStreamsActorProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "actor". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsActorProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsActorPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "actor". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsActorProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsActorPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "actor". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4322,6 +4434,40 @@ func (this *ActivityStreamsActorProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "actor". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsActorProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsActorPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "actor". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsActorProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsActorPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "actor". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4452,150 +4598,158 @@ func (this ActivityStreamsActorProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5409,6 +5563,34 @@ func (this *ActivityStreamsActorProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "actor". Invalidates all iterators. +func (this *ActivityStreamsActorProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsActorPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "actor". Invalidates all iterators. +func (this *ActivityStreamsActorProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsActorPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "actor". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6175,6 +6357,31 @@ func (this *ActivityStreamsActorProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "actor". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsActorProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsActorPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "actor". Panics if the index is out of bounds. Invalidates +// all iterators. +func (this *ActivityStreamsActorProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsActorPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "actor". 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. diff --git a/streams/impl/activitystreams/property_anyof/gen_pkg.go b/streams/impl/activitystreams/property_anyof/gen_pkg.go index 8adbe26..c0d0aa1 100644 --- a/streams/impl/activitystreams/property_anyof/gen_pkg.go +++ b/streams/impl/activitystreams/property_anyof/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_anyof/gen_property_activitystreams_anyOf.go b/streams/impl/activitystreams/property_anyof/gen_property_activitystreams_anyOf.go index 8d60d97..779ead0 100644 --- a/streams/impl/activitystreams/property_anyof/gen_property_activitystreams_anyOf.go +++ b/streams/impl/activitystreams/property_anyof/gen_property_activitystreams_anyOf.go @@ -31,10 +31,12 @@ type ActivityStreamsAnyOfPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsAnyOfPropertyIterator(i interface{}, aliasMap map alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsAnyOfPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsAnyOfPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsAnyOfPropertyIterator(i interface{}, aliasMap map alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsAnyOfPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsAnyOfPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsAnyOfPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsAnyOfPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsAnyOfPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsAnyOfPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsAnyOfPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsAnyOfPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsAnyOfPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsAnyOfPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsAnyOfPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsAnyOfPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsAnyOfPropertyIterator) JSONLDContext() map[string]stri child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsAnyOfPropertyIterator) JSONLDContext() map[string]stri child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsAnyOfPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsAnyOfPropertyIterator) LessThan(o vocab.ActivityStream return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsAnyOfPropertyIterator) LessThan(o vocab.ActivityStream return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsAnyOfPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsAnyOfPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsAnyOfPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsAnyOfPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsAnyOfPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsAnyOfPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsAnyOfPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsAnyOfPropertyIterator) serialize() (interface{}, error return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsAnyOfPropertyIterator) serialize() (interface{}, error return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3342,6 +3432,28 @@ func (this *ActivityStreamsAnyOfProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "anyOf". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsAnyOfProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsAnyOfPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "anyOf". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsAnyOfProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsAnyOfPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "anyOf". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4322,6 +4434,40 @@ func (this *ActivityStreamsAnyOfProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "anyOf". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsAnyOfProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsAnyOfPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "anyOf". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsAnyOfProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsAnyOfPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "anyOf". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4452,150 +4598,158 @@ func (this ActivityStreamsAnyOfProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5409,6 +5563,34 @@ func (this *ActivityStreamsAnyOfProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "anyOf". Invalidates all iterators. +func (this *ActivityStreamsAnyOfProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsAnyOfPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "anyOf". Invalidates all iterators. +func (this *ActivityStreamsAnyOfProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsAnyOfPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "anyOf". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6175,6 +6357,31 @@ func (this *ActivityStreamsAnyOfProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "anyOf". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsAnyOfProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsAnyOfPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "anyOf". Panics if the index is out of bounds. Invalidates +// all iterators. +func (this *ActivityStreamsAnyOfProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsAnyOfPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "anyOf". 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. diff --git a/streams/impl/activitystreams/property_attachment/gen_pkg.go b/streams/impl/activitystreams/property_attachment/gen_pkg.go index 97e8d5e..1d8f748 100644 --- a/streams/impl/activitystreams/property_attachment/gen_pkg.go +++ b/streams/impl/activitystreams/property_attachment/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_attachment/gen_property_activitystreams_attachment.go b/streams/impl/activitystreams/property_attachment/gen_property_activitystreams_attachment.go index 7d3b180..c3cc309 100644 --- a/streams/impl/activitystreams/property_attachment/gen_property_activitystreams_attachment.go +++ b/streams/impl/activitystreams/property_attachment/gen_property_activitystreams_attachment.go @@ -31,10 +31,12 @@ type ActivityStreamsAttachmentPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsAttachmentPropertyIterator(i interface{}, aliasMa alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsAttachmentPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsAttachmentPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsAttachmentPropertyIterator(i interface{}, aliasMa alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsAttachmentPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsAttachmentPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsAttachmentPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsAttachmentPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsAttachmentPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsAttachmentPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsAttachmentPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsAttachmentPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsAttachmentPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsAttachmentPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsAttachmentPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsAttachmentPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsAttachmentPropertyIterator) JSONLDContext() map[string child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsAttachmentPropertyIterator) JSONLDContext() map[string child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsAttachmentPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsAttachmentPropertyIterator) LessThan(o vocab.ActivityS return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsAttachmentPropertyIterator) LessThan(o vocab.ActivityS return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsAttachmentPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsAttachmentPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsAttachmentPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsAttachmentPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsAttachmentPropertyIterator) SetType(t vocab.Type) err this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsAttachmentPropertyIterator) SetType(t vocab.Type) err this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsAttachmentPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsAttachmentPropertyIterator) serialize() (interface{}, return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsAttachmentPropertyIterator) serialize() (interface{}, return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3352,6 +3442,29 @@ func (this *ActivityStreamsAttachmentProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "attachment". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsAttachmentProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsAttachmentPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "attachment". Invalidates iterators that are traversing using +// Prev. +func (this *ActivityStreamsAttachmentProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsAttachmentPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "attachment". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for this @@ -4333,6 +4446,40 @@ func (this *ActivityStreamsAttachmentProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "attachment". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsAttachmentProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsAttachmentPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "attachment". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsAttachmentProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsAttachmentPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "attachment". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4463,150 +4610,158 @@ func (this ActivityStreamsAttachmentProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5421,6 +5576,34 @@ func (this *ActivityStreamsAttachmentProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "attachment". Invalidates all iterators. +func (this *ActivityStreamsAttachmentProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsAttachmentPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "attachment". Invalidates all iterators. +func (this *ActivityStreamsAttachmentProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsAttachmentPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "attachment". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6187,6 +6370,32 @@ func (this *ActivityStreamsAttachmentProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "attachment". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *ActivityStreamsAttachmentProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsAttachmentPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "attachment". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsAttachmentProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsAttachmentPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "attachment". 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 diff --git a/streams/impl/activitystreams/property_attributedto/gen_pkg.go b/streams/impl/activitystreams/property_attributedto/gen_pkg.go index 20bd8bf..4955180 100644 --- a/streams/impl/activitystreams/property_attributedto/gen_pkg.go +++ b/streams/impl/activitystreams/property_attributedto/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_attributedto/gen_property_activitystreams_attributedTo.go b/streams/impl/activitystreams/property_attributedto/gen_property_activitystreams_attributedTo.go index adac9de..4eade4b 100644 --- a/streams/impl/activitystreams/property_attributedto/gen_property_activitystreams_attributedTo.go +++ b/streams/impl/activitystreams/property_attributedto/gen_property_activitystreams_attributedTo.go @@ -31,10 +31,12 @@ type ActivityStreamsAttributedToPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsAttributedToPropertyIterator(i interface{}, alias alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsAttributedToPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsAttributedToPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsAttributedToPropertyIterator(i interface{}, alias alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsAttributedToPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsAttributedToPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsAttributedToPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsAttributedToPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsAttributedToPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsAttributedToPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsAttributedToPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsAttributedToPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsAttributedToPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsAttributedToPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsAttributedToPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsAttributedToPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsAttributedToPropertyIterator) JSONLDContext() map[stri child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsAttributedToPropertyIterator) JSONLDContext() map[stri child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsAttributedToPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsAttributedToPropertyIterator) LessThan(o vocab.Activit return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsAttributedToPropertyIterator) LessThan(o vocab.Activit return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsAttributedToPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsAttributedToPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsAttributedToPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsAttributedToPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsAttributedToPropertyIterator) SetType(t vocab.Type) e this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsAttributedToPropertyIterator) SetType(t vocab.Type) e this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsAttributedToPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsAttributedToPropertyIterator) serialize() (interface{} return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsAttributedToPropertyIterator) serialize() (interface{} return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3388,6 +3478,29 @@ func (this *ActivityStreamsAttributedToProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "attributedTo". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsAttributedToProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsAttributedToPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "attributedTo". Invalidates iterators that are traversing +// using Prev. +func (this *ActivityStreamsAttributedToProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsAttributedToPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "attributedTo". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for this @@ -4370,6 +4483,40 @@ func (this *ActivityStreamsAttributedToProperty) InsertIRI(idx int, v *url.URL) } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "attributedTo". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsAttributedToProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsAttributedToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "attributedTo". Existing elements at that index and higher +// are shifted back once. Invalidates all iterators. +func (this *ActivityStreamsAttributedToProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsAttributedToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "attributedTo". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4500,150 +4647,158 @@ func (this ActivityStreamsAttributedToProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5459,6 +5614,34 @@ func (this *ActivityStreamsAttributedToProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "attributedTo". Invalidates all iterators. +func (this *ActivityStreamsAttributedToProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsAttributedToPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "attributedTo". Invalidates all iterators. +func (this *ActivityStreamsAttributedToProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsAttributedToPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "attributedTo". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6225,6 +6408,32 @@ func (this *ActivityStreamsAttributedToProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "attributedTo". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *ActivityStreamsAttributedToProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsAttributedToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "attributedTo". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsAttributedToProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsAttributedToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "attributedTo". 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 diff --git a/streams/impl/activitystreams/property_audience/gen_pkg.go b/streams/impl/activitystreams/property_audience/gen_pkg.go index 40d5011..89401e7 100644 --- a/streams/impl/activitystreams/property_audience/gen_pkg.go +++ b/streams/impl/activitystreams/property_audience/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_audience/gen_property_activitystreams_audience.go b/streams/impl/activitystreams/property_audience/gen_property_activitystreams_audience.go index 8b1b845..188a078 100644 --- a/streams/impl/activitystreams/property_audience/gen_property_activitystreams_audience.go +++ b/streams/impl/activitystreams/property_audience/gen_property_activitystreams_audience.go @@ -31,10 +31,12 @@ type ActivityStreamsAudiencePropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsAudiencePropertyIterator(i interface{}, aliasMap alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsAudiencePropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsAudiencePropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsAudiencePropertyIterator(i interface{}, aliasMap alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsAudiencePropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsAudiencePropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsAudiencePropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsAudiencePropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsAudiencePropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsAudiencePropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsAudiencePropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsAudiencePropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsAudiencePropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsAudiencePropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsAudiencePropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsAudiencePropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsAudiencePropertyIterator) JSONLDContext() map[string]s child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsAudiencePropertyIterator) JSONLDContext() map[string]s child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsAudiencePropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsAudiencePropertyIterator) LessThan(o vocab.ActivityStr return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsAudiencePropertyIterator) LessThan(o vocab.ActivityStr return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsAudiencePropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsAudiencePropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsAudiencePropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsAudiencePropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsAudiencePropertyIterator) SetType(t vocab.Type) error this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsAudiencePropertyIterator) SetType(t vocab.Type) error this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsAudiencePropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsAudiencePropertyIterator) serialize() (interface{}, er return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsAudiencePropertyIterator) serialize() (interface{}, er return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3351,6 +3441,29 @@ func (this *ActivityStreamsAudienceProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "audience". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsAudienceProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsAudiencePropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "audience". Invalidates iterators that are traversing using +// Prev. +func (this *ActivityStreamsAudienceProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsAudiencePropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "audience". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4331,6 +4444,40 @@ func (this *ActivityStreamsAudienceProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "audience". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsAudienceProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsAudiencePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "audience". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsAudienceProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsAudiencePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "audience". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4461,150 +4608,158 @@ func (this ActivityStreamsAudienceProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5419,6 +5574,34 @@ func (this *ActivityStreamsAudienceProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "audience". Invalidates all iterators. +func (this *ActivityStreamsAudienceProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsAudiencePropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "audience". Invalidates all iterators. +func (this *ActivityStreamsAudienceProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsAudiencePropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "audience". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6185,6 +6368,31 @@ func (this *ActivityStreamsAudienceProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "audience". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsAudienceProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsAudiencePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "audience". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsAudienceProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsAudiencePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "audience". 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. diff --git a/streams/impl/activitystreams/property_bcc/gen_pkg.go b/streams/impl/activitystreams/property_bcc/gen_pkg.go index 9ac9b73..0e4f177 100644 --- a/streams/impl/activitystreams/property_bcc/gen_pkg.go +++ b/streams/impl/activitystreams/property_bcc/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_bcc/gen_property_activitystreams_bcc.go b/streams/impl/activitystreams/property_bcc/gen_property_activitystreams_bcc.go index 3240c5a..bf3eec6 100644 --- a/streams/impl/activitystreams/property_bcc/gen_property_activitystreams_bcc.go +++ b/streams/impl/activitystreams/property_bcc/gen_property_activitystreams_bcc.go @@ -31,10 +31,12 @@ type ActivityStreamsBccPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -202,6 +204,12 @@ func deserializeActivityStreamsBccPropertyIterator(i interface{}, aliasMap map[s alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsBccPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsBccPropertyIterator{ activitystreamsEventMember: v, @@ -226,6 +234,12 @@ func deserializeActivityStreamsBccPropertyIterator(i interface{}, aliasMap map[s alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsBccPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsBccPropertyIterator{ activitystreamsIgnoreMember: v, @@ -817,6 +831,19 @@ func (this ActivityStreamsBccPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsBccPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsBccPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsBccPropertyIterator) GetType() vocab.Type { @@ -871,6 +898,9 @@ func (this ActivityStreamsBccPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -883,6 +913,9 @@ func (this ActivityStreamsBccPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1005,10 +1038,12 @@ func (this ActivityStreamsBccPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1434,6 +1469,19 @@ func (this ActivityStreamsBccPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsBccPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsBccPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1474,6 +1522,8 @@ func (this ActivityStreamsBccPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1482,6 +1532,8 @@ func (this ActivityStreamsBccPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1615,117 +1667,123 @@ func (this ActivityStreamsBccPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1777,6 +1835,8 @@ func (this ActivityStreamsBccPropertyIterator) LessThan(o vocab.ActivityStreamsB return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1785,6 +1845,8 @@ func (this ActivityStreamsBccPropertyIterator) LessThan(o vocab.ActivityStreamsB return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2268,6 +2330,20 @@ func (this *ActivityStreamsBccPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsBccPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsBccPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsBccPropertyIterator) SetType(t vocab.Type) error { @@ -2339,6 +2415,10 @@ func (this *ActivityStreamsBccPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2355,6 +2435,10 @@ func (this *ActivityStreamsBccPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2511,10 +2595,12 @@ func (this *ActivityStreamsBccPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2591,6 +2677,8 @@ func (this ActivityStreamsBccPropertyIterator) serialize() (interface{}, error) return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2599,6 +2687,8 @@ func (this ActivityStreamsBccPropertyIterator) serialize() (interface{}, error) return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3340,6 +3430,28 @@ func (this *ActivityStreamsBccProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "bcc". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsBccProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsBccPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "bcc". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsBccProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsBccPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "bcc". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4320,6 +4432,40 @@ func (this *ActivityStreamsBccProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "bcc". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsBccProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsBccPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "bcc". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsBccProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsBccPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "bcc". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -4450,150 +4596,158 @@ func (this ActivityStreamsBccProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5407,6 +5561,34 @@ func (this *ActivityStreamsBccProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "bcc". Invalidates all iterators. +func (this *ActivityStreamsBccProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsBccPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "bcc". Invalidates all iterators. +func (this *ActivityStreamsBccProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsBccPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "bcc". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -6173,6 +6355,31 @@ func (this *ActivityStreamsBccProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "bcc". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsBccProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsBccPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "bcc". Panics if the index is out of bounds. Invalidates +// all iterators. +func (this *ActivityStreamsBccProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsBccPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "bcc". 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. diff --git a/streams/impl/activitystreams/property_bto/gen_pkg.go b/streams/impl/activitystreams/property_bto/gen_pkg.go index 75bab6c..365eaf2 100644 --- a/streams/impl/activitystreams/property_bto/gen_pkg.go +++ b/streams/impl/activitystreams/property_bto/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_bto/gen_property_activitystreams_bto.go b/streams/impl/activitystreams/property_bto/gen_property_activitystreams_bto.go index 7dfb9eb..73fd2b8 100644 --- a/streams/impl/activitystreams/property_bto/gen_property_activitystreams_bto.go +++ b/streams/impl/activitystreams/property_bto/gen_property_activitystreams_bto.go @@ -31,10 +31,12 @@ type ActivityStreamsBtoPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -202,6 +204,12 @@ func deserializeActivityStreamsBtoPropertyIterator(i interface{}, aliasMap map[s alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsBtoPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsBtoPropertyIterator{ activitystreamsEventMember: v, @@ -226,6 +234,12 @@ func deserializeActivityStreamsBtoPropertyIterator(i interface{}, aliasMap map[s alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsBtoPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsBtoPropertyIterator{ activitystreamsIgnoreMember: v, @@ -817,6 +831,19 @@ func (this ActivityStreamsBtoPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsBtoPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsBtoPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsBtoPropertyIterator) GetType() vocab.Type { @@ -871,6 +898,9 @@ func (this ActivityStreamsBtoPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -883,6 +913,9 @@ func (this ActivityStreamsBtoPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1005,10 +1038,12 @@ func (this ActivityStreamsBtoPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1434,6 +1469,19 @@ func (this ActivityStreamsBtoPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsBtoPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsBtoPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1474,6 +1522,8 @@ func (this ActivityStreamsBtoPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1482,6 +1532,8 @@ func (this ActivityStreamsBtoPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1615,117 +1667,123 @@ func (this ActivityStreamsBtoPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1777,6 +1835,8 @@ func (this ActivityStreamsBtoPropertyIterator) LessThan(o vocab.ActivityStreamsB return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1785,6 +1845,8 @@ func (this ActivityStreamsBtoPropertyIterator) LessThan(o vocab.ActivityStreamsB return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2268,6 +2330,20 @@ func (this *ActivityStreamsBtoPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsBtoPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsBtoPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsBtoPropertyIterator) SetType(t vocab.Type) error { @@ -2339,6 +2415,10 @@ func (this *ActivityStreamsBtoPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2355,6 +2435,10 @@ func (this *ActivityStreamsBtoPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2511,10 +2595,12 @@ func (this *ActivityStreamsBtoPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2591,6 +2677,8 @@ func (this ActivityStreamsBtoPropertyIterator) serialize() (interface{}, error) return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2599,6 +2687,8 @@ func (this ActivityStreamsBtoPropertyIterator) serialize() (interface{}, error) return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3340,6 +3430,28 @@ func (this *ActivityStreamsBtoProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "bto". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsBtoProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsBtoPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "bto". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsBtoProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsBtoPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "bto". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4320,6 +4432,40 @@ func (this *ActivityStreamsBtoProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "bto". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsBtoProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsBtoPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "bto". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsBtoProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsBtoPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "bto". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -4450,150 +4596,158 @@ func (this ActivityStreamsBtoProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5407,6 +5561,34 @@ func (this *ActivityStreamsBtoProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "bto". Invalidates all iterators. +func (this *ActivityStreamsBtoProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsBtoPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "bto". Invalidates all iterators. +func (this *ActivityStreamsBtoProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsBtoPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "bto". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -6173,6 +6355,31 @@ func (this *ActivityStreamsBtoProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "bto". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsBtoProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsBtoPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "bto". Panics if the index is out of bounds. Invalidates +// all iterators. +func (this *ActivityStreamsBtoProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsBtoPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "bto". 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. diff --git a/streams/impl/activitystreams/property_cc/gen_pkg.go b/streams/impl/activitystreams/property_cc/gen_pkg.go index 3004b62..07b9b69 100644 --- a/streams/impl/activitystreams/property_cc/gen_pkg.go +++ b/streams/impl/activitystreams/property_cc/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_cc/gen_property_activitystreams_cc.go b/streams/impl/activitystreams/property_cc/gen_property_activitystreams_cc.go index 923a8ee..d049cfc 100644 --- a/streams/impl/activitystreams/property_cc/gen_property_activitystreams_cc.go +++ b/streams/impl/activitystreams/property_cc/gen_property_activitystreams_cc.go @@ -31,10 +31,12 @@ type ActivityStreamsCcPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -202,6 +204,12 @@ func deserializeActivityStreamsCcPropertyIterator(i interface{}, aliasMap map[st alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsCcPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsCcPropertyIterator{ activitystreamsEventMember: v, @@ -226,6 +234,12 @@ func deserializeActivityStreamsCcPropertyIterator(i interface{}, aliasMap map[st alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsCcPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsCcPropertyIterator{ activitystreamsIgnoreMember: v, @@ -817,6 +831,19 @@ func (this ActivityStreamsCcPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsCcPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsCcPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsCcPropertyIterator) GetType() vocab.Type { @@ -871,6 +898,9 @@ func (this ActivityStreamsCcPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -883,6 +913,9 @@ func (this ActivityStreamsCcPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1005,10 +1038,12 @@ func (this ActivityStreamsCcPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1434,6 +1469,19 @@ func (this ActivityStreamsCcPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsCcPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsCcPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1474,6 +1522,8 @@ func (this ActivityStreamsCcPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1482,6 +1532,8 @@ func (this ActivityStreamsCcPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1615,117 +1667,123 @@ func (this ActivityStreamsCcPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1777,6 +1835,8 @@ func (this ActivityStreamsCcPropertyIterator) LessThan(o vocab.ActivityStreamsCc return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1785,6 +1845,8 @@ func (this ActivityStreamsCcPropertyIterator) LessThan(o vocab.ActivityStreamsCc return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2268,6 +2330,20 @@ func (this *ActivityStreamsCcPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsCcPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsCcPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsCcPropertyIterator) SetType(t vocab.Type) error { @@ -2339,6 +2415,10 @@ func (this *ActivityStreamsCcPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2355,6 +2435,10 @@ func (this *ActivityStreamsCcPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2511,10 +2595,12 @@ func (this *ActivityStreamsCcPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2591,6 +2677,8 @@ func (this ActivityStreamsCcPropertyIterator) serialize() (interface{}, error) { return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2599,6 +2687,8 @@ func (this ActivityStreamsCcPropertyIterator) serialize() (interface{}, error) { return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3340,6 +3430,28 @@ func (this *ActivityStreamsCcProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "cc". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsCcProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsCcPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "cc". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsCcProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsCcPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "cc". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4320,6 +4432,40 @@ func (this *ActivityStreamsCcProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "cc". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsCcProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsCcPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "cc". Existing elements at that index and higher are shifted +// back once. Invalidates all iterators. +func (this *ActivityStreamsCcProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsCcPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "cc". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -4450,150 +4596,158 @@ func (this ActivityStreamsCcProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5407,6 +5561,34 @@ func (this *ActivityStreamsCcProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "cc". Invalidates all iterators. +func (this *ActivityStreamsCcProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsCcPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "cc". Invalidates all iterators. +func (this *ActivityStreamsCcProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsCcPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "cc". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -6173,6 +6355,31 @@ func (this *ActivityStreamsCcProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "cc". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsCcProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsCcPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "cc". Panics if the index is out of bounds. Invalidates +// all iterators. +func (this *ActivityStreamsCcProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsCcPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "cc". 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. diff --git a/streams/impl/activitystreams/property_closed/gen_pkg.go b/streams/impl/activitystreams/property_closed/gen_pkg.go index c105d49..3cd546b 100644 --- a/streams/impl/activitystreams/property_closed/gen_pkg.go +++ b/streams/impl/activitystreams/property_closed/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_closed/gen_property_activitystreams_closed.go b/streams/impl/activitystreams/property_closed/gen_property_activitystreams_closed.go index 45fad3a..da1e864 100644 --- a/streams/impl/activitystreams/property_closed/gen_property_activitystreams_closed.go +++ b/streams/impl/activitystreams/property_closed/gen_property_activitystreams_closed.go @@ -38,10 +38,12 @@ type ActivityStreamsClosedPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -210,6 +212,12 @@ func deserializeActivityStreamsClosedPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsClosedPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsClosedPropertyIterator{ activitystreamsEventMember: v, @@ -234,6 +242,12 @@ func deserializeActivityStreamsClosedPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsClosedPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsClosedPropertyIterator{ activitystreamsIgnoreMember: v, @@ -840,6 +854,19 @@ func (this ActivityStreamsClosedPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsClosedPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsClosedPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsClosedPropertyIterator) GetType() vocab.Type { @@ -894,6 +921,9 @@ func (this ActivityStreamsClosedPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -906,6 +936,9 @@ func (this ActivityStreamsClosedPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1043,10 +1076,12 @@ func (this ActivityStreamsClosedPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1472,6 +1507,19 @@ func (this ActivityStreamsClosedPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsClosedPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsClosedPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != nil +} + // IsXMLSchemaBoolean returns true if this property has a type of "boolean". When // true, use the GetXMLSchemaBoolean and SetXMLSchemaBoolean methods to access // and set this property. @@ -1526,6 +1574,8 @@ func (this ActivityStreamsClosedPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1534,6 +1584,8 @@ func (this ActivityStreamsClosedPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1673,117 +1725,123 @@ func (this ActivityStreamsClosedPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 18 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 19 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 20 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 21 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 22 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 23 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 24 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 25 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 26 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 27 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 28 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 29 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 30 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 31 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 32 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 33 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 34 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 35 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 36 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 37 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 38 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 39 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 40 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 41 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 42 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 43 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 44 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 45 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 46 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 47 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 48 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 49 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 50 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 51 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 52 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 53 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 54 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 55 } + if this.IsActivityStreamsVideo() { + return 56 + } + if this.IsActivityStreamsView() { + return 57 + } if this.IsIRI() { return -2 } @@ -1839,6 +1897,8 @@ func (this ActivityStreamsClosedPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1847,6 +1907,8 @@ func (this ActivityStreamsClosedPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2330,6 +2392,20 @@ func (this *ActivityStreamsClosedPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsClosedPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsClosedPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsClosedPropertyIterator) SetType(t vocab.Type) error { @@ -2401,6 +2477,10 @@ func (this *ActivityStreamsClosedPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2417,6 +2497,10 @@ func (this *ActivityStreamsClosedPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2591,10 +2675,12 @@ func (this *ActivityStreamsClosedPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2675,6 +2761,8 @@ func (this ActivityStreamsClosedPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2683,6 +2771,8 @@ func (this ActivityStreamsClosedPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3425,6 +3515,28 @@ func (this *ActivityStreamsClosedProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "closed". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsClosedProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsClosedPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "closed". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsClosedProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsClosedPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "closed". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4429,6 +4541,40 @@ func (this *ActivityStreamsClosedProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "closed". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsClosedProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsClosedPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "closed". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsClosedProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsClosedPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "closed". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4603,150 +4749,158 @@ func (this ActivityStreamsClosedProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 19 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 24 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 54 { + } else if idx1 == 56 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 55 { + } else if idx1 == 57 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5561,6 +5715,34 @@ func (this *ActivityStreamsClosedProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "closed". Invalidates all iterators. +func (this *ActivityStreamsClosedProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsClosedPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "closed". Invalidates all iterators. +func (this *ActivityStreamsClosedProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsClosedPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "closed". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6357,6 +6539,31 @@ func (this *ActivityStreamsClosedProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "closed". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsClosedProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsClosedPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "closed". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsClosedProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsClosedPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "closed". 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. diff --git a/streams/impl/activitystreams/property_context/gen_pkg.go b/streams/impl/activitystreams/property_context/gen_pkg.go index 979cbc5..f4de7a4 100644 --- a/streams/impl/activitystreams/property_context/gen_pkg.go +++ b/streams/impl/activitystreams/property_context/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_context/gen_property_activitystreams_context.go b/streams/impl/activitystreams/property_context/gen_property_activitystreams_context.go index f51f12d..6678dda 100644 --- a/streams/impl/activitystreams/property_context/gen_property_activitystreams_context.go +++ b/streams/impl/activitystreams/property_context/gen_property_activitystreams_context.go @@ -31,10 +31,12 @@ type ActivityStreamsContextPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsContextPropertyIterator(i interface{}, aliasMap m alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsContextPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsContextPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsContextPropertyIterator(i interface{}, aliasMap m alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsContextPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsContextPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsContextPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsContextPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsContextPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsContextPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsContextPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsContextPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsContextPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsContextPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsContextPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsContextPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsContextPropertyIterator) JSONLDContext() map[string]st child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsContextPropertyIterator) JSONLDContext() map[string]st child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsContextPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsContextPropertyIterator) LessThan(o vocab.ActivityStre return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsContextPropertyIterator) LessThan(o vocab.ActivityStre return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsContextPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsContextPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsContextPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsContextPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsContextPropertyIterator) SetType(t vocab.Type) error this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsContextPropertyIterator) SetType(t vocab.Type) error this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsContextPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsContextPropertyIterator) serialize() (interface{}, err return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsContextPropertyIterator) serialize() (interface{}, err return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3351,6 +3441,29 @@ func (this *ActivityStreamsContextProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "context". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsContextProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsContextPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "context". Invalidates iterators that are traversing using +// Prev. +func (this *ActivityStreamsContextProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsContextPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "context". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4331,6 +4444,40 @@ func (this *ActivityStreamsContextProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "context". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsContextProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsContextPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "context". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsContextProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsContextPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "context". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4461,150 +4608,158 @@ func (this ActivityStreamsContextProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5419,6 +5574,34 @@ func (this *ActivityStreamsContextProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "context". Invalidates all iterators. +func (this *ActivityStreamsContextProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsContextPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "context". Invalidates all iterators. +func (this *ActivityStreamsContextProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsContextPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "context". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6185,6 +6368,31 @@ func (this *ActivityStreamsContextProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "context". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsContextProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsContextPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "context". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsContextProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsContextPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "context". 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. diff --git a/streams/impl/activitystreams/property_describes/gen_pkg.go b/streams/impl/activitystreams/property_describes/gen_pkg.go index 9950ad9..0252335 100644 --- a/streams/impl/activitystreams/property_describes/gen_pkg.go +++ b/streams/impl/activitystreams/property_describes/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_describes/gen_property_activitystreams_describes.go b/streams/impl/activitystreams/property_describes/gen_property_activitystreams_describes.go index ccdbe6d..08be558 100644 --- a/streams/impl/activitystreams/property_describes/gen_property_activitystreams_describes.go +++ b/streams/impl/activitystreams/property_describes/gen_property_activitystreams_describes.go @@ -30,10 +30,12 @@ type ActivityStreamsDescribesProperty struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -195,6 +197,12 @@ func DeserializeDescribesProperty(m map[string]interface{}, aliasMap map[string] alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsDescribesProperty{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsDescribesProperty{ activitystreamsEventMember: v, @@ -219,6 +227,12 @@ func DeserializeDescribesProperty(m map[string]interface{}, aliasMap map[string] alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsDescribesProperty{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsDescribesProperty{ activitystreamsIgnoreMember: v, @@ -446,10 +460,12 @@ func (this *ActivityStreamsDescribesProperty) Clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -856,6 +872,19 @@ func (this ActivityStreamsDescribesProperty) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsDescribesProperty) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsDescribesProperty) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsDescribesProperty) GetType() vocab.Type { @@ -907,6 +936,9 @@ func (this ActivityStreamsDescribesProperty) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -919,6 +951,9 @@ func (this ActivityStreamsDescribesProperty) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1037,10 +1072,12 @@ func (this ActivityStreamsDescribesProperty) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1451,6 +1488,19 @@ func (this ActivityStreamsDescribesProperty) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsDescribesProperty) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsDescribesProperty) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1489,6 +1539,8 @@ func (this ActivityStreamsDescribesProperty) JSONLDContext() map[string]string { child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1497,6 +1549,8 @@ func (this ActivityStreamsDescribesProperty) JSONLDContext() map[string]string { child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1625,114 +1679,120 @@ func (this ActivityStreamsDescribesProperty) KindIndex() int { if this.IsActivityStreamsDocument() { return 15 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 16 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 17 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 18 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 19 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 20 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 21 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 22 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 23 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 24 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 25 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 26 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 27 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsLike() { return 28 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsListen() { return 29 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 30 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 31 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 32 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 33 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 34 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 35 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 36 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 37 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 38 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 39 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 40 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 41 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 42 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 43 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 44 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 45 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 46 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 47 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 48 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 49 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 50 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 51 } + if this.IsActivityStreamsVideo() { + return 52 + } + if this.IsActivityStreamsView() { + return 53 + } if this.IsIRI() { return -2 } @@ -1782,6 +1842,8 @@ func (this ActivityStreamsDescribesProperty) LessThan(o vocab.ActivityStreamsDes return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1790,6 +1852,8 @@ func (this ActivityStreamsDescribesProperty) LessThan(o vocab.ActivityStreamsDes return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -1906,6 +1970,8 @@ func (this ActivityStreamsDescribesProperty) Serialize() (interface{}, error) { return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -1914,6 +1980,8 @@ func (this ActivityStreamsDescribesProperty) Serialize() (interface{}, error) { return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -2354,6 +2422,20 @@ func (this *ActivityStreamsDescribesProperty) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsDescribesProperty) SetTootEmoji(v vocab.TootEmoji) { + this.Clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsDescribesProperty) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.Clear() + this.tootIdentityProofMember = 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 *ActivityStreamsDescribesProperty) SetType(t vocab.Type) error { @@ -2421,6 +2503,10 @@ func (this *ActivityStreamsDescribesProperty) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2437,6 +2523,10 @@ func (this *ActivityStreamsDescribesProperty) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil diff --git a/streams/impl/activitystreams/property_formertype/gen_pkg.go b/streams/impl/activitystreams/property_formertype/gen_pkg.go index 6fb72c0..0efc137 100644 --- a/streams/impl/activitystreams/property_formertype/gen_pkg.go +++ b/streams/impl/activitystreams/property_formertype/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_formertype/gen_property_activitystreams_formerType.go b/streams/impl/activitystreams/property_formertype/gen_property_activitystreams_formerType.go index 6be99d1..6b19146 100644 --- a/streams/impl/activitystreams/property_formertype/gen_property_activitystreams_formerType.go +++ b/streams/impl/activitystreams/property_formertype/gen_property_activitystreams_formerType.go @@ -33,10 +33,12 @@ type ActivityStreamsFormerTypePropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -198,6 +200,12 @@ func deserializeActivityStreamsFormerTypePropertyIterator(i interface{}, aliasMa alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsFormerTypePropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsFormerTypePropertyIterator{ activitystreamsEventMember: v, @@ -222,6 +230,12 @@ func deserializeActivityStreamsFormerTypePropertyIterator(i interface{}, aliasMa alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsFormerTypePropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsFormerTypePropertyIterator{ activitystreamsIgnoreMember: v, @@ -801,6 +815,19 @@ func (this ActivityStreamsFormerTypePropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsFormerTypePropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsFormerTypePropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsFormerTypePropertyIterator) GetType() vocab.Type { @@ -852,6 +879,9 @@ func (this ActivityStreamsFormerTypePropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -864,6 +894,9 @@ func (this ActivityStreamsFormerTypePropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -989,10 +1022,12 @@ func (this ActivityStreamsFormerTypePropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1403,6 +1438,19 @@ func (this ActivityStreamsFormerTypePropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsFormerTypePropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsFormerTypePropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != nil +} + // IsXMLSchemaString returns true if this property has a type of "string". When // true, use the GetXMLSchemaString and SetXMLSchemaString methods to access // and set this property. @@ -1448,6 +1496,8 @@ func (this ActivityStreamsFormerTypePropertyIterator) JSONLDContext() map[string child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1456,6 +1506,8 @@ func (this ActivityStreamsFormerTypePropertyIterator) JSONLDContext() map[string child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1587,114 +1639,120 @@ func (this ActivityStreamsFormerTypePropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 31 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 32 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 33 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 34 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 35 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 36 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 37 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 38 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 39 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 40 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 41 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 42 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 43 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 44 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 45 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 46 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 47 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 48 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 49 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 50 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 51 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 52 } + if this.IsActivityStreamsVideo() { + return 53 + } + if this.IsActivityStreamsView() { + return 54 + } if this.IsIRI() { return -2 } @@ -1746,6 +1804,8 @@ func (this ActivityStreamsFormerTypePropertyIterator) LessThan(o vocab.ActivityS return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1754,6 +1814,8 @@ func (this ActivityStreamsFormerTypePropertyIterator) LessThan(o vocab.ActivityS return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2221,6 +2283,20 @@ func (this *ActivityStreamsFormerTypePropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsFormerTypePropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsFormerTypePropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsFormerTypePropertyIterator) SetType(t vocab.Type) error { @@ -2288,6 +2364,10 @@ func (this *ActivityStreamsFormerTypePropertyIterator) SetType(t vocab.Type) err this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2304,6 +2384,10 @@ func (this *ActivityStreamsFormerTypePropertyIterator) SetType(t vocab.Type) err this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2464,10 +2548,12 @@ func (this *ActivityStreamsFormerTypePropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2543,6 +2629,8 @@ func (this ActivityStreamsFormerTypePropertyIterator) serialize() (interface{}, return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2551,6 +2639,8 @@ func (this ActivityStreamsFormerTypePropertyIterator) serialize() (interface{}, return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3278,6 +3368,29 @@ func (this *ActivityStreamsFormerTypeProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "formerType". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsFormerTypeProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsFormerTypePropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "formerType". Invalidates iterators that are traversing using +// Prev. +func (this *ActivityStreamsFormerTypeProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsFormerTypePropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "formerType". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for this @@ -4237,6 +4350,40 @@ func (this *ActivityStreamsFormerTypeProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "formerType". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsFormerTypeProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsFormerTypePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "formerType". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsFormerTypeProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsFormerTypePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "formerType". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4385,146 +4532,154 @@ func (this ActivityStreamsFormerTypeProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5311,6 +5466,34 @@ func (this *ActivityStreamsFormerTypeProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "formerType". Invalidates all iterators. +func (this *ActivityStreamsFormerTypeProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsFormerTypePropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "formerType". Invalidates all iterators. +func (this *ActivityStreamsFormerTypeProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsFormerTypePropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "formerType". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6066,6 +6249,32 @@ func (this *ActivityStreamsFormerTypeProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "formerType". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *ActivityStreamsFormerTypeProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsFormerTypePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "formerType". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsFormerTypeProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsFormerTypePropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "formerType". 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 diff --git a/streams/impl/activitystreams/property_generator/gen_pkg.go b/streams/impl/activitystreams/property_generator/gen_pkg.go index 1e3198f..4d28586 100644 --- a/streams/impl/activitystreams/property_generator/gen_pkg.go +++ b/streams/impl/activitystreams/property_generator/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_generator/gen_property_activitystreams_generator.go b/streams/impl/activitystreams/property_generator/gen_property_activitystreams_generator.go index e4ee4cc..af2083d 100644 --- a/streams/impl/activitystreams/property_generator/gen_property_activitystreams_generator.go +++ b/streams/impl/activitystreams/property_generator/gen_property_activitystreams_generator.go @@ -31,10 +31,12 @@ type ActivityStreamsGeneratorPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsGeneratorPropertyIterator(i interface{}, aliasMap alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsGeneratorPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsGeneratorPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsGeneratorPropertyIterator(i interface{}, aliasMap alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsGeneratorPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsGeneratorPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsGeneratorPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsGeneratorPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsGeneratorPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsGeneratorPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsGeneratorPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsGeneratorPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsGeneratorPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsGeneratorPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsGeneratorPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsGeneratorPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsGeneratorPropertyIterator) JSONLDContext() map[string] child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsGeneratorPropertyIterator) JSONLDContext() map[string] child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsGeneratorPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsGeneratorPropertyIterator) LessThan(o vocab.ActivitySt return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsGeneratorPropertyIterator) LessThan(o vocab.ActivitySt return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsGeneratorPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsGeneratorPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsGeneratorPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsGeneratorPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsGeneratorPropertyIterator) SetType(t vocab.Type) erro this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsGeneratorPropertyIterator) SetType(t vocab.Type) erro this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsGeneratorPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsGeneratorPropertyIterator) serialize() (interface{}, e return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsGeneratorPropertyIterator) serialize() (interface{}, e return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3351,6 +3441,29 @@ func (this *ActivityStreamsGeneratorProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "generator". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsGeneratorProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsGeneratorPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "generator". Invalidates iterators that are traversing using +// Prev. +func (this *ActivityStreamsGeneratorProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsGeneratorPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "generator". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4331,6 +4444,40 @@ func (this *ActivityStreamsGeneratorProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "generator". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsGeneratorProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsGeneratorPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "generator". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsGeneratorProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsGeneratorPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "generator". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4461,150 +4608,158 @@ func (this ActivityStreamsGeneratorProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5419,6 +5574,34 @@ func (this *ActivityStreamsGeneratorProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "generator". Invalidates all iterators. +func (this *ActivityStreamsGeneratorProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsGeneratorPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "generator". Invalidates all iterators. +func (this *ActivityStreamsGeneratorProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsGeneratorPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "generator". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6185,6 +6368,32 @@ func (this *ActivityStreamsGeneratorProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "generator". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *ActivityStreamsGeneratorProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsGeneratorPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "generator". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsGeneratorProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsGeneratorPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "generator". 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. diff --git a/streams/impl/activitystreams/property_inreplyto/gen_pkg.go b/streams/impl/activitystreams/property_inreplyto/gen_pkg.go index b70ec9e..432a96c 100644 --- a/streams/impl/activitystreams/property_inreplyto/gen_pkg.go +++ b/streams/impl/activitystreams/property_inreplyto/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_inreplyto/gen_property_activitystreams_inReplyTo.go b/streams/impl/activitystreams/property_inreplyto/gen_property_activitystreams_inReplyTo.go index cfebb4a..a63052b 100644 --- a/streams/impl/activitystreams/property_inreplyto/gen_property_activitystreams_inReplyTo.go +++ b/streams/impl/activitystreams/property_inreplyto/gen_property_activitystreams_inReplyTo.go @@ -31,10 +31,12 @@ type ActivityStreamsInReplyToPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsInReplyToPropertyIterator(i interface{}, aliasMap alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsInReplyToPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsInReplyToPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsInReplyToPropertyIterator(i interface{}, aliasMap alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsInReplyToPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsInReplyToPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsInReplyToPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsInReplyToPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsInReplyToPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsInReplyToPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsInReplyToPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsInReplyToPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsInReplyToPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsInReplyToPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsInReplyToPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsInReplyToPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsInReplyToPropertyIterator) JSONLDContext() map[string] child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsInReplyToPropertyIterator) JSONLDContext() map[string] child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsInReplyToPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsInReplyToPropertyIterator) LessThan(o vocab.ActivitySt return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsInReplyToPropertyIterator) LessThan(o vocab.ActivitySt return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsInReplyToPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsInReplyToPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsInReplyToPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsInReplyToPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsInReplyToPropertyIterator) SetType(t vocab.Type) erro this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsInReplyToPropertyIterator) SetType(t vocab.Type) erro this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsInReplyToPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsInReplyToPropertyIterator) serialize() (interface{}, e return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsInReplyToPropertyIterator) serialize() (interface{}, e return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3351,6 +3441,29 @@ func (this *ActivityStreamsInReplyToProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "inReplyTo". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsInReplyToProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsInReplyToPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "inReplyTo". Invalidates iterators that are traversing using +// Prev. +func (this *ActivityStreamsInReplyToProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsInReplyToPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "inReplyTo". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4331,6 +4444,40 @@ func (this *ActivityStreamsInReplyToProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "inReplyTo". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsInReplyToProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsInReplyToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "inReplyTo". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsInReplyToProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsInReplyToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "inReplyTo". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4461,150 +4608,158 @@ func (this ActivityStreamsInReplyToProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5419,6 +5574,34 @@ func (this *ActivityStreamsInReplyToProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "inReplyTo". Invalidates all iterators. +func (this *ActivityStreamsInReplyToProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsInReplyToPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "inReplyTo". Invalidates all iterators. +func (this *ActivityStreamsInReplyToProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsInReplyToPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "inReplyTo". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6185,6 +6368,32 @@ func (this *ActivityStreamsInReplyToProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "inReplyTo". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *ActivityStreamsInReplyToProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsInReplyToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "inReplyTo". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsInReplyToProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsInReplyToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "inReplyTo". 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. diff --git a/streams/impl/activitystreams/property_instrument/gen_pkg.go b/streams/impl/activitystreams/property_instrument/gen_pkg.go index fa49008..53ee3e2 100644 --- a/streams/impl/activitystreams/property_instrument/gen_pkg.go +++ b/streams/impl/activitystreams/property_instrument/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_instrument/gen_property_activitystreams_instrument.go b/streams/impl/activitystreams/property_instrument/gen_property_activitystreams_instrument.go index e9da7f4..094a307 100644 --- a/streams/impl/activitystreams/property_instrument/gen_property_activitystreams_instrument.go +++ b/streams/impl/activitystreams/property_instrument/gen_property_activitystreams_instrument.go @@ -31,10 +31,12 @@ type ActivityStreamsInstrumentPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsInstrumentPropertyIterator(i interface{}, aliasMa alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsInstrumentPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsInstrumentPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsInstrumentPropertyIterator(i interface{}, aliasMa alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsInstrumentPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsInstrumentPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsInstrumentPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsInstrumentPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsInstrumentPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsInstrumentPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsInstrumentPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsInstrumentPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsInstrumentPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsInstrumentPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsInstrumentPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsInstrumentPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsInstrumentPropertyIterator) JSONLDContext() map[string child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsInstrumentPropertyIterator) JSONLDContext() map[string child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsInstrumentPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsInstrumentPropertyIterator) LessThan(o vocab.ActivityS return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsInstrumentPropertyIterator) LessThan(o vocab.ActivityS return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsInstrumentPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsInstrumentPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsInstrumentPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsInstrumentPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsInstrumentPropertyIterator) SetType(t vocab.Type) err this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsInstrumentPropertyIterator) SetType(t vocab.Type) err this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsInstrumentPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsInstrumentPropertyIterator) serialize() (interface{}, return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsInstrumentPropertyIterator) serialize() (interface{}, return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3352,6 +3442,29 @@ func (this *ActivityStreamsInstrumentProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "instrument". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsInstrumentProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsInstrumentPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "instrument". Invalidates iterators that are traversing using +// Prev. +func (this *ActivityStreamsInstrumentProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsInstrumentPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "instrument". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for this @@ -4333,6 +4446,40 @@ func (this *ActivityStreamsInstrumentProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "instrument". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsInstrumentProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsInstrumentPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "instrument". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsInstrumentProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsInstrumentPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "instrument". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4463,150 +4610,158 @@ func (this ActivityStreamsInstrumentProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5421,6 +5576,34 @@ func (this *ActivityStreamsInstrumentProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "instrument". Invalidates all iterators. +func (this *ActivityStreamsInstrumentProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsInstrumentPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "instrument". Invalidates all iterators. +func (this *ActivityStreamsInstrumentProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsInstrumentPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "instrument". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6187,6 +6370,32 @@ func (this *ActivityStreamsInstrumentProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "instrument". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *ActivityStreamsInstrumentProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsInstrumentPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "instrument". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsInstrumentProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsInstrumentPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "instrument". 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 diff --git a/streams/impl/activitystreams/property_items/gen_pkg.go b/streams/impl/activitystreams/property_items/gen_pkg.go index be262c8..edec953 100644 --- a/streams/impl/activitystreams/property_items/gen_pkg.go +++ b/streams/impl/activitystreams/property_items/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_items/gen_property_activitystreams_items.go b/streams/impl/activitystreams/property_items/gen_property_activitystreams_items.go index 08f90c6..b85aabe 100644 --- a/streams/impl/activitystreams/property_items/gen_property_activitystreams_items.go +++ b/streams/impl/activitystreams/property_items/gen_property_activitystreams_items.go @@ -31,10 +31,12 @@ type ActivityStreamsItemsPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsItemsPropertyIterator(i interface{}, aliasMap map alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsItemsPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsItemsPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsItemsPropertyIterator(i interface{}, aliasMap map alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsItemsPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsItemsPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsItemsPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsItemsPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsItemsPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsItemsPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsItemsPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsItemsPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsItemsPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsItemsPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsItemsPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsItemsPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsItemsPropertyIterator) JSONLDContext() map[string]stri child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsItemsPropertyIterator) JSONLDContext() map[string]stri child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsItemsPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsItemsPropertyIterator) LessThan(o vocab.ActivityStream return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsItemsPropertyIterator) LessThan(o vocab.ActivityStream return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsItemsPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsItemsPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsItemsPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsItemsPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsItemsPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsItemsPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsItemsPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsItemsPropertyIterator) serialize() (interface{}, error return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsItemsPropertyIterator) serialize() (interface{}, error return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3342,6 +3432,28 @@ func (this *ActivityStreamsItemsProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "items". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsItemsProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsItemsPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "items". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsItemsProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsItemsPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "items". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4322,6 +4434,40 @@ func (this *ActivityStreamsItemsProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "items". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsItemsProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsItemsPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "items". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsItemsProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsItemsPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "items". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4452,150 +4598,158 @@ func (this ActivityStreamsItemsProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5409,6 +5563,34 @@ func (this *ActivityStreamsItemsProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "items". Invalidates all iterators. +func (this *ActivityStreamsItemsProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsItemsPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "items". Invalidates all iterators. +func (this *ActivityStreamsItemsProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsItemsPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "items". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6175,6 +6357,31 @@ func (this *ActivityStreamsItemsProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "items". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsItemsProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsItemsPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "items". Panics if the index is out of bounds. Invalidates +// all iterators. +func (this *ActivityStreamsItemsProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsItemsPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "items". 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. diff --git a/streams/impl/activitystreams/property_location/gen_pkg.go b/streams/impl/activitystreams/property_location/gen_pkg.go index b0192d3..34927e9 100644 --- a/streams/impl/activitystreams/property_location/gen_pkg.go +++ b/streams/impl/activitystreams/property_location/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_location/gen_property_activitystreams_location.go b/streams/impl/activitystreams/property_location/gen_property_activitystreams_location.go index 631cf71..4895cef 100644 --- a/streams/impl/activitystreams/property_location/gen_property_activitystreams_location.go +++ b/streams/impl/activitystreams/property_location/gen_property_activitystreams_location.go @@ -31,10 +31,12 @@ type ActivityStreamsLocationPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsLocationPropertyIterator(i interface{}, aliasMap alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsLocationPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsLocationPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsLocationPropertyIterator(i interface{}, aliasMap alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsLocationPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsLocationPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsLocationPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsLocationPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsLocationPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsLocationPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsLocationPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsLocationPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsLocationPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsLocationPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsLocationPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsLocationPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsLocationPropertyIterator) JSONLDContext() map[string]s child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsLocationPropertyIterator) JSONLDContext() map[string]s child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsLocationPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsLocationPropertyIterator) LessThan(o vocab.ActivityStr return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsLocationPropertyIterator) LessThan(o vocab.ActivityStr return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsLocationPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsLocationPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsLocationPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsLocationPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsLocationPropertyIterator) SetType(t vocab.Type) error this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsLocationPropertyIterator) SetType(t vocab.Type) error this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsLocationPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsLocationPropertyIterator) serialize() (interface{}, er return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsLocationPropertyIterator) serialize() (interface{}, er return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3351,6 +3441,29 @@ func (this *ActivityStreamsLocationProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "location". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsLocationProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsLocationPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "location". Invalidates iterators that are traversing using +// Prev. +func (this *ActivityStreamsLocationProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsLocationPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "location". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4331,6 +4444,40 @@ func (this *ActivityStreamsLocationProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "location". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsLocationProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsLocationPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "location". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsLocationProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsLocationPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "location". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4461,150 +4608,158 @@ func (this ActivityStreamsLocationProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5419,6 +5574,34 @@ func (this *ActivityStreamsLocationProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "location". Invalidates all iterators. +func (this *ActivityStreamsLocationProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsLocationPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "location". Invalidates all iterators. +func (this *ActivityStreamsLocationProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsLocationPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "location". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6185,6 +6368,31 @@ func (this *ActivityStreamsLocationProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "location". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsLocationProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsLocationPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "location". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsLocationProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsLocationPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "location". 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. diff --git a/streams/impl/activitystreams/property_object/gen_pkg.go b/streams/impl/activitystreams/property_object/gen_pkg.go index 9226603..3228815 100644 --- a/streams/impl/activitystreams/property_object/gen_pkg.go +++ b/streams/impl/activitystreams/property_object/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_object/gen_property_activitystreams_object.go b/streams/impl/activitystreams/property_object/gen_property_activitystreams_object.go index 1265e03..74a1c37 100644 --- a/streams/impl/activitystreams/property_object/gen_property_activitystreams_object.go +++ b/streams/impl/activitystreams/property_object/gen_property_activitystreams_object.go @@ -31,10 +31,12 @@ type ActivityStreamsObjectPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsObjectPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsObjectPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsObjectPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsObjectPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsObjectPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsObjectPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsObjectPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsObjectPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsObjectPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsObjectPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsObjectPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsObjectPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsObjectPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsObjectPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsObjectPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsObjectPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsObjectPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsObjectPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsObjectPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsObjectPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsObjectPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsObjectPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsObjectPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsObjectPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsObjectPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsObjectPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsObjectPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsObjectPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsObjectPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsObjectPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3342,6 +3432,28 @@ func (this *ActivityStreamsObjectProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "object". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsObjectProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsObjectPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "object". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsObjectProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsObjectPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "object". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4322,6 +4434,40 @@ func (this *ActivityStreamsObjectProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "object". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsObjectProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsObjectPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "object". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsObjectProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsObjectPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "object". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4452,150 +4598,158 @@ func (this ActivityStreamsObjectProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5410,6 +5564,34 @@ func (this *ActivityStreamsObjectProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "object". Invalidates all iterators. +func (this *ActivityStreamsObjectProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsObjectPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "object". Invalidates all iterators. +func (this *ActivityStreamsObjectProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsObjectPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "object". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6176,6 +6358,31 @@ func (this *ActivityStreamsObjectProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "object". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsObjectProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsObjectPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "object". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsObjectProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsObjectPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "object". 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. diff --git a/streams/impl/activitystreams/property_oneof/gen_pkg.go b/streams/impl/activitystreams/property_oneof/gen_pkg.go index 6941f7c..768b9c6 100644 --- a/streams/impl/activitystreams/property_oneof/gen_pkg.go +++ b/streams/impl/activitystreams/property_oneof/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_oneof/gen_property_activitystreams_oneOf.go b/streams/impl/activitystreams/property_oneof/gen_property_activitystreams_oneOf.go index e6498d2..c09b395 100644 --- a/streams/impl/activitystreams/property_oneof/gen_property_activitystreams_oneOf.go +++ b/streams/impl/activitystreams/property_oneof/gen_property_activitystreams_oneOf.go @@ -31,10 +31,12 @@ type ActivityStreamsOneOfPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsOneOfPropertyIterator(i interface{}, aliasMap map alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsOneOfPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsOneOfPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsOneOfPropertyIterator(i interface{}, aliasMap map alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsOneOfPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsOneOfPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsOneOfPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsOneOfPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsOneOfPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsOneOfPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsOneOfPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsOneOfPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsOneOfPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsOneOfPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsOneOfPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsOneOfPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsOneOfPropertyIterator) JSONLDContext() map[string]stri child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsOneOfPropertyIterator) JSONLDContext() map[string]stri child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsOneOfPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsOneOfPropertyIterator) LessThan(o vocab.ActivityStream return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsOneOfPropertyIterator) LessThan(o vocab.ActivityStream return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsOneOfPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsOneOfPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsOneOfPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsOneOfPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsOneOfPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsOneOfPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsOneOfPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsOneOfPropertyIterator) serialize() (interface{}, error return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsOneOfPropertyIterator) serialize() (interface{}, error return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3342,6 +3432,28 @@ func (this *ActivityStreamsOneOfProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "oneOf". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsOneOfProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsOneOfPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "oneOf". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsOneOfProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsOneOfPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "oneOf". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4322,6 +4434,40 @@ func (this *ActivityStreamsOneOfProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "oneOf". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsOneOfProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsOneOfPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "oneOf". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsOneOfProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsOneOfPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "oneOf". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4452,150 +4598,158 @@ func (this ActivityStreamsOneOfProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5409,6 +5563,34 @@ func (this *ActivityStreamsOneOfProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "oneOf". Invalidates all iterators. +func (this *ActivityStreamsOneOfProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsOneOfPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "oneOf". Invalidates all iterators. +func (this *ActivityStreamsOneOfProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsOneOfPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "oneOf". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6175,6 +6357,31 @@ func (this *ActivityStreamsOneOfProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "oneOf". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsOneOfProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsOneOfPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "oneOf". Panics if the index is out of bounds. Invalidates +// all iterators. +func (this *ActivityStreamsOneOfProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsOneOfPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "oneOf". 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. diff --git a/streams/impl/activitystreams/property_ordereditems/gen_pkg.go b/streams/impl/activitystreams/property_ordereditems/gen_pkg.go index 4f2b18d..fb3a36f 100644 --- a/streams/impl/activitystreams/property_ordereditems/gen_pkg.go +++ b/streams/impl/activitystreams/property_ordereditems/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_ordereditems/gen_property_activitystreams_orderedItems.go b/streams/impl/activitystreams/property_ordereditems/gen_property_activitystreams_orderedItems.go index 65691cf..47ed642 100644 --- a/streams/impl/activitystreams/property_ordereditems/gen_property_activitystreams_orderedItems.go +++ b/streams/impl/activitystreams/property_ordereditems/gen_property_activitystreams_orderedItems.go @@ -31,10 +31,12 @@ type ActivityStreamsOrderedItemsPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsOrderedItemsPropertyIterator(i interface{}, alias alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsOrderedItemsPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsOrderedItemsPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsOrderedItemsPropertyIterator(i interface{}, alias alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsOrderedItemsPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsOrderedItemsPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsOrderedItemsPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsOrderedItemsPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsOrderedItemsPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsOrderedItemsPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsOrderedItemsPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) JSONLDContext() map[stri child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) JSONLDContext() map[stri child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) LessThan(o vocab.Activit return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) LessThan(o vocab.Activit return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsOrderedItemsPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsOrderedItemsPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsOrderedItemsPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsOrderedItemsPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsOrderedItemsPropertyIterator) SetType(t vocab.Type) e this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsOrderedItemsPropertyIterator) SetType(t vocab.Type) e this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsOrderedItemsPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) serialize() (interface{} return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsOrderedItemsPropertyIterator) serialize() (interface{} return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3388,6 +3478,29 @@ func (this *ActivityStreamsOrderedItemsProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "orderedItems". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsOrderedItemsProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsOrderedItemsPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "orderedItems". Invalidates iterators that are traversing +// using Prev. +func (this *ActivityStreamsOrderedItemsProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsOrderedItemsPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "orderedItems". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for this @@ -4370,6 +4483,40 @@ func (this *ActivityStreamsOrderedItemsProperty) InsertIRI(idx int, v *url.URL) } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "orderedItems". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsOrderedItemsProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsOrderedItemsPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "orderedItems". Existing elements at that index and higher +// are shifted back once. Invalidates all iterators. +func (this *ActivityStreamsOrderedItemsProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsOrderedItemsPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "orderedItems". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4500,150 +4647,158 @@ func (this ActivityStreamsOrderedItemsProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5459,6 +5614,34 @@ func (this *ActivityStreamsOrderedItemsProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "orderedItems". Invalidates all iterators. +func (this *ActivityStreamsOrderedItemsProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsOrderedItemsPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "orderedItems". Invalidates all iterators. +func (this *ActivityStreamsOrderedItemsProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsOrderedItemsPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "orderedItems". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6225,6 +6408,32 @@ func (this *ActivityStreamsOrderedItemsProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "orderedItems". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *ActivityStreamsOrderedItemsProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsOrderedItemsPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "orderedItems". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsOrderedItemsProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsOrderedItemsPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "orderedItems". 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 diff --git a/streams/impl/activitystreams/property_origin/gen_pkg.go b/streams/impl/activitystreams/property_origin/gen_pkg.go index a5fe6ab..2e317bb 100644 --- a/streams/impl/activitystreams/property_origin/gen_pkg.go +++ b/streams/impl/activitystreams/property_origin/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_origin/gen_property_activitystreams_origin.go b/streams/impl/activitystreams/property_origin/gen_property_activitystreams_origin.go index e449a3b..3796c1e 100644 --- a/streams/impl/activitystreams/property_origin/gen_property_activitystreams_origin.go +++ b/streams/impl/activitystreams/property_origin/gen_property_activitystreams_origin.go @@ -31,10 +31,12 @@ type ActivityStreamsOriginPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsOriginPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsOriginPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsOriginPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsOriginPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsOriginPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsOriginPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsOriginPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsOriginPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsOriginPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsOriginPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsOriginPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsOriginPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsOriginPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsOriginPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsOriginPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsOriginPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsOriginPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsOriginPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsOriginPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsOriginPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsOriginPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsOriginPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsOriginPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsOriginPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsOriginPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsOriginPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsOriginPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsOriginPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsOriginPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsOriginPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3342,6 +3432,28 @@ func (this *ActivityStreamsOriginProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "origin". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsOriginProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsOriginPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "origin". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsOriginProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsOriginPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "origin". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4322,6 +4434,40 @@ func (this *ActivityStreamsOriginProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "origin". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsOriginProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsOriginPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "origin". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsOriginProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsOriginPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "origin". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4452,150 +4598,158 @@ func (this ActivityStreamsOriginProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5410,6 +5564,34 @@ func (this *ActivityStreamsOriginProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "origin". Invalidates all iterators. +func (this *ActivityStreamsOriginProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsOriginPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "origin". Invalidates all iterators. +func (this *ActivityStreamsOriginProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsOriginPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "origin". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6176,6 +6358,31 @@ func (this *ActivityStreamsOriginProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "origin". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsOriginProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsOriginPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "origin". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsOriginProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsOriginPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "origin". 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. diff --git a/streams/impl/activitystreams/property_preview/gen_pkg.go b/streams/impl/activitystreams/property_preview/gen_pkg.go index b50ec69..45cfc66 100644 --- a/streams/impl/activitystreams/property_preview/gen_pkg.go +++ b/streams/impl/activitystreams/property_preview/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_preview/gen_property_activitystreams_preview.go b/streams/impl/activitystreams/property_preview/gen_property_activitystreams_preview.go index ef972a5..ea040d0 100644 --- a/streams/impl/activitystreams/property_preview/gen_property_activitystreams_preview.go +++ b/streams/impl/activitystreams/property_preview/gen_property_activitystreams_preview.go @@ -31,10 +31,12 @@ type ActivityStreamsPreviewPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsPreviewPropertyIterator(i interface{}, aliasMap m alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsPreviewPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsPreviewPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsPreviewPropertyIterator(i interface{}, aliasMap m alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsPreviewPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsPreviewPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsPreviewPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsPreviewPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsPreviewPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsPreviewPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsPreviewPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsPreviewPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsPreviewPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsPreviewPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsPreviewPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsPreviewPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsPreviewPropertyIterator) JSONLDContext() map[string]st child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsPreviewPropertyIterator) JSONLDContext() map[string]st child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsPreviewPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsPreviewPropertyIterator) LessThan(o vocab.ActivityStre return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsPreviewPropertyIterator) LessThan(o vocab.ActivityStre return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsPreviewPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsPreviewPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsPreviewPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsPreviewPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsPreviewPropertyIterator) SetType(t vocab.Type) error this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsPreviewPropertyIterator) SetType(t vocab.Type) error this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsPreviewPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsPreviewPropertyIterator) serialize() (interface{}, err return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsPreviewPropertyIterator) serialize() (interface{}, err return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3351,6 +3441,29 @@ func (this *ActivityStreamsPreviewProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "preview". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsPreviewProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsPreviewPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "preview". Invalidates iterators that are traversing using +// Prev. +func (this *ActivityStreamsPreviewProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsPreviewPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "preview". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4331,6 +4444,40 @@ func (this *ActivityStreamsPreviewProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "preview". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsPreviewProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsPreviewPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "preview". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsPreviewProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsPreviewPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "preview". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4461,150 +4608,158 @@ func (this ActivityStreamsPreviewProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5419,6 +5574,34 @@ func (this *ActivityStreamsPreviewProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "preview". Invalidates all iterators. +func (this *ActivityStreamsPreviewProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsPreviewPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "preview". Invalidates all iterators. +func (this *ActivityStreamsPreviewProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsPreviewPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "preview". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6185,6 +6368,31 @@ func (this *ActivityStreamsPreviewProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "preview". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsPreviewProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsPreviewPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "preview". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsPreviewProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsPreviewPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "preview". 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. diff --git a/streams/impl/activitystreams/property_relationship/gen_pkg.go b/streams/impl/activitystreams/property_relationship/gen_pkg.go index f951d45..a96cd21 100644 --- a/streams/impl/activitystreams/property_relationship/gen_pkg.go +++ b/streams/impl/activitystreams/property_relationship/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_relationship/gen_property_activitystreams_relationship.go b/streams/impl/activitystreams/property_relationship/gen_property_activitystreams_relationship.go index c782b4e..d9735e8 100644 --- a/streams/impl/activitystreams/property_relationship/gen_property_activitystreams_relationship.go +++ b/streams/impl/activitystreams/property_relationship/gen_property_activitystreams_relationship.go @@ -30,10 +30,12 @@ type ActivityStreamsRelationshipPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -195,6 +197,12 @@ func deserializeActivityStreamsRelationshipPropertyIterator(i interface{}, alias alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsRelationshipPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsRelationshipPropertyIterator{ activitystreamsEventMember: v, @@ -219,6 +227,12 @@ func deserializeActivityStreamsRelationshipPropertyIterator(i interface{}, alias alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsRelationshipPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsRelationshipPropertyIterator{ activitystreamsIgnoreMember: v, @@ -790,6 +804,19 @@ func (this ActivityStreamsRelationshipPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsRelationshipPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsRelationshipPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsRelationshipPropertyIterator) GetType() vocab.Type { @@ -841,6 +868,9 @@ func (this ActivityStreamsRelationshipPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -853,6 +883,9 @@ func (this ActivityStreamsRelationshipPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -971,10 +1004,12 @@ func (this ActivityStreamsRelationshipPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1385,6 +1420,19 @@ func (this ActivityStreamsRelationshipPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsRelationshipPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsRelationshipPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1423,6 +1471,8 @@ func (this ActivityStreamsRelationshipPropertyIterator) JSONLDContext() map[stri child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1431,6 +1481,8 @@ func (this ActivityStreamsRelationshipPropertyIterator) JSONLDContext() map[stri child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1559,114 +1611,120 @@ func (this ActivityStreamsRelationshipPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 15 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 16 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 17 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 18 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 19 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 20 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 21 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 22 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 23 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 24 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 25 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 26 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 27 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsLike() { return 28 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsListen() { return 29 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 30 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 31 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 32 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 33 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 34 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 35 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 36 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 37 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 38 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 39 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 40 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 41 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 42 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 43 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 44 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 45 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 46 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 47 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 48 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 49 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 50 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 51 } + if this.IsActivityStreamsVideo() { + return 52 + } + if this.IsActivityStreamsView() { + return 53 + } if this.IsIRI() { return -2 } @@ -1716,6 +1774,8 @@ func (this ActivityStreamsRelationshipPropertyIterator) LessThan(o vocab.Activit return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1724,6 +1784,8 @@ func (this ActivityStreamsRelationshipPropertyIterator) LessThan(o vocab.Activit return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2191,6 +2253,20 @@ func (this *ActivityStreamsRelationshipPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsRelationshipPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsRelationshipPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsRelationshipPropertyIterator) SetType(t vocab.Type) error { @@ -2258,6 +2334,10 @@ func (this *ActivityStreamsRelationshipPropertyIterator) SetType(t vocab.Type) e this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2274,6 +2354,10 @@ func (this *ActivityStreamsRelationshipPropertyIterator) SetType(t vocab.Type) e this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2425,10 +2509,12 @@ func (this *ActivityStreamsRelationshipPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2502,6 +2588,8 @@ func (this ActivityStreamsRelationshipPropertyIterator) serialize() (interface{} return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2510,6 +2598,8 @@ func (this ActivityStreamsRelationshipPropertyIterator) serialize() (interface{} return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3272,6 +3362,29 @@ func (this *ActivityStreamsRelationshipProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "relationship". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsRelationshipProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsRelationshipPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "relationship". Invalidates iterators that are traversing +// using Prev. +func (this *ActivityStreamsRelationshipProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsRelationshipPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "relationship". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for this @@ -4220,6 +4333,40 @@ func (this *ActivityStreamsRelationshipProperty) InsertIRI(idx int, v *url.URL) } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "relationship". Existing elements at that index and higher are shifted back +// once. Invalidates all iterators. +func (this *ActivityStreamsRelationshipProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsRelationshipPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "relationship". Existing elements at that index and higher +// are shifted back once. Invalidates all iterators. +func (this *ActivityStreamsRelationshipProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsRelationshipPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "relationship". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -4346,146 +4493,154 @@ func (this ActivityStreamsRelationshipProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 16 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 17 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 17 { + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 22 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5273,6 +5428,34 @@ func (this *ActivityStreamsRelationshipProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "relationship". Invalidates all iterators. +func (this *ActivityStreamsRelationshipProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsRelationshipPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "relationship". Invalidates all iterators. +func (this *ActivityStreamsRelationshipProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsRelationshipPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "relationship". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. @@ -6013,6 +6196,32 @@ func (this *ActivityStreamsRelationshipProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "relationship". Panics if the index is out of bounds. Invalidates all +// iterators. +func (this *ActivityStreamsRelationshipProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsRelationshipPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "relationship". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsRelationshipProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsRelationshipPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "relationship". 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 diff --git a/streams/impl/activitystreams/property_result/gen_pkg.go b/streams/impl/activitystreams/property_result/gen_pkg.go index b3b9324..7d4cee4 100644 --- a/streams/impl/activitystreams/property_result/gen_pkg.go +++ b/streams/impl/activitystreams/property_result/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_result/gen_property_activitystreams_result.go b/streams/impl/activitystreams/property_result/gen_property_activitystreams_result.go index 529fc36..85855de 100644 --- a/streams/impl/activitystreams/property_result/gen_property_activitystreams_result.go +++ b/streams/impl/activitystreams/property_result/gen_property_activitystreams_result.go @@ -31,10 +31,12 @@ type ActivityStreamsResultPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsResultPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsResultPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsResultPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsResultPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsResultPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsResultPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsResultPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsResultPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsResultPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsResultPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsResultPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsResultPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsResultPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsResultPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsResultPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsResultPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsResultPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsResultPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsResultPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsResultPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsResultPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsResultPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsResultPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsResultPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsResultPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsResultPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsResultPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsResultPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsResultPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsResultPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3342,6 +3432,28 @@ func (this *ActivityStreamsResultProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "result". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsResultProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsResultPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "result". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsResultProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsResultPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "result". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4322,6 +4434,40 @@ func (this *ActivityStreamsResultProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "result". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsResultProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsResultPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "result". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsResultProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsResultPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "result". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4452,150 +4598,158 @@ func (this ActivityStreamsResultProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5410,6 +5564,34 @@ func (this *ActivityStreamsResultProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "result". Invalidates all iterators. +func (this *ActivityStreamsResultProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsResultPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "result". Invalidates all iterators. +func (this *ActivityStreamsResultProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsResultPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "result". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6176,6 +6358,31 @@ func (this *ActivityStreamsResultProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "result". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsResultProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsResultPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "result". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsResultProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsResultPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "result". 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. diff --git a/streams/impl/activitystreams/property_subject/gen_pkg.go b/streams/impl/activitystreams/property_subject/gen_pkg.go index 0dac2ea..7e8452a 100644 --- a/streams/impl/activitystreams/property_subject/gen_pkg.go +++ b/streams/impl/activitystreams/property_subject/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_subject/gen_property_activitystreams_subject.go b/streams/impl/activitystreams/property_subject/gen_property_activitystreams_subject.go index 54304d8..51853e3 100644 --- a/streams/impl/activitystreams/property_subject/gen_property_activitystreams_subject.go +++ b/streams/impl/activitystreams/property_subject/gen_property_activitystreams_subject.go @@ -31,10 +31,12 @@ type ActivityStreamsSubjectProperty struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func DeserializeSubjectProperty(m map[string]interface{}, aliasMap map[string]st alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsSubjectProperty{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsSubjectProperty{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func DeserializeSubjectProperty(m map[string]interface{}, aliasMap map[string]st alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsSubjectProperty{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsSubjectProperty{ activitystreamsIgnoreMember: v, @@ -461,10 +475,12 @@ func (this *ActivityStreamsSubjectProperty) Clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -886,6 +902,19 @@ func (this ActivityStreamsSubjectProperty) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsSubjectProperty) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsSubjectProperty) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsSubjectProperty) GetType() vocab.Type { @@ -940,6 +969,9 @@ func (this ActivityStreamsSubjectProperty) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -952,6 +984,9 @@ func (this ActivityStreamsSubjectProperty) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1074,10 +1109,12 @@ func (this ActivityStreamsSubjectProperty) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1503,6 +1540,19 @@ func (this ActivityStreamsSubjectProperty) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsSubjectProperty) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsSubjectProperty) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1543,6 +1593,8 @@ func (this ActivityStreamsSubjectProperty) JSONLDContext() map[string]string { child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1551,6 +1603,8 @@ func (this ActivityStreamsSubjectProperty) JSONLDContext() map[string]string { child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1684,117 +1738,123 @@ func (this ActivityStreamsSubjectProperty) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1846,6 +1906,8 @@ func (this ActivityStreamsSubjectProperty) LessThan(o vocab.ActivityStreamsSubje return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1854,6 +1916,8 @@ func (this ActivityStreamsSubjectProperty) LessThan(o vocab.ActivityStreamsSubje return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -1974,6 +2038,8 @@ func (this ActivityStreamsSubjectProperty) Serialize() (interface{}, error) { return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -1982,6 +2048,8 @@ func (this ActivityStreamsSubjectProperty) Serialize() (interface{}, error) { return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -2438,6 +2506,20 @@ func (this *ActivityStreamsSubjectProperty) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsSubjectProperty) SetTootEmoji(v vocab.TootEmoji) { + this.Clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsSubjectProperty) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.Clear() + this.tootIdentityProofMember = 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 *ActivityStreamsSubjectProperty) SetType(t vocab.Type) error { @@ -2509,6 +2591,10 @@ func (this *ActivityStreamsSubjectProperty) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2525,6 +2611,10 @@ func (this *ActivityStreamsSubjectProperty) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil diff --git a/streams/impl/activitystreams/property_tag/gen_pkg.go b/streams/impl/activitystreams/property_tag/gen_pkg.go index 82233b2..dc16492 100644 --- a/streams/impl/activitystreams/property_tag/gen_pkg.go +++ b/streams/impl/activitystreams/property_tag/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_tag/gen_property_activitystreams_tag.go b/streams/impl/activitystreams/property_tag/gen_property_activitystreams_tag.go index a332c5f..135eebe 100644 --- a/streams/impl/activitystreams/property_tag/gen_property_activitystreams_tag.go +++ b/streams/impl/activitystreams/property_tag/gen_property_activitystreams_tag.go @@ -31,10 +31,12 @@ type ActivityStreamsTagPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -202,6 +204,12 @@ func deserializeActivityStreamsTagPropertyIterator(i interface{}, aliasMap map[s alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsTagPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsTagPropertyIterator{ activitystreamsEventMember: v, @@ -226,6 +234,12 @@ func deserializeActivityStreamsTagPropertyIterator(i interface{}, aliasMap map[s alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsTagPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsTagPropertyIterator{ activitystreamsIgnoreMember: v, @@ -817,6 +831,19 @@ func (this ActivityStreamsTagPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsTagPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsTagPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsTagPropertyIterator) GetType() vocab.Type { @@ -871,6 +898,9 @@ func (this ActivityStreamsTagPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -883,6 +913,9 @@ func (this ActivityStreamsTagPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1005,10 +1038,12 @@ func (this ActivityStreamsTagPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1434,6 +1469,19 @@ func (this ActivityStreamsTagPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsTagPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsTagPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1474,6 +1522,8 @@ func (this ActivityStreamsTagPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1482,6 +1532,8 @@ func (this ActivityStreamsTagPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1615,117 +1667,123 @@ func (this ActivityStreamsTagPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1777,6 +1835,8 @@ func (this ActivityStreamsTagPropertyIterator) LessThan(o vocab.ActivityStreamsT return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1785,6 +1845,8 @@ func (this ActivityStreamsTagPropertyIterator) LessThan(o vocab.ActivityStreamsT return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2268,6 +2330,20 @@ func (this *ActivityStreamsTagPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsTagPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsTagPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsTagPropertyIterator) SetType(t vocab.Type) error { @@ -2339,6 +2415,10 @@ func (this *ActivityStreamsTagPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2355,6 +2435,10 @@ func (this *ActivityStreamsTagPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2511,10 +2595,12 @@ func (this *ActivityStreamsTagPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2591,6 +2677,8 @@ func (this ActivityStreamsTagPropertyIterator) serialize() (interface{}, error) return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2599,6 +2687,8 @@ func (this ActivityStreamsTagPropertyIterator) serialize() (interface{}, error) return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3340,6 +3430,28 @@ func (this *ActivityStreamsTagProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "tag". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsTagProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsTagPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "tag". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsTagProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsTagPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "tag". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4320,6 +4432,40 @@ func (this *ActivityStreamsTagProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "tag". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsTagProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsTagPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "tag". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsTagProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsTagPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "tag". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -4450,150 +4596,158 @@ func (this ActivityStreamsTagProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5407,6 +5561,34 @@ func (this *ActivityStreamsTagProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "tag". Invalidates all iterators. +func (this *ActivityStreamsTagProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsTagPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "tag". Invalidates all iterators. +func (this *ActivityStreamsTagProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsTagPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "tag". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -6173,6 +6355,31 @@ func (this *ActivityStreamsTagProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "tag". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsTagProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsTagPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "tag". Panics if the index is out of bounds. Invalidates +// all iterators. +func (this *ActivityStreamsTagProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsTagPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "tag". 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. diff --git a/streams/impl/activitystreams/property_target/gen_pkg.go b/streams/impl/activitystreams/property_target/gen_pkg.go index 6ed5d8d..91e73ef 100644 --- a/streams/impl/activitystreams/property_target/gen_pkg.go +++ b/streams/impl/activitystreams/property_target/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_target/gen_property_activitystreams_target.go b/streams/impl/activitystreams/property_target/gen_property_activitystreams_target.go index 9955ea0..495cdab 100644 --- a/streams/impl/activitystreams/property_target/gen_property_activitystreams_target.go +++ b/streams/impl/activitystreams/property_target/gen_property_activitystreams_target.go @@ -31,10 +31,12 @@ type ActivityStreamsTargetPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -203,6 +205,12 @@ func deserializeActivityStreamsTargetPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsTargetPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsTargetPropertyIterator{ activitystreamsEventMember: v, @@ -227,6 +235,12 @@ func deserializeActivityStreamsTargetPropertyIterator(i interface{}, aliasMap ma alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsTargetPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsTargetPropertyIterator{ activitystreamsIgnoreMember: v, @@ -818,6 +832,19 @@ func (this ActivityStreamsTargetPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsTargetPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsTargetPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsTargetPropertyIterator) GetType() vocab.Type { @@ -872,6 +899,9 @@ func (this ActivityStreamsTargetPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -884,6 +914,9 @@ func (this ActivityStreamsTargetPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1006,10 +1039,12 @@ func (this ActivityStreamsTargetPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1435,6 +1470,19 @@ func (this ActivityStreamsTargetPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsTargetPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsTargetPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1475,6 +1523,8 @@ func (this ActivityStreamsTargetPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1483,6 +1533,8 @@ func (this ActivityStreamsTargetPropertyIterator) JSONLDContext() map[string]str child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1616,117 +1668,123 @@ func (this ActivityStreamsTargetPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1778,6 +1836,8 @@ func (this ActivityStreamsTargetPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1786,6 +1846,8 @@ func (this ActivityStreamsTargetPropertyIterator) LessThan(o vocab.ActivityStrea return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2269,6 +2331,20 @@ func (this *ActivityStreamsTargetPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsTargetPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsTargetPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsTargetPropertyIterator) SetType(t vocab.Type) error { @@ -2340,6 +2416,10 @@ func (this *ActivityStreamsTargetPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2356,6 +2436,10 @@ func (this *ActivityStreamsTargetPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2512,10 +2596,12 @@ func (this *ActivityStreamsTargetPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2592,6 +2678,8 @@ func (this ActivityStreamsTargetPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2600,6 +2688,8 @@ func (this ActivityStreamsTargetPropertyIterator) serialize() (interface{}, erro return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3342,6 +3432,28 @@ func (this *ActivityStreamsTargetProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "target". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsTargetProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsTargetPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "target". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsTargetProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsTargetPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "target". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4322,6 +4434,40 @@ func (this *ActivityStreamsTargetProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "target". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsTargetProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsTargetPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "target". Existing elements at that index and higher are +// shifted back once. Invalidates all iterators. +func (this *ActivityStreamsTargetProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsTargetPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "target". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -4452,150 +4598,158 @@ func (this ActivityStreamsTargetProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5410,6 +5564,34 @@ func (this *ActivityStreamsTargetProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "target". Invalidates all iterators. +func (this *ActivityStreamsTargetProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsTargetPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "target". Invalidates all iterators. +func (this *ActivityStreamsTargetProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsTargetPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "target". Invalidates all iterators. Returns an error if the type // is not a valid one to set for this property. @@ -6176,6 +6358,31 @@ func (this *ActivityStreamsTargetProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "target". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsTargetProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsTargetPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "target". Panics if the index is out of bounds. +// Invalidates all iterators. +func (this *ActivityStreamsTargetProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsTargetPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "target". 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. diff --git a/streams/impl/activitystreams/property_to/gen_pkg.go b/streams/impl/activitystreams/property_to/gen_pkg.go index e1fa1f4..83b418b 100644 --- a/streams/impl/activitystreams/property_to/gen_pkg.go +++ b/streams/impl/activitystreams/property_to/gen_pkg.go @@ -69,6 +69,9 @@ type privateManager interface { // for the "ActivityStreamsDocument" non-functional property in the // vocabulary "ActivityStreams" DeserializeDocumentActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDocument, error) + // DeserializeEmojiToot returns the deserialization method for the + // "TootEmoji" non-functional property in the vocabulary "Toot" + DeserializeEmojiToot() func(map[string]interface{}, map[string]string) (vocab.TootEmoji, error) // DeserializeEventActivityStreams returns the deserialization method for // the "ActivityStreamsEvent" non-functional property in the // vocabulary "ActivityStreams" @@ -85,6 +88,9 @@ type privateManager interface { // the "ActivityStreamsGroup" non-functional property in the // vocabulary "ActivityStreams" DeserializeGroupActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGroup, error) + // DeserializeIdentityProofToot returns the deserialization method for the + // "TootIdentityProof" non-functional property in the vocabulary "Toot" + DeserializeIdentityProofToot() func(map[string]interface{}, map[string]string) (vocab.TootIdentityProof, error) // DeserializeIgnoreActivityStreams returns the deserialization method for // the "ActivityStreamsIgnore" non-functional property in the // vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/property_to/gen_property_activitystreams_to.go b/streams/impl/activitystreams/property_to/gen_property_activitystreams_to.go index 4951ad6..440374c 100644 --- a/streams/impl/activitystreams/property_to/gen_property_activitystreams_to.go +++ b/streams/impl/activitystreams/property_to/gen_property_activitystreams_to.go @@ -31,10 +31,12 @@ type ActivityStreamsToPropertyIterator struct { activitystreamsDeleteMember vocab.ActivityStreamsDelete activitystreamsDislikeMember vocab.ActivityStreamsDislike activitystreamsDocumentMember vocab.ActivityStreamsDocument + tootEmojiMember vocab.TootEmoji activitystreamsEventMember vocab.ActivityStreamsEvent activitystreamsFlagMember vocab.ActivityStreamsFlag activitystreamsFollowMember vocab.ActivityStreamsFollow activitystreamsGroupMember vocab.ActivityStreamsGroup + tootIdentityProofMember vocab.TootIdentityProof activitystreamsIgnoreMember vocab.ActivityStreamsIgnore activitystreamsImageMember vocab.ActivityStreamsImage activitystreamsIntransitiveActivityMember vocab.ActivityStreamsIntransitiveActivity @@ -202,6 +204,12 @@ func deserializeActivityStreamsToPropertyIterator(i interface{}, aliasMap map[st alias: alias, } return this, nil + } else if v, err := mgr.DeserializeEmojiToot()(m, aliasMap); err == nil { + this := &ActivityStreamsToPropertyIterator{ + alias: alias, + tootEmojiMember: v, + } + return this, nil } else if v, err := mgr.DeserializeEventActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsToPropertyIterator{ activitystreamsEventMember: v, @@ -226,6 +234,12 @@ func deserializeActivityStreamsToPropertyIterator(i interface{}, aliasMap map[st alias: alias, } return this, nil + } else if v, err := mgr.DeserializeIdentityProofToot()(m, aliasMap); err == nil { + this := &ActivityStreamsToPropertyIterator{ + alias: alias, + tootIdentityProofMember: v, + } + return this, nil } else if v, err := mgr.DeserializeIgnoreActivityStreams()(m, aliasMap); err == nil { this := &ActivityStreamsToPropertyIterator{ activitystreamsIgnoreMember: v, @@ -817,6 +831,19 @@ func (this ActivityStreamsToPropertyIterator) GetIRI() *url.URL { return this.iri } +// GetTootEmoji returns the value of this property. When IsTootEmoji returns +// false, GetTootEmoji will return an arbitrary value. +func (this ActivityStreamsToPropertyIterator) GetTootEmoji() vocab.TootEmoji { + return this.tootEmojiMember +} + +// GetTootIdentityProof returns the value of this property. When +// IsTootIdentityProof returns false, GetTootIdentityProof will return an +// arbitrary value. +func (this ActivityStreamsToPropertyIterator) GetTootIdentityProof() vocab.TootIdentityProof { + return this.tootIdentityProofMember +} + // 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 ActivityStreamsToPropertyIterator) GetType() vocab.Type { @@ -871,6 +898,9 @@ func (this ActivityStreamsToPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument() } + if this.IsTootEmoji() { + return this.GetTootEmoji() + } if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent() } @@ -883,6 +913,9 @@ func (this ActivityStreamsToPropertyIterator) GetType() vocab.Type { if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup() } + if this.IsTootIdentityProof() { + return this.GetTootIdentityProof() + } if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore() } @@ -1005,10 +1038,12 @@ func (this ActivityStreamsToPropertyIterator) HasAny() bool { this.IsActivityStreamsDelete() || this.IsActivityStreamsDislike() || this.IsActivityStreamsDocument() || + this.IsTootEmoji() || this.IsActivityStreamsEvent() || this.IsActivityStreamsFlag() || this.IsActivityStreamsFollow() || this.IsActivityStreamsGroup() || + this.IsTootIdentityProof() || this.IsActivityStreamsIgnore() || this.IsActivityStreamsImage() || this.IsActivityStreamsIntransitiveActivity() || @@ -1434,6 +1469,19 @@ func (this ActivityStreamsToPropertyIterator) IsIRI() bool { return this.iri != nil } +// IsTootEmoji returns true if this property has a type of "Emoji". When true, use +// the GetTootEmoji and SetTootEmoji methods to access and set this property. +func (this ActivityStreamsToPropertyIterator) IsTootEmoji() bool { + return this.tootEmojiMember != nil +} + +// IsTootIdentityProof returns true if this property has a type of +// "IdentityProof". When true, use the GetTootIdentityProof and +// SetTootIdentityProof methods to access and set this property. +func (this ActivityStreamsToPropertyIterator) IsTootIdentityProof() bool { + return this.tootIdentityProofMember != 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. @@ -1474,6 +1522,8 @@ func (this ActivityStreamsToPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsDislike().JSONLDContext() } else if this.IsActivityStreamsDocument() { child = this.GetActivityStreamsDocument().JSONLDContext() + } else if this.IsTootEmoji() { + child = this.GetTootEmoji().JSONLDContext() } else if this.IsActivityStreamsEvent() { child = this.GetActivityStreamsEvent().JSONLDContext() } else if this.IsActivityStreamsFlag() { @@ -1482,6 +1532,8 @@ func (this ActivityStreamsToPropertyIterator) JSONLDContext() map[string]string child = this.GetActivityStreamsFollow().JSONLDContext() } else if this.IsActivityStreamsGroup() { child = this.GetActivityStreamsGroup().JSONLDContext() + } else if this.IsTootIdentityProof() { + child = this.GetTootIdentityProof().JSONLDContext() } else if this.IsActivityStreamsIgnore() { child = this.GetActivityStreamsIgnore().JSONLDContext() } else if this.IsActivityStreamsImage() { @@ -1615,117 +1667,123 @@ func (this ActivityStreamsToPropertyIterator) KindIndex() int { if this.IsActivityStreamsDocument() { return 16 } - if this.IsActivityStreamsEvent() { + if this.IsTootEmoji() { return 17 } - if this.IsActivityStreamsFlag() { + if this.IsActivityStreamsEvent() { return 18 } - if this.IsActivityStreamsFollow() { + if this.IsActivityStreamsFlag() { return 19 } - if this.IsActivityStreamsGroup() { + if this.IsActivityStreamsFollow() { return 20 } - if this.IsActivityStreamsIgnore() { + if this.IsActivityStreamsGroup() { return 21 } - if this.IsActivityStreamsImage() { + if this.IsTootIdentityProof() { return 22 } - if this.IsActivityStreamsIntransitiveActivity() { + if this.IsActivityStreamsIgnore() { return 23 } - if this.IsActivityStreamsInvite() { + if this.IsActivityStreamsImage() { return 24 } - if this.IsActivityStreamsJoin() { + if this.IsActivityStreamsIntransitiveActivity() { return 25 } - if this.IsActivityStreamsLeave() { + if this.IsActivityStreamsInvite() { return 26 } - if this.IsActivityStreamsLike() { + if this.IsActivityStreamsJoin() { return 27 } - if this.IsActivityStreamsListen() { + if this.IsActivityStreamsLeave() { return 28 } - if this.IsActivityStreamsMention() { + if this.IsActivityStreamsLike() { return 29 } - if this.IsActivityStreamsMove() { + if this.IsActivityStreamsListen() { return 30 } - if this.IsActivityStreamsNote() { + if this.IsActivityStreamsMention() { return 31 } - if this.IsActivityStreamsOffer() { + if this.IsActivityStreamsMove() { return 32 } - if this.IsActivityStreamsOrderedCollection() { + if this.IsActivityStreamsNote() { return 33 } - if this.IsActivityStreamsOrderedCollectionPage() { + if this.IsActivityStreamsOffer() { return 34 } - if this.IsActivityStreamsOrganization() { + if this.IsActivityStreamsOrderedCollection() { return 35 } - if this.IsActivityStreamsPage() { + if this.IsActivityStreamsOrderedCollectionPage() { return 36 } - if this.IsActivityStreamsPerson() { + if this.IsActivityStreamsOrganization() { return 37 } - if this.IsActivityStreamsPlace() { + if this.IsActivityStreamsPage() { return 38 } - if this.IsActivityStreamsProfile() { + if this.IsActivityStreamsPerson() { return 39 } - if this.IsActivityStreamsQuestion() { + if this.IsActivityStreamsPlace() { return 40 } - if this.IsActivityStreamsRead() { + if this.IsActivityStreamsProfile() { return 41 } - if this.IsActivityStreamsReject() { + if this.IsActivityStreamsQuestion() { return 42 } - if this.IsActivityStreamsRelationship() { + if this.IsActivityStreamsRead() { return 43 } - if this.IsActivityStreamsRemove() { + if this.IsActivityStreamsReject() { return 44 } - if this.IsActivityStreamsService() { + if this.IsActivityStreamsRelationship() { return 45 } - if this.IsActivityStreamsTentativeAccept() { + if this.IsActivityStreamsRemove() { return 46 } - if this.IsActivityStreamsTentativeReject() { + if this.IsActivityStreamsService() { return 47 } - if this.IsActivityStreamsTombstone() { + if this.IsActivityStreamsTentativeAccept() { return 48 } - if this.IsActivityStreamsTravel() { + if this.IsActivityStreamsTentativeReject() { return 49 } - if this.IsActivityStreamsUndo() { + if this.IsActivityStreamsTombstone() { return 50 } - if this.IsActivityStreamsUpdate() { + if this.IsActivityStreamsTravel() { return 51 } - if this.IsActivityStreamsVideo() { + if this.IsActivityStreamsUndo() { return 52 } - if this.IsActivityStreamsView() { + if this.IsActivityStreamsUpdate() { return 53 } + if this.IsActivityStreamsVideo() { + return 54 + } + if this.IsActivityStreamsView() { + return 55 + } if this.IsIRI() { return -2 } @@ -1777,6 +1835,8 @@ func (this ActivityStreamsToPropertyIterator) LessThan(o vocab.ActivityStreamsTo return this.GetActivityStreamsDislike().LessThan(o.GetActivityStreamsDislike()) } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().LessThan(o.GetActivityStreamsDocument()) + } else if this.IsTootEmoji() { + return this.GetTootEmoji().LessThan(o.GetTootEmoji()) } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().LessThan(o.GetActivityStreamsEvent()) } else if this.IsActivityStreamsFlag() { @@ -1785,6 +1845,8 @@ func (this ActivityStreamsToPropertyIterator) LessThan(o vocab.ActivityStreamsTo return this.GetActivityStreamsFollow().LessThan(o.GetActivityStreamsFollow()) } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().LessThan(o.GetActivityStreamsGroup()) + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().LessThan(o.GetTootIdentityProof()) } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().LessThan(o.GetActivityStreamsIgnore()) } else if this.IsActivityStreamsImage() { @@ -2268,6 +2330,20 @@ func (this *ActivityStreamsToPropertyIterator) SetIRI(v *url.URL) { this.iri = v } +// SetTootEmoji sets the value of this property. Calling IsTootEmoji afterwards +// returns true. +func (this *ActivityStreamsToPropertyIterator) SetTootEmoji(v vocab.TootEmoji) { + this.clear() + this.tootEmojiMember = v +} + +// SetTootIdentityProof sets the value of this property. Calling +// IsTootIdentityProof afterwards returns true. +func (this *ActivityStreamsToPropertyIterator) SetTootIdentityProof(v vocab.TootIdentityProof) { + this.clear() + this.tootIdentityProofMember = 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 *ActivityStreamsToPropertyIterator) SetType(t vocab.Type) error { @@ -2339,6 +2415,10 @@ func (this *ActivityStreamsToPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsDocument(v) return nil } + if v, ok := t.(vocab.TootEmoji); ok { + this.SetTootEmoji(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsEvent); ok { this.SetActivityStreamsEvent(v) return nil @@ -2355,6 +2435,10 @@ func (this *ActivityStreamsToPropertyIterator) SetType(t vocab.Type) error { this.SetActivityStreamsGroup(v) return nil } + if v, ok := t.(vocab.TootIdentityProof); ok { + this.SetTootIdentityProof(v) + return nil + } if v, ok := t.(vocab.ActivityStreamsIgnore); ok { this.SetActivityStreamsIgnore(v) return nil @@ -2511,10 +2595,12 @@ func (this *ActivityStreamsToPropertyIterator) clear() { this.activitystreamsDeleteMember = nil this.activitystreamsDislikeMember = nil this.activitystreamsDocumentMember = nil + this.tootEmojiMember = nil this.activitystreamsEventMember = nil this.activitystreamsFlagMember = nil this.activitystreamsFollowMember = nil this.activitystreamsGroupMember = nil + this.tootIdentityProofMember = nil this.activitystreamsIgnoreMember = nil this.activitystreamsImageMember = nil this.activitystreamsIntransitiveActivityMember = nil @@ -2591,6 +2677,8 @@ func (this ActivityStreamsToPropertyIterator) serialize() (interface{}, error) { return this.GetActivityStreamsDislike().Serialize() } else if this.IsActivityStreamsDocument() { return this.GetActivityStreamsDocument().Serialize() + } else if this.IsTootEmoji() { + return this.GetTootEmoji().Serialize() } else if this.IsActivityStreamsEvent() { return this.GetActivityStreamsEvent().Serialize() } else if this.IsActivityStreamsFlag() { @@ -2599,6 +2687,8 @@ func (this ActivityStreamsToPropertyIterator) serialize() (interface{}, error) { return this.GetActivityStreamsFollow().Serialize() } else if this.IsActivityStreamsGroup() { return this.GetActivityStreamsGroup().Serialize() + } else if this.IsTootIdentityProof() { + return this.GetTootIdentityProof().Serialize() } else if this.IsActivityStreamsIgnore() { return this.GetActivityStreamsIgnore().Serialize() } else if this.IsActivityStreamsImage() { @@ -3340,6 +3430,28 @@ func (this *ActivityStreamsToProperty) AppendIRI(v *url.URL) { }) } +// AppendTootEmoji appends a Emoji value to the back of a list of the property +// "to". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsToProperty) AppendTootEmoji(v vocab.TootEmoji) { + this.properties = append(this.properties, &ActivityStreamsToPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootEmojiMember: v, + }) +} + +// AppendTootIdentityProof appends a IdentityProof value to the back of a list of +// the property "to". Invalidates iterators that are traversing using Prev. +func (this *ActivityStreamsToProperty) AppendTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append(this.properties, &ActivityStreamsToPropertyIterator{ + alias: this.alias, + myIdx: this.Len(), + parent: this, + tootIdentityProofMember: v, + }) +} + // PrependType prepends an arbitrary type value to the front of a list of the // property "to". Invalidates iterators that are traversing using Prev. // Returns an error if the type is not a valid one to set for this property. @@ -4320,6 +4432,40 @@ func (this *ActivityStreamsToProperty) InsertIRI(idx int, v *url.URL) { } } +// InsertTootEmoji inserts a Emoji value at the specified index for a property +// "to". Existing elements at that index and higher are shifted back once. +// Invalidates all iterators. +func (this *ActivityStreamsToProperty) InsertTootEmoji(idx int, v vocab.TootEmoji) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } + for i := idx; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// InsertTootIdentityProof inserts a IdentityProof value at the specified index +// for a property "to". Existing elements at that index and higher are shifted +// back once. Invalidates all iterators. +func (this *ActivityStreamsToProperty) InsertTootIdentityProof(idx int, v vocab.TootIdentityProof) { + this.properties = append(this.properties, nil) + copy(this.properties[idx+1:], this.properties[idx:]) + this.properties[idx] = &ActivityStreamsToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: 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 "to". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -4450,150 +4596,158 @@ func (this ActivityStreamsToProperty) Less(i, j int) bool { rhs := this.properties[j].GetActivityStreamsDocument() return lhs.LessThan(rhs) } else if idx1 == 17 { + lhs := this.properties[i].GetTootEmoji() + rhs := this.properties[j].GetTootEmoji() + return lhs.LessThan(rhs) + } else if idx1 == 18 { lhs := this.properties[i].GetActivityStreamsEvent() rhs := this.properties[j].GetActivityStreamsEvent() return lhs.LessThan(rhs) - } else if idx1 == 18 { + } else if idx1 == 19 { lhs := this.properties[i].GetActivityStreamsFlag() rhs := this.properties[j].GetActivityStreamsFlag() return lhs.LessThan(rhs) - } else if idx1 == 19 { + } else if idx1 == 20 { lhs := this.properties[i].GetActivityStreamsFollow() rhs := this.properties[j].GetActivityStreamsFollow() return lhs.LessThan(rhs) - } else if idx1 == 20 { + } else if idx1 == 21 { lhs := this.properties[i].GetActivityStreamsGroup() rhs := this.properties[j].GetActivityStreamsGroup() return lhs.LessThan(rhs) - } else if idx1 == 21 { + } else if idx1 == 22 { + lhs := this.properties[i].GetTootIdentityProof() + rhs := this.properties[j].GetTootIdentityProof() + return lhs.LessThan(rhs) + } else if idx1 == 23 { lhs := this.properties[i].GetActivityStreamsIgnore() rhs := this.properties[j].GetActivityStreamsIgnore() return lhs.LessThan(rhs) - } else if idx1 == 22 { + } else if idx1 == 24 { lhs := this.properties[i].GetActivityStreamsImage() rhs := this.properties[j].GetActivityStreamsImage() return lhs.LessThan(rhs) - } else if idx1 == 23 { + } else if idx1 == 25 { lhs := this.properties[i].GetActivityStreamsIntransitiveActivity() rhs := this.properties[j].GetActivityStreamsIntransitiveActivity() return lhs.LessThan(rhs) - } else if idx1 == 24 { + } else if idx1 == 26 { lhs := this.properties[i].GetActivityStreamsInvite() rhs := this.properties[j].GetActivityStreamsInvite() return lhs.LessThan(rhs) - } else if idx1 == 25 { + } else if idx1 == 27 { lhs := this.properties[i].GetActivityStreamsJoin() rhs := this.properties[j].GetActivityStreamsJoin() return lhs.LessThan(rhs) - } else if idx1 == 26 { + } else if idx1 == 28 { lhs := this.properties[i].GetActivityStreamsLeave() rhs := this.properties[j].GetActivityStreamsLeave() return lhs.LessThan(rhs) - } else if idx1 == 27 { + } else if idx1 == 29 { lhs := this.properties[i].GetActivityStreamsLike() rhs := this.properties[j].GetActivityStreamsLike() return lhs.LessThan(rhs) - } else if idx1 == 28 { + } else if idx1 == 30 { lhs := this.properties[i].GetActivityStreamsListen() rhs := this.properties[j].GetActivityStreamsListen() return lhs.LessThan(rhs) - } else if idx1 == 29 { + } else if idx1 == 31 { lhs := this.properties[i].GetActivityStreamsMention() rhs := this.properties[j].GetActivityStreamsMention() return lhs.LessThan(rhs) - } else if idx1 == 30 { + } else if idx1 == 32 { lhs := this.properties[i].GetActivityStreamsMove() rhs := this.properties[j].GetActivityStreamsMove() return lhs.LessThan(rhs) - } else if idx1 == 31 { + } else if idx1 == 33 { lhs := this.properties[i].GetActivityStreamsNote() rhs := this.properties[j].GetActivityStreamsNote() return lhs.LessThan(rhs) - } else if idx1 == 32 { + } else if idx1 == 34 { lhs := this.properties[i].GetActivityStreamsOffer() rhs := this.properties[j].GetActivityStreamsOffer() return lhs.LessThan(rhs) - } else if idx1 == 33 { + } else if idx1 == 35 { lhs := this.properties[i].GetActivityStreamsOrderedCollection() rhs := this.properties[j].GetActivityStreamsOrderedCollection() return lhs.LessThan(rhs) - } else if idx1 == 34 { + } else if idx1 == 36 { lhs := this.properties[i].GetActivityStreamsOrderedCollectionPage() rhs := this.properties[j].GetActivityStreamsOrderedCollectionPage() return lhs.LessThan(rhs) - } else if idx1 == 35 { + } else if idx1 == 37 { lhs := this.properties[i].GetActivityStreamsOrganization() rhs := this.properties[j].GetActivityStreamsOrganization() return lhs.LessThan(rhs) - } else if idx1 == 36 { + } else if idx1 == 38 { lhs := this.properties[i].GetActivityStreamsPage() rhs := this.properties[j].GetActivityStreamsPage() return lhs.LessThan(rhs) - } else if idx1 == 37 { + } else if idx1 == 39 { lhs := this.properties[i].GetActivityStreamsPerson() rhs := this.properties[j].GetActivityStreamsPerson() return lhs.LessThan(rhs) - } else if idx1 == 38 { + } else if idx1 == 40 { lhs := this.properties[i].GetActivityStreamsPlace() rhs := this.properties[j].GetActivityStreamsPlace() return lhs.LessThan(rhs) - } else if idx1 == 39 { + } else if idx1 == 41 { lhs := this.properties[i].GetActivityStreamsProfile() rhs := this.properties[j].GetActivityStreamsProfile() return lhs.LessThan(rhs) - } else if idx1 == 40 { + } else if idx1 == 42 { lhs := this.properties[i].GetActivityStreamsQuestion() rhs := this.properties[j].GetActivityStreamsQuestion() return lhs.LessThan(rhs) - } else if idx1 == 41 { + } else if idx1 == 43 { lhs := this.properties[i].GetActivityStreamsRead() rhs := this.properties[j].GetActivityStreamsRead() return lhs.LessThan(rhs) - } else if idx1 == 42 { + } else if idx1 == 44 { lhs := this.properties[i].GetActivityStreamsReject() rhs := this.properties[j].GetActivityStreamsReject() return lhs.LessThan(rhs) - } else if idx1 == 43 { + } else if idx1 == 45 { lhs := this.properties[i].GetActivityStreamsRelationship() rhs := this.properties[j].GetActivityStreamsRelationship() return lhs.LessThan(rhs) - } else if idx1 == 44 { + } else if idx1 == 46 { lhs := this.properties[i].GetActivityStreamsRemove() rhs := this.properties[j].GetActivityStreamsRemove() return lhs.LessThan(rhs) - } else if idx1 == 45 { + } else if idx1 == 47 { lhs := this.properties[i].GetActivityStreamsService() rhs := this.properties[j].GetActivityStreamsService() return lhs.LessThan(rhs) - } else if idx1 == 46 { + } else if idx1 == 48 { lhs := this.properties[i].GetActivityStreamsTentativeAccept() rhs := this.properties[j].GetActivityStreamsTentativeAccept() return lhs.LessThan(rhs) - } else if idx1 == 47 { + } else if idx1 == 49 { lhs := this.properties[i].GetActivityStreamsTentativeReject() rhs := this.properties[j].GetActivityStreamsTentativeReject() return lhs.LessThan(rhs) - } else if idx1 == 48 { + } else if idx1 == 50 { lhs := this.properties[i].GetActivityStreamsTombstone() rhs := this.properties[j].GetActivityStreamsTombstone() return lhs.LessThan(rhs) - } else if idx1 == 49 { + } else if idx1 == 51 { lhs := this.properties[i].GetActivityStreamsTravel() rhs := this.properties[j].GetActivityStreamsTravel() return lhs.LessThan(rhs) - } else if idx1 == 50 { + } else if idx1 == 52 { lhs := this.properties[i].GetActivityStreamsUndo() rhs := this.properties[j].GetActivityStreamsUndo() return lhs.LessThan(rhs) - } else if idx1 == 51 { + } else if idx1 == 53 { lhs := this.properties[i].GetActivityStreamsUpdate() rhs := this.properties[j].GetActivityStreamsUpdate() return lhs.LessThan(rhs) - } else if idx1 == 52 { + } else if idx1 == 54 { lhs := this.properties[i].GetActivityStreamsVideo() rhs := this.properties[j].GetActivityStreamsVideo() return lhs.LessThan(rhs) - } else if idx1 == 53 { + } else if idx1 == 55 { lhs := this.properties[i].GetActivityStreamsView() rhs := this.properties[j].GetActivityStreamsView() return lhs.LessThan(rhs) @@ -5407,6 +5561,34 @@ func (this *ActivityStreamsToProperty) PrependIRI(v *url.URL) { } } +// PrependTootEmoji prepends a Emoji value to the front of a list of the property +// "to". Invalidates all iterators. +func (this *ActivityStreamsToProperty) PrependTootEmoji(v vocab.TootEmoji) { + this.properties = append([]*ActivityStreamsToPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootEmojiMember: v, + }}, this.properties...) + for i := 1; i < this.Len(); i++ { + (this.properties)[i].myIdx = i + } +} + +// PrependTootIdentityProof prepends a IdentityProof value to the front of a list +// of the property "to". Invalidates all iterators. +func (this *ActivityStreamsToProperty) PrependTootIdentityProof(v vocab.TootIdentityProof) { + this.properties = append([]*ActivityStreamsToPropertyIterator{{ + alias: this.alias, + myIdx: 0, + parent: this, + tootIdentityProofMember: 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 "to". Invalidates all iterators. Returns an error if the type is // not a valid one to set for this property. @@ -6173,6 +6355,31 @@ func (this *ActivityStreamsToProperty) SetIRI(idx int, v *url.URL) { } } +// SetTootEmoji sets a Emoji value to be at the specified index for the property +// "to". Panics if the index is out of bounds. Invalidates all iterators. +func (this *ActivityStreamsToProperty) SetTootEmoji(idx int, v vocab.TootEmoji) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootEmojiMember: v, + } +} + +// SetTootIdentityProof sets a IdentityProof value to be at the specified index +// for the property "to". Panics if the index is out of bounds. Invalidates +// all iterators. +func (this *ActivityStreamsToProperty) SetTootIdentityProof(idx int, v vocab.TootIdentityProof) { + (this.properties)[idx].parent = nil + (this.properties)[idx] = &ActivityStreamsToPropertyIterator{ + alias: this.alias, + myIdx: idx, + parent: this, + tootIdentityProofMember: v, + } +} + // SetType sets an arbitrary type value to the specified index of the property // "to". 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. diff --git a/streams/impl/activitystreams/type_application/gen_pkg.go b/streams/impl/activitystreams/type_application/gen_pkg.go index dc8a758..3bce8fd 100644 --- a/streams/impl/activitystreams/type_application/gen_pkg.go +++ b/streams/impl/activitystreams/type_application/gen_pkg.go @@ -48,6 +48,10 @@ type privateManager interface { // method for the "ActivityStreamsContextProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeContextPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContextProperty, error) + // DeserializeDiscoverablePropertyToot returns the deserialization method + // for the "TootDiscoverableProperty" non-functional property in the + // vocabulary "Toot" + DeserializeDiscoverablePropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootDiscoverableProperty, error) // DeserializeDurationPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsDurationProperty" non-functional // property in the vocabulary "ActivityStreams" @@ -56,6 +60,10 @@ type privateManager interface { // method for the "ActivityStreamsEndTimeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeEndTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndTimeProperty, error) + // DeserializeFeaturedPropertyToot returns the deserialization method for + // the "TootFeaturedProperty" non-functional property in the + // vocabulary "Toot" + DeserializeFeaturedPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootFeaturedProperty, error) // DeserializeFollowersPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsFollowersProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_application/gen_type_activitystreams_application.go b/streams/impl/activitystreams/type_application/gen_type_activitystreams_application.go index 11f1471..b143d22 100644 --- a/streams/impl/activitystreams/type_application/gen_type_activitystreams_application.go +++ b/streams/impl/activitystreams/type_application/gen_type_activitystreams_application.go @@ -25,8 +25,10 @@ type ActivityStreamsApplication struct { ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty ActivityStreamsContext vocab.ActivityStreamsContextProperty + TootDiscoverable vocab.TootDiscoverableProperty ActivityStreamsDuration vocab.ActivityStreamsDurationProperty ActivityStreamsEndTime vocab.ActivityStreamsEndTimeProperty + TootFeatured vocab.TootFeaturedProperty ActivityStreamsFollowers vocab.ActivityStreamsFollowersProperty ActivityStreamsFollowing vocab.ActivityStreamsFollowingProperty ActivityStreamsGenerator vocab.ActivityStreamsGeneratorProperty @@ -174,6 +176,11 @@ func DeserializeApplication(m map[string]interface{}, aliasMap map[string]string } else if p != nil { this.ActivityStreamsContext = p } + if p, err := mgr.DeserializeDiscoverablePropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootDiscoverable = p + } if p, err := mgr.DeserializeDurationPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -184,6 +191,11 @@ func DeserializeApplication(m map[string]interface{}, aliasMap map[string]string } else if p != nil { this.ActivityStreamsEndTime = p } + if p, err := mgr.DeserializeFeaturedPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootFeatured = p + } if p, err := mgr.DeserializeFollowersPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -354,10 +366,14 @@ func DeserializeApplication(m map[string]interface{}, aliasMap map[string]string continue } else if k == "context" { continue + } else if k == "discoverable" { + continue } else if k == "duration" { continue } else if k == "endTime" { continue + } else if k == "featured" { + continue } else if k == "followers" { continue } else if k == "following" { @@ -681,6 +697,17 @@ func (this ActivityStreamsApplication) GetJSONLDType() vocab.JSONLDTypeProperty return this.JSONLDType } +// GetTootDiscoverable returns the "discoverable" property if it exists, and nil +// otherwise. +func (this ActivityStreamsApplication) GetTootDiscoverable() vocab.TootDiscoverableProperty { + return this.TootDiscoverable +} + +// GetTootFeatured returns the "featured" property if it exists, and nil otherwise. +func (this ActivityStreamsApplication) GetTootFeatured() vocab.TootFeaturedProperty { + return this.TootFeatured +} + // GetTypeName returns the name of this type. func (this ActivityStreamsApplication) GetTypeName() string { return "Application" @@ -721,8 +748,10 @@ func (this ActivityStreamsApplication) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) m = this.helperJSONLDContext(this.ActivityStreamsContext, m) + m = this.helperJSONLDContext(this.TootDiscoverable, m) m = this.helperJSONLDContext(this.ActivityStreamsDuration, m) m = this.helperJSONLDContext(this.ActivityStreamsEndTime, m) + m = this.helperJSONLDContext(this.TootFeatured, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowers, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowing, m) m = this.helperJSONLDContext(this.ActivityStreamsGenerator, m) @@ -886,6 +915,20 @@ func (this ActivityStreamsApplication) LessThan(o vocab.ActivityStreamsApplicati // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "discoverable" + if lhs, rhs := this.TootDiscoverable, o.GetTootDiscoverable(); 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 "duration" if lhs, rhs := this.ActivityStreamsDuration, o.GetActivityStreamsDuration(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -914,6 +957,20 @@ func (this ActivityStreamsApplication) LessThan(o vocab.ActivityStreamsApplicati // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "featured" + if lhs, rhs := this.TootFeatured, o.GetTootFeatured(); 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 "followers" if lhs, rhs := this.ActivityStreamsFollowers, o.GetActivityStreamsFollowers(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1415,6 +1472,14 @@ func (this ActivityStreamsApplication) Serialize() (map[string]interface{}, erro m[this.ActivityStreamsContext.Name()] = i } } + // Maybe serialize property "discoverable" + if this.TootDiscoverable != nil { + if i, err := this.TootDiscoverable.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootDiscoverable.Name()] = i + } + } // Maybe serialize property "duration" if this.ActivityStreamsDuration != nil { if i, err := this.ActivityStreamsDuration.Serialize(); err != nil { @@ -1431,6 +1496,14 @@ func (this ActivityStreamsApplication) Serialize() (map[string]interface{}, erro m[this.ActivityStreamsEndTime.Name()] = i } } + // Maybe serialize property "featured" + if this.TootFeatured != nil { + if i, err := this.TootFeatured.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootFeatured.Name()] = i + } + } // Maybe serialize property "followers" if this.ActivityStreamsFollowers != nil { if i, err := this.ActivityStreamsFollowers.Serialize(); err != nil { @@ -1872,6 +1945,16 @@ func (this *ActivityStreamsApplication) SetJSONLDType(i vocab.JSONLDTypeProperty this.JSONLDType = i } +// SetTootDiscoverable sets the "discoverable" property. +func (this *ActivityStreamsApplication) SetTootDiscoverable(i vocab.TootDiscoverableProperty) { + this.TootDiscoverable = i +} + +// SetTootFeatured sets the "featured" property. +func (this *ActivityStreamsApplication) SetTootFeatured(i vocab.TootFeaturedProperty) { + this.TootFeatured = i +} + // SetW3IDSecurityV1PublicKey sets the "publicKey" property. func (this *ActivityStreamsApplication) SetW3IDSecurityV1PublicKey(i vocab.W3IDSecurityV1PublicKeyProperty) { this.W3IDSecurityV1PublicKey = i diff --git a/streams/impl/activitystreams/type_audio/gen_pkg.go b/streams/impl/activitystreams/type_audio/gen_pkg.go index ce9d21a..c698b80 100644 --- a/streams/impl/activitystreams/type_audio/gen_pkg.go +++ b/streams/impl/activitystreams/type_audio/gen_pkg.go @@ -32,6 +32,10 @@ type privateManager interface { // method for the "ActivityStreamsBccProperty" non-functional property // in the vocabulary "ActivityStreams" DeserializeBccPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBccProperty, error) + // DeserializeBlurhashPropertyToot returns the deserialization method for + // the "TootBlurhashProperty" non-functional property in the + // vocabulary "Toot" + DeserializeBlurhashPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootBlurhashProperty, error) // DeserializeBtoPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsBtoProperty" non-functional property // in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_audio/gen_type_activitystreams_audio.go b/streams/impl/activitystreams/type_audio/gen_type_activitystreams_audio.go index 222b21c..75209fd 100644 --- a/streams/impl/activitystreams/type_audio/gen_type_activitystreams_audio.go +++ b/streams/impl/activitystreams/type_audio/gen_type_activitystreams_audio.go @@ -26,6 +26,7 @@ type ActivityStreamsAudio struct { ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty ActivityStreamsBcc vocab.ActivityStreamsBccProperty + TootBlurhash vocab.TootBlurhashProperty ActivityStreamsBto vocab.ActivityStreamsBtoProperty ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty @@ -151,6 +152,11 @@ func DeserializeAudio(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsBcc = p } + if p, err := mgr.DeserializeBlurhashPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootBlurhash = p + } if p, err := mgr.DeserializeBtoPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -301,6 +307,8 @@ func DeserializeAudio(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "bcc" { continue + } else if k == "blurhash" { + continue } else if k == "bto" { continue } else if k == "cc" { @@ -578,6 +586,11 @@ func (this ActivityStreamsAudio) GetJSONLDType() vocab.JSONLDTypeProperty { return this.JSONLDType } +// GetTootBlurhash returns the "blurhash" property if it exists, and nil otherwise. +func (this ActivityStreamsAudio) GetTootBlurhash() vocab.TootBlurhashProperty { + return this.TootBlurhash +} + // GetTypeName returns the name of this type. func (this ActivityStreamsAudio) GetTypeName() string { return "Audio" @@ -608,6 +621,7 @@ func (this ActivityStreamsAudio) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) m = this.helperJSONLDContext(this.ActivityStreamsBcc, m) + m = this.helperJSONLDContext(this.TootBlurhash, m) m = this.helperJSONLDContext(this.ActivityStreamsBto, m) m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) @@ -713,6 +727,20 @@ func (this ActivityStreamsAudio) LessThan(o vocab.ActivityStreamsAudio) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "blurhash" + if lhs, rhs := this.TootBlurhash, o.GetTootBlurhash(); 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 "bto" if lhs, rhs := this.ActivityStreamsBto, o.GetActivityStreamsBto(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1154,6 +1182,14 @@ func (this ActivityStreamsAudio) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsBcc.Name()] = i } } + // Maybe serialize property "blurhash" + if this.TootBlurhash != nil { + if i, err := this.TootBlurhash.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootBlurhash.Name()] = i + } + } // Maybe serialize property "bto" if this.ActivityStreamsBto != nil { if i, err := this.ActivityStreamsBto.Serialize(); err != nil { @@ -1544,6 +1580,11 @@ func (this *ActivityStreamsAudio) SetJSONLDType(i vocab.JSONLDTypeProperty) { this.JSONLDType = i } +// SetTootBlurhash sets the "blurhash" property. +func (this *ActivityStreamsAudio) SetTootBlurhash(i vocab.TootBlurhashProperty) { + this.TootBlurhash = i +} + // VocabularyURI returns the vocabulary's URI as a string. func (this ActivityStreamsAudio) VocabularyURI() string { return "https://www.w3.org/ns/activitystreams" diff --git a/streams/impl/activitystreams/type_document/gen_pkg.go b/streams/impl/activitystreams/type_document/gen_pkg.go index 21b334e..43c50f3 100644 --- a/streams/impl/activitystreams/type_document/gen_pkg.go +++ b/streams/impl/activitystreams/type_document/gen_pkg.go @@ -32,6 +32,10 @@ type privateManager interface { // method for the "ActivityStreamsBccProperty" non-functional property // in the vocabulary "ActivityStreams" DeserializeBccPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBccProperty, error) + // DeserializeBlurhashPropertyToot returns the deserialization method for + // the "TootBlurhashProperty" non-functional property in the + // vocabulary "Toot" + DeserializeBlurhashPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootBlurhashProperty, error) // DeserializeBtoPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsBtoProperty" non-functional property // in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_document/gen_type_activitystreams_document.go b/streams/impl/activitystreams/type_document/gen_type_activitystreams_document.go index 9cf79fa..2596149 100644 --- a/streams/impl/activitystreams/type_document/gen_type_activitystreams_document.go +++ b/streams/impl/activitystreams/type_document/gen_type_activitystreams_document.go @@ -22,6 +22,7 @@ type ActivityStreamsDocument struct { ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty ActivityStreamsBcc vocab.ActivityStreamsBccProperty + TootBlurhash vocab.TootBlurhashProperty ActivityStreamsBto vocab.ActivityStreamsBtoProperty ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty @@ -127,6 +128,11 @@ func DeserializeDocument(m map[string]interface{}, aliasMap map[string]string) ( } else if p != nil { this.ActivityStreamsBcc = p } + if p, err := mgr.DeserializeBlurhashPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootBlurhash = p + } if p, err := mgr.DeserializeBtoPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -277,6 +283,8 @@ func DeserializeDocument(m map[string]interface{}, aliasMap map[string]string) ( continue } else if k == "bcc" { continue + } else if k == "blurhash" { + continue } else if k == "bto" { continue } else if k == "cc" { @@ -579,6 +587,11 @@ func (this ActivityStreamsDocument) GetJSONLDType() vocab.JSONLDTypeProperty { return this.JSONLDType } +// GetTootBlurhash returns the "blurhash" property if it exists, and nil otherwise. +func (this ActivityStreamsDocument) GetTootBlurhash() vocab.TootBlurhashProperty { + return this.TootBlurhash +} + // GetTypeName returns the name of this type. func (this ActivityStreamsDocument) GetTypeName() string { return "Document" @@ -609,6 +622,7 @@ func (this ActivityStreamsDocument) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) m = this.helperJSONLDContext(this.ActivityStreamsBcc, m) + m = this.helperJSONLDContext(this.TootBlurhash, m) m = this.helperJSONLDContext(this.ActivityStreamsBto, m) m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) @@ -714,6 +728,20 @@ func (this ActivityStreamsDocument) LessThan(o vocab.ActivityStreamsDocument) bo // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "blurhash" + if lhs, rhs := this.TootBlurhash, o.GetTootBlurhash(); 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 "bto" if lhs, rhs := this.ActivityStreamsBto, o.GetActivityStreamsBto(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1155,6 +1183,14 @@ func (this ActivityStreamsDocument) Serialize() (map[string]interface{}, error) m[this.ActivityStreamsBcc.Name()] = i } } + // Maybe serialize property "blurhash" + if this.TootBlurhash != nil { + if i, err := this.TootBlurhash.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootBlurhash.Name()] = i + } + } // Maybe serialize property "bto" if this.ActivityStreamsBto != nil { if i, err := this.ActivityStreamsBto.Serialize(); err != nil { @@ -1545,6 +1581,11 @@ func (this *ActivityStreamsDocument) SetJSONLDType(i vocab.JSONLDTypeProperty) { this.JSONLDType = i } +// SetTootBlurhash sets the "blurhash" property. +func (this *ActivityStreamsDocument) SetTootBlurhash(i vocab.TootBlurhashProperty) { + this.TootBlurhash = i +} + // VocabularyURI returns the vocabulary's URI as a string. func (this ActivityStreamsDocument) VocabularyURI() string { return "https://www.w3.org/ns/activitystreams" diff --git a/streams/impl/activitystreams/type_group/gen_pkg.go b/streams/impl/activitystreams/type_group/gen_pkg.go index 73acfd9..1bcaccc 100644 --- a/streams/impl/activitystreams/type_group/gen_pkg.go +++ b/streams/impl/activitystreams/type_group/gen_pkg.go @@ -48,6 +48,10 @@ type privateManager interface { // method for the "ActivityStreamsContextProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeContextPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContextProperty, error) + // DeserializeDiscoverablePropertyToot returns the deserialization method + // for the "TootDiscoverableProperty" non-functional property in the + // vocabulary "Toot" + DeserializeDiscoverablePropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootDiscoverableProperty, error) // DeserializeDurationPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsDurationProperty" non-functional // property in the vocabulary "ActivityStreams" @@ -56,6 +60,10 @@ type privateManager interface { // method for the "ActivityStreamsEndTimeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeEndTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndTimeProperty, error) + // DeserializeFeaturedPropertyToot returns the deserialization method for + // the "TootFeaturedProperty" non-functional property in the + // vocabulary "Toot" + DeserializeFeaturedPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootFeaturedProperty, error) // DeserializeFollowersPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsFollowersProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_group/gen_type_activitystreams_group.go b/streams/impl/activitystreams/type_group/gen_type_activitystreams_group.go index 91a7f85..f062f03 100644 --- a/streams/impl/activitystreams/type_group/gen_type_activitystreams_group.go +++ b/streams/impl/activitystreams/type_group/gen_type_activitystreams_group.go @@ -25,8 +25,10 @@ type ActivityStreamsGroup struct { ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty ActivityStreamsContext vocab.ActivityStreamsContextProperty + TootDiscoverable vocab.TootDiscoverableProperty ActivityStreamsDuration vocab.ActivityStreamsDurationProperty ActivityStreamsEndTime vocab.ActivityStreamsEndTimeProperty + TootFeatured vocab.TootFeaturedProperty ActivityStreamsFollowers vocab.ActivityStreamsFollowersProperty ActivityStreamsFollowing vocab.ActivityStreamsFollowingProperty ActivityStreamsGenerator vocab.ActivityStreamsGeneratorProperty @@ -154,6 +156,11 @@ func DeserializeGroup(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsContext = p } + if p, err := mgr.DeserializeDiscoverablePropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootDiscoverable = p + } if p, err := mgr.DeserializeDurationPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -164,6 +171,11 @@ func DeserializeGroup(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsEndTime = p } + if p, err := mgr.DeserializeFeaturedPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootFeatured = p + } if p, err := mgr.DeserializeFollowersPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -334,10 +346,14 @@ func DeserializeGroup(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "context" { continue + } else if k == "discoverable" { + continue } else if k == "duration" { continue } else if k == "endTime" { continue + } else if k == "featured" { + continue } else if k == "followers" { continue } else if k == "following" { @@ -681,6 +697,17 @@ func (this ActivityStreamsGroup) GetJSONLDType() vocab.JSONLDTypeProperty { return this.JSONLDType } +// GetTootDiscoverable returns the "discoverable" property if it exists, and nil +// otherwise. +func (this ActivityStreamsGroup) GetTootDiscoverable() vocab.TootDiscoverableProperty { + return this.TootDiscoverable +} + +// GetTootFeatured returns the "featured" property if it exists, and nil otherwise. +func (this ActivityStreamsGroup) GetTootFeatured() vocab.TootFeaturedProperty { + return this.TootFeatured +} + // GetTypeName returns the name of this type. func (this ActivityStreamsGroup) GetTypeName() string { return "Group" @@ -721,8 +748,10 @@ func (this ActivityStreamsGroup) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) m = this.helperJSONLDContext(this.ActivityStreamsContext, m) + m = this.helperJSONLDContext(this.TootDiscoverable, m) m = this.helperJSONLDContext(this.ActivityStreamsDuration, m) m = this.helperJSONLDContext(this.ActivityStreamsEndTime, m) + m = this.helperJSONLDContext(this.TootFeatured, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowers, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowing, m) m = this.helperJSONLDContext(this.ActivityStreamsGenerator, m) @@ -886,6 +915,20 @@ func (this ActivityStreamsGroup) LessThan(o vocab.ActivityStreamsGroup) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "discoverable" + if lhs, rhs := this.TootDiscoverable, o.GetTootDiscoverable(); 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 "duration" if lhs, rhs := this.ActivityStreamsDuration, o.GetActivityStreamsDuration(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -914,6 +957,20 @@ func (this ActivityStreamsGroup) LessThan(o vocab.ActivityStreamsGroup) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "featured" + if lhs, rhs := this.TootFeatured, o.GetTootFeatured(); 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 "followers" if lhs, rhs := this.ActivityStreamsFollowers, o.GetActivityStreamsFollowers(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1415,6 +1472,14 @@ func (this ActivityStreamsGroup) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsContext.Name()] = i } } + // Maybe serialize property "discoverable" + if this.TootDiscoverable != nil { + if i, err := this.TootDiscoverable.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootDiscoverable.Name()] = i + } + } // Maybe serialize property "duration" if this.ActivityStreamsDuration != nil { if i, err := this.ActivityStreamsDuration.Serialize(); err != nil { @@ -1431,6 +1496,14 @@ func (this ActivityStreamsGroup) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsEndTime.Name()] = i } } + // Maybe serialize property "featured" + if this.TootFeatured != nil { + if i, err := this.TootFeatured.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootFeatured.Name()] = i + } + } // Maybe serialize property "followers" if this.ActivityStreamsFollowers != nil { if i, err := this.ActivityStreamsFollowers.Serialize(); err != nil { @@ -1872,6 +1945,16 @@ func (this *ActivityStreamsGroup) SetJSONLDType(i vocab.JSONLDTypeProperty) { this.JSONLDType = i } +// SetTootDiscoverable sets the "discoverable" property. +func (this *ActivityStreamsGroup) SetTootDiscoverable(i vocab.TootDiscoverableProperty) { + this.TootDiscoverable = i +} + +// SetTootFeatured sets the "featured" property. +func (this *ActivityStreamsGroup) SetTootFeatured(i vocab.TootFeaturedProperty) { + this.TootFeatured = i +} + // SetW3IDSecurityV1PublicKey sets the "publicKey" property. func (this *ActivityStreamsGroup) SetW3IDSecurityV1PublicKey(i vocab.W3IDSecurityV1PublicKeyProperty) { this.W3IDSecurityV1PublicKey = i diff --git a/streams/impl/activitystreams/type_image/gen_pkg.go b/streams/impl/activitystreams/type_image/gen_pkg.go index 62af85e..11c7737 100644 --- a/streams/impl/activitystreams/type_image/gen_pkg.go +++ b/streams/impl/activitystreams/type_image/gen_pkg.go @@ -32,6 +32,10 @@ type privateManager interface { // method for the "ActivityStreamsBccProperty" non-functional property // in the vocabulary "ActivityStreams" DeserializeBccPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBccProperty, error) + // DeserializeBlurhashPropertyToot returns the deserialization method for + // the "TootBlurhashProperty" non-functional property in the + // vocabulary "Toot" + DeserializeBlurhashPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootBlurhashProperty, error) // DeserializeBtoPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsBtoProperty" non-functional property // in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_image/gen_type_activitystreams_image.go b/streams/impl/activitystreams/type_image/gen_type_activitystreams_image.go index 8af3169..98fdbbb 100644 --- a/streams/impl/activitystreams/type_image/gen_type_activitystreams_image.go +++ b/streams/impl/activitystreams/type_image/gen_type_activitystreams_image.go @@ -33,6 +33,7 @@ type ActivityStreamsImage struct { ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty ActivityStreamsBcc vocab.ActivityStreamsBccProperty + TootBlurhash vocab.TootBlurhashProperty ActivityStreamsBto vocab.ActivityStreamsBtoProperty ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty @@ -140,6 +141,11 @@ func DeserializeImage(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsBcc = p } + if p, err := mgr.DeserializeBlurhashPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootBlurhash = p + } if p, err := mgr.DeserializeBtoPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -300,6 +306,8 @@ func DeserializeImage(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "bcc" { continue + } else if k == "blurhash" { + continue } else if k == "bto" { continue } else if k == "cc" { @@ -613,6 +621,11 @@ func (this ActivityStreamsImage) GetJSONLDType() vocab.JSONLDTypeProperty { return this.JSONLDType } +// GetTootBlurhash returns the "blurhash" property if it exists, and nil otherwise. +func (this ActivityStreamsImage) GetTootBlurhash() vocab.TootBlurhashProperty { + return this.TootBlurhash +} + // GetTypeName returns the name of this type. func (this ActivityStreamsImage) GetTypeName() string { return "Image" @@ -643,6 +656,7 @@ func (this ActivityStreamsImage) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) m = this.helperJSONLDContext(this.ActivityStreamsBcc, m) + m = this.helperJSONLDContext(this.TootBlurhash, m) m = this.helperJSONLDContext(this.ActivityStreamsBto, m) m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) @@ -750,6 +764,20 @@ func (this ActivityStreamsImage) LessThan(o vocab.ActivityStreamsImage) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "blurhash" + if lhs, rhs := this.TootBlurhash, o.GetTootBlurhash(); 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 "bto" if lhs, rhs := this.ActivityStreamsBto, o.GetActivityStreamsBto(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1219,6 +1247,14 @@ func (this ActivityStreamsImage) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsBcc.Name()] = i } } + // Maybe serialize property "blurhash" + if this.TootBlurhash != nil { + if i, err := this.TootBlurhash.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootBlurhash.Name()] = i + } + } // Maybe serialize property "bto" if this.ActivityStreamsBto != nil { if i, err := this.ActivityStreamsBto.Serialize(); err != nil { @@ -1635,6 +1671,11 @@ func (this *ActivityStreamsImage) SetJSONLDType(i vocab.JSONLDTypeProperty) { this.JSONLDType = i } +// SetTootBlurhash sets the "blurhash" property. +func (this *ActivityStreamsImage) SetTootBlurhash(i vocab.TootBlurhashProperty) { + this.TootBlurhash = i +} + // VocabularyURI returns the vocabulary's URI as a string. func (this ActivityStreamsImage) VocabularyURI() string { return "https://www.w3.org/ns/activitystreams" diff --git a/streams/impl/activitystreams/type_link/gen_type_activitystreams_link.go b/streams/impl/activitystreams/type_link/gen_type_activitystreams_link.go index de05868..dc5e2ba 100644 --- a/streams/impl/activitystreams/type_link/gen_type_activitystreams_link.go +++ b/streams/impl/activitystreams/type_link/gen_type_activitystreams_link.go @@ -199,7 +199,7 @@ func IsOrExtendsLink(other vocab.Type) bool { // LinkIsDisjointWith returns true if the other provided type is disjoint with the // Link type. func LinkIsDisjointWith(other vocab.Type) bool { - disjointWith := []string{"Accept", "Activity", "Add", "Announce", "Application", "Arrive", "Article", "Audio", "Block", "Collection", "CollectionPage", "Create", "Delete", "Dislike", "Document", "Event", "Flag", "Follow", "Group", "Ignore", "Image", "IntransitiveActivity", "Invite", "Join", "Leave", "Like", "Listen", "Move", "Note", "Object", "Offer", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage", "Organization", "Page", "Person", "Place", "Profile", "Question", "Read", "Reject", "Relationship", "Remove", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Travel", "Undo", "Update", "Video", "View"} + 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", "Question", "Read", "Reject", "Relationship", "Remove", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Travel", "Undo", "Update", "Video", "View"} for _, disjoint := range disjointWith { if disjoint == other.GetTypeName() { return true diff --git a/streams/impl/activitystreams/type_mention/gen_type_activitystreams_mention.go b/streams/impl/activitystreams/type_mention/gen_type_activitystreams_mention.go index 46ee824..47218be 100644 --- a/streams/impl/activitystreams/type_mention/gen_type_activitystreams_mention.go +++ b/streams/impl/activitystreams/type_mention/gen_type_activitystreams_mention.go @@ -197,7 +197,7 @@ func IsOrExtendsMention(other vocab.Type) bool { // MentionIsDisjointWith returns true if the other provided type is disjoint with // the Mention type. func MentionIsDisjointWith(other vocab.Type) bool { - disjointWith := []string{"Accept", "Activity", "Add", "Announce", "Application", "Arrive", "Article", "Audio", "Block", "Collection", "CollectionPage", "Create", "Delete", "Dislike", "Document", "Event", "Flag", "Follow", "Group", "Ignore", "Image", "IntransitiveActivity", "Invite", "Join", "Leave", "Like", "Listen", "Move", "Note", "Object", "Offer", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage", "Organization", "Page", "Person", "Place", "Profile", "Question", "Read", "Reject", "Relationship", "Remove", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Travel", "Undo", "Update", "Video", "View"} + 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", "Question", "Read", "Reject", "Relationship", "Remove", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Travel", "Undo", "Update", "Video", "View"} for _, disjoint := range disjointWith { if disjoint == other.GetTypeName() { return true diff --git a/streams/impl/activitystreams/type_object/gen_type_activitystreams_object.go b/streams/impl/activitystreams/type_object/gen_type_activitystreams_object.go index ce7865b..6d54711 100644 --- a/streams/impl/activitystreams/type_object/gen_type_activitystreams_object.go +++ b/streams/impl/activitystreams/type_object/gen_type_activitystreams_object.go @@ -380,7 +380,7 @@ func ObjectIsDisjointWith(other vocab.Type) bool { // Object type. Note that it returns false if the types are the same; see the // "IsOrExtendsObject" variant instead. func ObjectIsExtendedBy(other vocab.Type) bool { - extensions := []string{"Accept", "Activity", "Add", "Announce", "Application", "Arrive", "Article", "Audio", "Block", "Collection", "CollectionPage", "Create", "Delete", "Dislike", "Document", "Event", "Flag", "Follow", "Group", "Ignore", "Image", "IntransitiveActivity", "Invite", "Join", "Leave", "Like", "Listen", "Move", "Note", "Offer", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage", "Organization", "Page", "Person", "Place", "Profile", "Question", "Read", "Reject", "Relationship", "Remove", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Travel", "Undo", "Update", "Video", "View"} + extensions := []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", "Offer", "OrderedCollection", "OrderedCollectionPage", "OrderedCollectionPage", "Organization", "Page", "Person", "Place", "Profile", "Question", "Read", "Reject", "Relationship", "Remove", "Service", "TentativeAccept", "TentativeReject", "Tombstone", "Travel", "Undo", "Update", "Video", "View"} for _, ext := range extensions { if ext == other.GetTypeName() { return true diff --git a/streams/impl/activitystreams/type_organization/gen_pkg.go b/streams/impl/activitystreams/type_organization/gen_pkg.go index 8b85ff5..c4b9990 100644 --- a/streams/impl/activitystreams/type_organization/gen_pkg.go +++ b/streams/impl/activitystreams/type_organization/gen_pkg.go @@ -48,6 +48,10 @@ type privateManager interface { // method for the "ActivityStreamsContextProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeContextPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContextProperty, error) + // DeserializeDiscoverablePropertyToot returns the deserialization method + // for the "TootDiscoverableProperty" non-functional property in the + // vocabulary "Toot" + DeserializeDiscoverablePropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootDiscoverableProperty, error) // DeserializeDurationPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsDurationProperty" non-functional // property in the vocabulary "ActivityStreams" @@ -56,6 +60,10 @@ type privateManager interface { // method for the "ActivityStreamsEndTimeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeEndTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndTimeProperty, error) + // DeserializeFeaturedPropertyToot returns the deserialization method for + // the "TootFeaturedProperty" non-functional property in the + // vocabulary "Toot" + DeserializeFeaturedPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootFeaturedProperty, error) // DeserializeFollowersPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsFollowersProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_organization/gen_type_activitystreams_organization.go b/streams/impl/activitystreams/type_organization/gen_type_activitystreams_organization.go index 70ffc4b..2de86d3 100644 --- a/streams/impl/activitystreams/type_organization/gen_type_activitystreams_organization.go +++ b/streams/impl/activitystreams/type_organization/gen_type_activitystreams_organization.go @@ -25,8 +25,10 @@ type ActivityStreamsOrganization struct { ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty ActivityStreamsContext vocab.ActivityStreamsContextProperty + TootDiscoverable vocab.TootDiscoverableProperty ActivityStreamsDuration vocab.ActivityStreamsDurationProperty ActivityStreamsEndTime vocab.ActivityStreamsEndTimeProperty + TootFeatured vocab.TootFeaturedProperty ActivityStreamsFollowers vocab.ActivityStreamsFollowersProperty ActivityStreamsFollowing vocab.ActivityStreamsFollowingProperty ActivityStreamsGenerator vocab.ActivityStreamsGeneratorProperty @@ -154,6 +156,11 @@ func DeserializeOrganization(m map[string]interface{}, aliasMap map[string]strin } else if p != nil { this.ActivityStreamsContext = p } + if p, err := mgr.DeserializeDiscoverablePropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootDiscoverable = p + } if p, err := mgr.DeserializeDurationPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -164,6 +171,11 @@ func DeserializeOrganization(m map[string]interface{}, aliasMap map[string]strin } else if p != nil { this.ActivityStreamsEndTime = p } + if p, err := mgr.DeserializeFeaturedPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootFeatured = p + } if p, err := mgr.DeserializeFollowersPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -334,10 +346,14 @@ func DeserializeOrganization(m map[string]interface{}, aliasMap map[string]strin continue } else if k == "context" { continue + } else if k == "discoverable" { + continue } else if k == "duration" { continue } else if k == "endTime" { continue + } else if k == "featured" { + continue } else if k == "followers" { continue } else if k == "following" { @@ -681,6 +697,17 @@ func (this ActivityStreamsOrganization) GetJSONLDType() vocab.JSONLDTypeProperty return this.JSONLDType } +// GetTootDiscoverable returns the "discoverable" property if it exists, and nil +// otherwise. +func (this ActivityStreamsOrganization) GetTootDiscoverable() vocab.TootDiscoverableProperty { + return this.TootDiscoverable +} + +// GetTootFeatured returns the "featured" property if it exists, and nil otherwise. +func (this ActivityStreamsOrganization) GetTootFeatured() vocab.TootFeaturedProperty { + return this.TootFeatured +} + // GetTypeName returns the name of this type. func (this ActivityStreamsOrganization) GetTypeName() string { return "Organization" @@ -721,8 +748,10 @@ func (this ActivityStreamsOrganization) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) m = this.helperJSONLDContext(this.ActivityStreamsContext, m) + m = this.helperJSONLDContext(this.TootDiscoverable, m) m = this.helperJSONLDContext(this.ActivityStreamsDuration, m) m = this.helperJSONLDContext(this.ActivityStreamsEndTime, m) + m = this.helperJSONLDContext(this.TootFeatured, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowers, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowing, m) m = this.helperJSONLDContext(this.ActivityStreamsGenerator, m) @@ -886,6 +915,20 @@ func (this ActivityStreamsOrganization) LessThan(o vocab.ActivityStreamsOrganiza // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "discoverable" + if lhs, rhs := this.TootDiscoverable, o.GetTootDiscoverable(); 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 "duration" if lhs, rhs := this.ActivityStreamsDuration, o.GetActivityStreamsDuration(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -914,6 +957,20 @@ func (this ActivityStreamsOrganization) LessThan(o vocab.ActivityStreamsOrganiza // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "featured" + if lhs, rhs := this.TootFeatured, o.GetTootFeatured(); 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 "followers" if lhs, rhs := this.ActivityStreamsFollowers, o.GetActivityStreamsFollowers(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1415,6 +1472,14 @@ func (this ActivityStreamsOrganization) Serialize() (map[string]interface{}, err m[this.ActivityStreamsContext.Name()] = i } } + // Maybe serialize property "discoverable" + if this.TootDiscoverable != nil { + if i, err := this.TootDiscoverable.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootDiscoverable.Name()] = i + } + } // Maybe serialize property "duration" if this.ActivityStreamsDuration != nil { if i, err := this.ActivityStreamsDuration.Serialize(); err != nil { @@ -1431,6 +1496,14 @@ func (this ActivityStreamsOrganization) Serialize() (map[string]interface{}, err m[this.ActivityStreamsEndTime.Name()] = i } } + // Maybe serialize property "featured" + if this.TootFeatured != nil { + if i, err := this.TootFeatured.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootFeatured.Name()] = i + } + } // Maybe serialize property "followers" if this.ActivityStreamsFollowers != nil { if i, err := this.ActivityStreamsFollowers.Serialize(); err != nil { @@ -1872,6 +1945,16 @@ func (this *ActivityStreamsOrganization) SetJSONLDType(i vocab.JSONLDTypePropert this.JSONLDType = i } +// SetTootDiscoverable sets the "discoverable" property. +func (this *ActivityStreamsOrganization) SetTootDiscoverable(i vocab.TootDiscoverableProperty) { + this.TootDiscoverable = i +} + +// SetTootFeatured sets the "featured" property. +func (this *ActivityStreamsOrganization) SetTootFeatured(i vocab.TootFeaturedProperty) { + this.TootFeatured = i +} + // SetW3IDSecurityV1PublicKey sets the "publicKey" property. func (this *ActivityStreamsOrganization) SetW3IDSecurityV1PublicKey(i vocab.W3IDSecurityV1PublicKeyProperty) { this.W3IDSecurityV1PublicKey = i diff --git a/streams/impl/activitystreams/type_page/gen_pkg.go b/streams/impl/activitystreams/type_page/gen_pkg.go index 7f4bcb8..4230e2d 100644 --- a/streams/impl/activitystreams/type_page/gen_pkg.go +++ b/streams/impl/activitystreams/type_page/gen_pkg.go @@ -32,6 +32,10 @@ type privateManager interface { // method for the "ActivityStreamsBccProperty" non-functional property // in the vocabulary "ActivityStreams" DeserializeBccPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBccProperty, error) + // DeserializeBlurhashPropertyToot returns the deserialization method for + // the "TootBlurhashProperty" non-functional property in the + // vocabulary "Toot" + DeserializeBlurhashPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootBlurhashProperty, error) // DeserializeBtoPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsBtoProperty" non-functional property // in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_page/gen_type_activitystreams_page.go b/streams/impl/activitystreams/type_page/gen_type_activitystreams_page.go index 8c63a51..fe40a3f 100644 --- a/streams/impl/activitystreams/type_page/gen_type_activitystreams_page.go +++ b/streams/impl/activitystreams/type_page/gen_type_activitystreams_page.go @@ -22,6 +22,7 @@ type ActivityStreamsPage struct { ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty ActivityStreamsBcc vocab.ActivityStreamsBccProperty + TootBlurhash vocab.TootBlurhashProperty ActivityStreamsBto vocab.ActivityStreamsBtoProperty ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty @@ -127,6 +128,11 @@ func DeserializePage(m map[string]interface{}, aliasMap map[string]string) (*Act } else if p != nil { this.ActivityStreamsBcc = p } + if p, err := mgr.DeserializeBlurhashPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootBlurhash = p + } if p, err := mgr.DeserializeBtoPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -277,6 +283,8 @@ func DeserializePage(m map[string]interface{}, aliasMap map[string]string) (*Act continue } else if k == "bcc" { continue + } else if k == "blurhash" { + continue } else if k == "bto" { continue } else if k == "cc" { @@ -574,6 +582,11 @@ func (this ActivityStreamsPage) GetJSONLDType() vocab.JSONLDTypeProperty { return this.JSONLDType } +// GetTootBlurhash returns the "blurhash" property if it exists, and nil otherwise. +func (this ActivityStreamsPage) GetTootBlurhash() vocab.TootBlurhashProperty { + return this.TootBlurhash +} + // GetTypeName returns the name of this type. func (this ActivityStreamsPage) GetTypeName() string { return "Page" @@ -604,6 +617,7 @@ func (this ActivityStreamsPage) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) m = this.helperJSONLDContext(this.ActivityStreamsBcc, m) + m = this.helperJSONLDContext(this.TootBlurhash, m) m = this.helperJSONLDContext(this.ActivityStreamsBto, m) m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) @@ -709,6 +723,20 @@ func (this ActivityStreamsPage) LessThan(o vocab.ActivityStreamsPage) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "blurhash" + if lhs, rhs := this.TootBlurhash, o.GetTootBlurhash(); 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 "bto" if lhs, rhs := this.ActivityStreamsBto, o.GetActivityStreamsBto(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1150,6 +1178,14 @@ func (this ActivityStreamsPage) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsBcc.Name()] = i } } + // Maybe serialize property "blurhash" + if this.TootBlurhash != nil { + if i, err := this.TootBlurhash.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootBlurhash.Name()] = i + } + } // Maybe serialize property "bto" if this.ActivityStreamsBto != nil { if i, err := this.ActivityStreamsBto.Serialize(); err != nil { @@ -1540,6 +1576,11 @@ func (this *ActivityStreamsPage) SetJSONLDType(i vocab.JSONLDTypeProperty) { this.JSONLDType = i } +// SetTootBlurhash sets the "blurhash" property. +func (this *ActivityStreamsPage) SetTootBlurhash(i vocab.TootBlurhashProperty) { + this.TootBlurhash = i +} + // VocabularyURI returns the vocabulary's URI as a string. func (this ActivityStreamsPage) VocabularyURI() string { return "https://www.w3.org/ns/activitystreams" diff --git a/streams/impl/activitystreams/type_person/gen_pkg.go b/streams/impl/activitystreams/type_person/gen_pkg.go index 75c3cae..3328b03 100644 --- a/streams/impl/activitystreams/type_person/gen_pkg.go +++ b/streams/impl/activitystreams/type_person/gen_pkg.go @@ -48,6 +48,10 @@ type privateManager interface { // method for the "ActivityStreamsContextProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeContextPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContextProperty, error) + // DeserializeDiscoverablePropertyToot returns the deserialization method + // for the "TootDiscoverableProperty" non-functional property in the + // vocabulary "Toot" + DeserializeDiscoverablePropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootDiscoverableProperty, error) // DeserializeDurationPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsDurationProperty" non-functional // property in the vocabulary "ActivityStreams" @@ -56,6 +60,10 @@ type privateManager interface { // method for the "ActivityStreamsEndTimeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeEndTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndTimeProperty, error) + // DeserializeFeaturedPropertyToot returns the deserialization method for + // the "TootFeaturedProperty" non-functional property in the + // vocabulary "Toot" + DeserializeFeaturedPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootFeaturedProperty, error) // DeserializeFollowersPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsFollowersProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_person/gen_type_activitystreams_person.go b/streams/impl/activitystreams/type_person/gen_type_activitystreams_person.go index de94a19..2c46db1 100644 --- a/streams/impl/activitystreams/type_person/gen_type_activitystreams_person.go +++ b/streams/impl/activitystreams/type_person/gen_type_activitystreams_person.go @@ -25,8 +25,10 @@ type ActivityStreamsPerson struct { ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty ActivityStreamsContext vocab.ActivityStreamsContextProperty + TootDiscoverable vocab.TootDiscoverableProperty ActivityStreamsDuration vocab.ActivityStreamsDurationProperty ActivityStreamsEndTime vocab.ActivityStreamsEndTimeProperty + TootFeatured vocab.TootFeaturedProperty ActivityStreamsFollowers vocab.ActivityStreamsFollowersProperty ActivityStreamsFollowing vocab.ActivityStreamsFollowingProperty ActivityStreamsGenerator vocab.ActivityStreamsGeneratorProperty @@ -154,6 +156,11 @@ func DeserializePerson(m map[string]interface{}, aliasMap map[string]string) (*A } else if p != nil { this.ActivityStreamsContext = p } + if p, err := mgr.DeserializeDiscoverablePropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootDiscoverable = p + } if p, err := mgr.DeserializeDurationPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -164,6 +171,11 @@ func DeserializePerson(m map[string]interface{}, aliasMap map[string]string) (*A } else if p != nil { this.ActivityStreamsEndTime = p } + if p, err := mgr.DeserializeFeaturedPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootFeatured = p + } if p, err := mgr.DeserializeFollowersPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -334,10 +346,14 @@ func DeserializePerson(m map[string]interface{}, aliasMap map[string]string) (*A continue } else if k == "context" { continue + } else if k == "discoverable" { + continue } else if k == "duration" { continue } else if k == "endTime" { continue + } else if k == "featured" { + continue } else if k == "followers" { continue } else if k == "following" { @@ -681,6 +697,17 @@ func (this ActivityStreamsPerson) GetJSONLDType() vocab.JSONLDTypeProperty { return this.JSONLDType } +// GetTootDiscoverable returns the "discoverable" property if it exists, and nil +// otherwise. +func (this ActivityStreamsPerson) GetTootDiscoverable() vocab.TootDiscoverableProperty { + return this.TootDiscoverable +} + +// GetTootFeatured returns the "featured" property if it exists, and nil otherwise. +func (this ActivityStreamsPerson) GetTootFeatured() vocab.TootFeaturedProperty { + return this.TootFeatured +} + // GetTypeName returns the name of this type. func (this ActivityStreamsPerson) GetTypeName() string { return "Person" @@ -721,8 +748,10 @@ func (this ActivityStreamsPerson) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) m = this.helperJSONLDContext(this.ActivityStreamsContext, m) + m = this.helperJSONLDContext(this.TootDiscoverable, m) m = this.helperJSONLDContext(this.ActivityStreamsDuration, m) m = this.helperJSONLDContext(this.ActivityStreamsEndTime, m) + m = this.helperJSONLDContext(this.TootFeatured, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowers, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowing, m) m = this.helperJSONLDContext(this.ActivityStreamsGenerator, m) @@ -886,6 +915,20 @@ func (this ActivityStreamsPerson) LessThan(o vocab.ActivityStreamsPerson) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "discoverable" + if lhs, rhs := this.TootDiscoverable, o.GetTootDiscoverable(); 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 "duration" if lhs, rhs := this.ActivityStreamsDuration, o.GetActivityStreamsDuration(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -914,6 +957,20 @@ func (this ActivityStreamsPerson) LessThan(o vocab.ActivityStreamsPerson) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "featured" + if lhs, rhs := this.TootFeatured, o.GetTootFeatured(); 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 "followers" if lhs, rhs := this.ActivityStreamsFollowers, o.GetActivityStreamsFollowers(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1415,6 +1472,14 @@ func (this ActivityStreamsPerson) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsContext.Name()] = i } } + // Maybe serialize property "discoverable" + if this.TootDiscoverable != nil { + if i, err := this.TootDiscoverable.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootDiscoverable.Name()] = i + } + } // Maybe serialize property "duration" if this.ActivityStreamsDuration != nil { if i, err := this.ActivityStreamsDuration.Serialize(); err != nil { @@ -1431,6 +1496,14 @@ func (this ActivityStreamsPerson) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsEndTime.Name()] = i } } + // Maybe serialize property "featured" + if this.TootFeatured != nil { + if i, err := this.TootFeatured.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootFeatured.Name()] = i + } + } // Maybe serialize property "followers" if this.ActivityStreamsFollowers != nil { if i, err := this.ActivityStreamsFollowers.Serialize(); err != nil { @@ -1872,6 +1945,16 @@ func (this *ActivityStreamsPerson) SetJSONLDType(i vocab.JSONLDTypeProperty) { this.JSONLDType = i } +// SetTootDiscoverable sets the "discoverable" property. +func (this *ActivityStreamsPerson) SetTootDiscoverable(i vocab.TootDiscoverableProperty) { + this.TootDiscoverable = i +} + +// SetTootFeatured sets the "featured" property. +func (this *ActivityStreamsPerson) SetTootFeatured(i vocab.TootFeaturedProperty) { + this.TootFeatured = i +} + // SetW3IDSecurityV1PublicKey sets the "publicKey" property. func (this *ActivityStreamsPerson) SetW3IDSecurityV1PublicKey(i vocab.W3IDSecurityV1PublicKeyProperty) { this.W3IDSecurityV1PublicKey = i diff --git a/streams/impl/activitystreams/type_question/gen_pkg.go b/streams/impl/activitystreams/type_question/gen_pkg.go index 068dcb6..e89d2f8 100644 --- a/streams/impl/activitystreams/type_question/gen_pkg.go +++ b/streams/impl/activitystreams/type_question/gen_pkg.go @@ -168,6 +168,10 @@ type privateManager interface { // method for the "ActivityStreamsUrlProperty" non-functional property // in the vocabulary "ActivityStreams" DeserializeUrlPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUrlProperty, error) + // DeserializeVotersCountPropertyToot returns the deserialization method + // for the "TootVotersCountProperty" non-functional property in the + // vocabulary "Toot" + DeserializeVotersCountPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootVotersCountProperty, error) } // jsonldContexter is a private interface to determine the JSON-LD contexts and diff --git a/streams/impl/activitystreams/type_question/gen_type_activitystreams_question.go b/streams/impl/activitystreams/type_question/gen_type_activitystreams_question.go index 68b07b9..c17930f 100644 --- a/streams/impl/activitystreams/type_question/gen_type_activitystreams_question.go +++ b/streams/impl/activitystreams/type_question/gen_type_activitystreams_question.go @@ -77,6 +77,7 @@ type ActivityStreamsQuestion struct { JSONLDType vocab.JSONLDTypeProperty ActivityStreamsUpdated vocab.ActivityStreamsUpdatedProperty ActivityStreamsUrl vocab.ActivityStreamsUrlProperty + TootVotersCount vocab.TootVotersCountProperty alias string unknown map[string]interface{} } @@ -325,6 +326,11 @@ func DeserializeQuestion(m map[string]interface{}, aliasMap map[string]string) ( } else if p != nil { this.ActivityStreamsUrl = p } + if p, err := mgr.DeserializeVotersCountPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootVotersCount = p + } // End: Known property deserialization // Begin: Unknown deserialization @@ -414,6 +420,8 @@ func DeserializeQuestion(m map[string]interface{}, aliasMap map[string]string) ( continue } else if k == "url" { continue + } else if k == "votersCount" { + continue } // End: Code that ensures a property name is unknown this.unknown[k] = v @@ -693,6 +701,12 @@ func (this ActivityStreamsQuestion) GetJSONLDType() vocab.JSONLDTypeProperty { return this.JSONLDType } +// GetTootVotersCount returns the "votersCount" property if it exists, and nil +// otherwise. +func (this ActivityStreamsQuestion) GetTootVotersCount() vocab.TootVotersCountProperty { + return this.TootVotersCount +} + // GetTypeName returns the name of this type. func (this ActivityStreamsQuestion) GetTypeName() string { return "Question" @@ -757,6 +771,7 @@ func (this ActivityStreamsQuestion) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.JSONLDType, m) m = this.helperJSONLDContext(this.ActivityStreamsUpdated, m) m = this.helperJSONLDContext(this.ActivityStreamsUrl, m) + m = this.helperJSONLDContext(this.TootVotersCount, m) return m } @@ -1311,6 +1326,20 @@ func (this ActivityStreamsQuestion) LessThan(o vocab.ActivityStreamsQuestion) bo // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "votersCount" + if lhs, rhs := this.TootVotersCount, o.GetTootVotersCount(); 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) @@ -1646,6 +1675,14 @@ func (this ActivityStreamsQuestion) Serialize() (map[string]interface{}, error) m[this.ActivityStreamsUrl.Name()] = i } } + // Maybe serialize property "votersCount" + if this.TootVotersCount != nil { + if i, err := this.TootVotersCount.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootVotersCount.Name()] = i + } + } // End: Serialize known properties // Begin: Serialize unknown properties @@ -1855,6 +1892,11 @@ func (this *ActivityStreamsQuestion) SetJSONLDType(i vocab.JSONLDTypeProperty) { this.JSONLDType = i } +// SetTootVotersCount sets the "votersCount" property. +func (this *ActivityStreamsQuestion) SetTootVotersCount(i vocab.TootVotersCountProperty) { + this.TootVotersCount = i +} + // VocabularyURI returns the vocabulary's URI as a string. func (this ActivityStreamsQuestion) VocabularyURI() string { return "https://www.w3.org/ns/activitystreams" diff --git a/streams/impl/activitystreams/type_service/gen_pkg.go b/streams/impl/activitystreams/type_service/gen_pkg.go index 4c30d7a..e036aec 100644 --- a/streams/impl/activitystreams/type_service/gen_pkg.go +++ b/streams/impl/activitystreams/type_service/gen_pkg.go @@ -48,6 +48,10 @@ type privateManager interface { // method for the "ActivityStreamsContextProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeContextPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContextProperty, error) + // DeserializeDiscoverablePropertyToot returns the deserialization method + // for the "TootDiscoverableProperty" non-functional property in the + // vocabulary "Toot" + DeserializeDiscoverablePropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootDiscoverableProperty, error) // DeserializeDurationPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsDurationProperty" non-functional // property in the vocabulary "ActivityStreams" @@ -56,6 +60,10 @@ type privateManager interface { // method for the "ActivityStreamsEndTimeProperty" non-functional // property in the vocabulary "ActivityStreams" DeserializeEndTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndTimeProperty, error) + // DeserializeFeaturedPropertyToot returns the deserialization method for + // the "TootFeaturedProperty" non-functional property in the + // vocabulary "Toot" + DeserializeFeaturedPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootFeaturedProperty, error) // DeserializeFollowersPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsFollowersProperty" non-functional // property in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_service/gen_type_activitystreams_service.go b/streams/impl/activitystreams/type_service/gen_type_activitystreams_service.go index b6a1ebb..20b6f8e 100644 --- a/streams/impl/activitystreams/type_service/gen_type_activitystreams_service.go +++ b/streams/impl/activitystreams/type_service/gen_type_activitystreams_service.go @@ -25,8 +25,10 @@ type ActivityStreamsService struct { ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty ActivityStreamsContext vocab.ActivityStreamsContextProperty + TootDiscoverable vocab.TootDiscoverableProperty ActivityStreamsDuration vocab.ActivityStreamsDurationProperty ActivityStreamsEndTime vocab.ActivityStreamsEndTimeProperty + TootFeatured vocab.TootFeaturedProperty ActivityStreamsFollowers vocab.ActivityStreamsFollowersProperty ActivityStreamsFollowing vocab.ActivityStreamsFollowingProperty ActivityStreamsGenerator vocab.ActivityStreamsGeneratorProperty @@ -154,6 +156,11 @@ func DeserializeService(m map[string]interface{}, aliasMap map[string]string) (* } else if p != nil { this.ActivityStreamsContext = p } + if p, err := mgr.DeserializeDiscoverablePropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootDiscoverable = p + } if p, err := mgr.DeserializeDurationPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -164,6 +171,11 @@ func DeserializeService(m map[string]interface{}, aliasMap map[string]string) (* } else if p != nil { this.ActivityStreamsEndTime = p } + if p, err := mgr.DeserializeFeaturedPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootFeatured = p + } if p, err := mgr.DeserializeFollowersPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -334,10 +346,14 @@ func DeserializeService(m map[string]interface{}, aliasMap map[string]string) (* continue } else if k == "context" { continue + } else if k == "discoverable" { + continue } else if k == "duration" { continue } else if k == "endTime" { continue + } else if k == "featured" { + continue } else if k == "followers" { continue } else if k == "following" { @@ -681,6 +697,17 @@ func (this ActivityStreamsService) GetJSONLDType() vocab.JSONLDTypeProperty { return this.JSONLDType } +// GetTootDiscoverable returns the "discoverable" property if it exists, and nil +// otherwise. +func (this ActivityStreamsService) GetTootDiscoverable() vocab.TootDiscoverableProperty { + return this.TootDiscoverable +} + +// GetTootFeatured returns the "featured" property if it exists, and nil otherwise. +func (this ActivityStreamsService) GetTootFeatured() vocab.TootFeaturedProperty { + return this.TootFeatured +} + // GetTypeName returns the name of this type. func (this ActivityStreamsService) GetTypeName() string { return "Service" @@ -721,8 +748,10 @@ func (this ActivityStreamsService) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) m = this.helperJSONLDContext(this.ActivityStreamsContext, m) + m = this.helperJSONLDContext(this.TootDiscoverable, m) m = this.helperJSONLDContext(this.ActivityStreamsDuration, m) m = this.helperJSONLDContext(this.ActivityStreamsEndTime, m) + m = this.helperJSONLDContext(this.TootFeatured, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowers, m) m = this.helperJSONLDContext(this.ActivityStreamsFollowing, m) m = this.helperJSONLDContext(this.ActivityStreamsGenerator, m) @@ -886,6 +915,20 @@ func (this ActivityStreamsService) LessThan(o vocab.ActivityStreamsService) bool // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "discoverable" + if lhs, rhs := this.TootDiscoverable, o.GetTootDiscoverable(); 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 "duration" if lhs, rhs := this.ActivityStreamsDuration, o.GetActivityStreamsDuration(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -914,6 +957,20 @@ func (this ActivityStreamsService) LessThan(o vocab.ActivityStreamsService) bool // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "featured" + if lhs, rhs := this.TootFeatured, o.GetTootFeatured(); 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 "followers" if lhs, rhs := this.ActivityStreamsFollowers, o.GetActivityStreamsFollowers(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1415,6 +1472,14 @@ func (this ActivityStreamsService) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsContext.Name()] = i } } + // Maybe serialize property "discoverable" + if this.TootDiscoverable != nil { + if i, err := this.TootDiscoverable.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootDiscoverable.Name()] = i + } + } // Maybe serialize property "duration" if this.ActivityStreamsDuration != nil { if i, err := this.ActivityStreamsDuration.Serialize(); err != nil { @@ -1431,6 +1496,14 @@ func (this ActivityStreamsService) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsEndTime.Name()] = i } } + // Maybe serialize property "featured" + if this.TootFeatured != nil { + if i, err := this.TootFeatured.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootFeatured.Name()] = i + } + } // Maybe serialize property "followers" if this.ActivityStreamsFollowers != nil { if i, err := this.ActivityStreamsFollowers.Serialize(); err != nil { @@ -1872,6 +1945,16 @@ func (this *ActivityStreamsService) SetJSONLDType(i vocab.JSONLDTypeProperty) { this.JSONLDType = i } +// SetTootDiscoverable sets the "discoverable" property. +func (this *ActivityStreamsService) SetTootDiscoverable(i vocab.TootDiscoverableProperty) { + this.TootDiscoverable = i +} + +// SetTootFeatured sets the "featured" property. +func (this *ActivityStreamsService) SetTootFeatured(i vocab.TootFeaturedProperty) { + this.TootFeatured = i +} + // SetW3IDSecurityV1PublicKey sets the "publicKey" property. func (this *ActivityStreamsService) SetW3IDSecurityV1PublicKey(i vocab.W3IDSecurityV1PublicKeyProperty) { this.W3IDSecurityV1PublicKey = i diff --git a/streams/impl/activitystreams/type_video/gen_pkg.go b/streams/impl/activitystreams/type_video/gen_pkg.go index bbb0476..a9866b6 100644 --- a/streams/impl/activitystreams/type_video/gen_pkg.go +++ b/streams/impl/activitystreams/type_video/gen_pkg.go @@ -32,6 +32,10 @@ type privateManager interface { // method for the "ActivityStreamsBccProperty" non-functional property // in the vocabulary "ActivityStreams" DeserializeBccPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBccProperty, error) + // DeserializeBlurhashPropertyToot returns the deserialization method for + // the "TootBlurhashProperty" non-functional property in the + // vocabulary "Toot" + DeserializeBlurhashPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootBlurhashProperty, error) // DeserializeBtoPropertyActivityStreams returns the deserialization // method for the "ActivityStreamsBtoProperty" non-functional property // in the vocabulary "ActivityStreams" diff --git a/streams/impl/activitystreams/type_video/gen_type_activitystreams_video.go b/streams/impl/activitystreams/type_video/gen_type_activitystreams_video.go index 131c04d..a527d38 100644 --- a/streams/impl/activitystreams/type_video/gen_type_activitystreams_video.go +++ b/streams/impl/activitystreams/type_video/gen_type_activitystreams_video.go @@ -23,6 +23,7 @@ type ActivityStreamsVideo struct { ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty ActivityStreamsBcc vocab.ActivityStreamsBccProperty + TootBlurhash vocab.TootBlurhashProperty ActivityStreamsBto vocab.ActivityStreamsBtoProperty ActivityStreamsCc vocab.ActivityStreamsCcProperty ActivityStreamsContent vocab.ActivityStreamsContentProperty @@ -128,6 +129,11 @@ func DeserializeVideo(m map[string]interface{}, aliasMap map[string]string) (*Ac } else if p != nil { this.ActivityStreamsBcc = p } + if p, err := mgr.DeserializeBlurhashPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootBlurhash = p + } if p, err := mgr.DeserializeBtoPropertyActivityStreams()(m, aliasMap); err != nil { return nil, err } else if p != nil { @@ -278,6 +284,8 @@ func DeserializeVideo(m map[string]interface{}, aliasMap map[string]string) (*Ac continue } else if k == "bcc" { continue + } else if k == "blurhash" { + continue } else if k == "bto" { continue } else if k == "cc" { @@ -575,6 +583,11 @@ func (this ActivityStreamsVideo) GetJSONLDType() vocab.JSONLDTypeProperty { return this.JSONLDType } +// GetTootBlurhash returns the "blurhash" property if it exists, and nil otherwise. +func (this ActivityStreamsVideo) GetTootBlurhash() vocab.TootBlurhashProperty { + return this.TootBlurhash +} + // GetTypeName returns the name of this type. func (this ActivityStreamsVideo) GetTypeName() string { return "Video" @@ -605,6 +618,7 @@ func (this ActivityStreamsVideo) JSONLDContext() map[string]string { m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) m = this.helperJSONLDContext(this.ActivityStreamsBcc, m) + m = this.helperJSONLDContext(this.TootBlurhash, m) m = this.helperJSONLDContext(this.ActivityStreamsBto, m) m = this.helperJSONLDContext(this.ActivityStreamsCc, m) m = this.helperJSONLDContext(this.ActivityStreamsContent, m) @@ -710,6 +724,20 @@ func (this ActivityStreamsVideo) LessThan(o vocab.ActivityStreamsVideo) bool { // Anything else is greater than nil return false } // Else: Both are nil + // Compare property "blurhash" + if lhs, rhs := this.TootBlurhash, o.GetTootBlurhash(); 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 "bto" if lhs, rhs := this.ActivityStreamsBto, o.GetActivityStreamsBto(); lhs != nil && rhs != nil { if lhs.LessThan(rhs) { @@ -1151,6 +1179,14 @@ func (this ActivityStreamsVideo) Serialize() (map[string]interface{}, error) { m[this.ActivityStreamsBcc.Name()] = i } } + // Maybe serialize property "blurhash" + if this.TootBlurhash != nil { + if i, err := this.TootBlurhash.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootBlurhash.Name()] = i + } + } // Maybe serialize property "bto" if this.ActivityStreamsBto != nil { if i, err := this.ActivityStreamsBto.Serialize(); err != nil { @@ -1541,6 +1577,11 @@ func (this *ActivityStreamsVideo) SetJSONLDType(i vocab.JSONLDTypeProperty) { this.JSONLDType = i } +// SetTootBlurhash sets the "blurhash" property. +func (this *ActivityStreamsVideo) SetTootBlurhash(i vocab.TootBlurhashProperty) { + this.TootBlurhash = i +} + // VocabularyURI returns the vocabulary's URI as a string. func (this ActivityStreamsVideo) VocabularyURI() string { return "https://www.w3.org/ns/activitystreams" diff --git a/streams/impl/toot/property_blurhash/gen_doc.go b/streams/impl/toot/property_blurhash/gen_doc.go new file mode 100644 index 0000000..bb9d043 --- /dev/null +++ b/streams/impl/toot/property_blurhash/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertyblurhash contains the implementation for the blurhash 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 propertyblurhash diff --git a/streams/impl/toot/property_blurhash/gen_pkg.go b/streams/impl/toot/property_blurhash/gen_pkg.go new file mode 100644 index 0000000..1eac1c4 --- /dev/null +++ b/streams/impl/toot/property_blurhash/gen_pkg.go @@ -0,0 +1,15 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyblurhash + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface{} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/streams/impl/toot/property_blurhash/gen_property_toot_blurhash.go b/streams/impl/toot/property_blurhash/gen_property_toot_blurhash.go new file mode 100644 index 0000000..58293a8 --- /dev/null +++ b/streams/impl/toot/property_blurhash/gen_property_toot_blurhash.go @@ -0,0 +1,203 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyblurhash + +import ( + "fmt" + string1 "github.com/go-fed/activity/streams/values/string" + vocab "github.com/go-fed/activity/streams/vocab" + "net/url" +) + +// TootBlurhashProperty is the functional property "blurhash". It is permitted to +// be a single default-valued value type. +type TootBlurhashProperty struct { + xmlschemaStringMember string + hasStringMember bool + unknown interface{} + iri *url.URL + alias string +} + +// DeserializeBlurhashProperty creates a "blurhash" property from an interface +// representation that has been unmarshalled from a text or binary format. +func DeserializeBlurhashProperty(m map[string]interface{}, aliasMap map[string]string) (*TootBlurhashProperty, error) { + alias := "" + if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok { + alias = a + } + propName := "blurhash" + if len(alias) > 0 { + // Use alias both to find the property, and set within the property. + propName = fmt.Sprintf("%s:%s", alias, "blurhash") + } + i, ok := m[propName] + + if ok { + 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 := &TootBlurhashProperty{ + alias: alias, + iri: u, + } + return this, nil + } + } + if v, err := string1.DeserializeString(i); err == nil { + this := &TootBlurhashProperty{ + alias: alias, + hasStringMember: true, + xmlschemaStringMember: v, + } + return this, nil + } + this := &TootBlurhashProperty{ + alias: alias, + unknown: i, + } + return this, nil + } + return nil, nil +} + +// NewTootBlurhashProperty creates a new blurhash property. +func NewTootBlurhashProperty() *TootBlurhashProperty { + return &TootBlurhashProperty{alias: ""} +} + +// Clear ensures no value of this property is set. Calling IsXMLSchemaString +// afterwards will return false. +func (this *TootBlurhashProperty) Clear() { + this.unknown = nil + this.iri = nil + this.hasStringMember = false +} + +// Get returns the value of this property. When IsXMLSchemaString returns false, +// Get will return any arbitrary value. +func (this TootBlurhashProperty) Get() string { + return this.xmlschemaStringMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this TootBlurhashProperty) GetIRI() *url.URL { + return this.iri +} + +// HasAny returns true if the value or IRI is set. +func (this TootBlurhashProperty) HasAny() bool { + return this.IsXMLSchemaString() || this.iri != nil +} + +// IsIRI returns true if this property is an IRI. +func (this TootBlurhashProperty) IsIRI() bool { + return this.iri != nil +} + +// IsXMLSchemaString returns true if this property is set and not an IRI. +func (this TootBlurhashProperty) IsXMLSchemaString() bool { + return this.hasStringMember +} + +// 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 TootBlurhashProperty) JSONLDContext() map[string]string { + m := map[string]string{"http://joinmastodon.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 TootBlurhashProperty) KindIndex() int { + if this.IsXMLSchemaString() { + 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 TootBlurhashProperty) LessThan(o vocab.TootBlurhashProperty) 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.IsXMLSchemaString() && !o.IsXMLSchemaString() { + // Both are unknowns. + return false + } else if this.IsXMLSchemaString() && !o.IsXMLSchemaString() { + // Values are always greater than unknown values. + return false + } else if !this.IsXMLSchemaString() && o.IsXMLSchemaString() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return string1.LessString(this.Get(), o.Get()) + } +} + +// Name returns the name of this property: "blurhash". +func (this TootBlurhashProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "blurhash" + } else { + return "blurhash" + } +} + +// 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 TootBlurhashProperty) Serialize() (interface{}, error) { + if this.IsXMLSchemaString() { + return string1.SerializeString(this.Get()) + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// Set sets the value of this property. Calling IsXMLSchemaString afterwards will +// return true. +func (this *TootBlurhashProperty) Set(v string) { + this.Clear() + this.xmlschemaStringMember = v + this.hasStringMember = true +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *TootBlurhashProperty) SetIRI(v *url.URL) { + this.Clear() + this.iri = v +} diff --git a/streams/impl/toot/property_discoverable/gen_doc.go b/streams/impl/toot/property_discoverable/gen_doc.go new file mode 100644 index 0000000..768104e --- /dev/null +++ b/streams/impl/toot/property_discoverable/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertydiscoverable contains the implementation for the discoverable +// 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 propertydiscoverable diff --git a/streams/impl/toot/property_discoverable/gen_pkg.go b/streams/impl/toot/property_discoverable/gen_pkg.go new file mode 100644 index 0000000..bb93617 --- /dev/null +++ b/streams/impl/toot/property_discoverable/gen_pkg.go @@ -0,0 +1,15 @@ +// Code generated by astool. DO NOT EDIT. + +package propertydiscoverable + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface{} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/streams/impl/toot/property_discoverable/gen_property_toot_discoverable.go b/streams/impl/toot/property_discoverable/gen_property_toot_discoverable.go new file mode 100644 index 0000000..da66e6e --- /dev/null +++ b/streams/impl/toot/property_discoverable/gen_property_toot_discoverable.go @@ -0,0 +1,204 @@ +// Code generated by astool. DO NOT EDIT. + +package propertydiscoverable + +import ( + "fmt" + boolean "github.com/go-fed/activity/streams/values/boolean" + vocab "github.com/go-fed/activity/streams/vocab" + "net/url" +) + +// TootDiscoverableProperty is the functional property "discoverable". It is +// permitted to be a single default-valued value type. +type TootDiscoverableProperty struct { + xmlschemaBooleanMember bool + hasBooleanMember bool + unknown interface{} + iri *url.URL + alias string +} + +// DeserializeDiscoverableProperty creates a "discoverable" property from an +// interface representation that has been unmarshalled from a text or binary +// format. +func DeserializeDiscoverableProperty(m map[string]interface{}, aliasMap map[string]string) (*TootDiscoverableProperty, error) { + alias := "" + if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok { + alias = a + } + propName := "discoverable" + if len(alias) > 0 { + // Use alias both to find the property, and set within the property. + propName = fmt.Sprintf("%s:%s", alias, "discoverable") + } + i, ok := m[propName] + + if ok { + 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 := &TootDiscoverableProperty{ + alias: alias, + iri: u, + } + return this, nil + } + } + if v, err := boolean.DeserializeBoolean(i); err == nil { + this := &TootDiscoverableProperty{ + alias: alias, + hasBooleanMember: true, + xmlschemaBooleanMember: v, + } + return this, nil + } + this := &TootDiscoverableProperty{ + alias: alias, + unknown: i, + } + return this, nil + } + return nil, nil +} + +// NewTootDiscoverableProperty creates a new discoverable property. +func NewTootDiscoverableProperty() *TootDiscoverableProperty { + return &TootDiscoverableProperty{alias: ""} +} + +// Clear ensures no value of this property is set. Calling IsXMLSchemaBoolean +// afterwards will return false. +func (this *TootDiscoverableProperty) Clear() { + this.unknown = nil + this.iri = nil + this.hasBooleanMember = false +} + +// Get returns the value of this property. When IsXMLSchemaBoolean returns false, +// Get will return any arbitrary value. +func (this TootDiscoverableProperty) Get() bool { + return this.xmlschemaBooleanMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this TootDiscoverableProperty) GetIRI() *url.URL { + return this.iri +} + +// HasAny returns true if the value or IRI is set. +func (this TootDiscoverableProperty) HasAny() bool { + return this.IsXMLSchemaBoolean() || this.iri != nil +} + +// IsIRI returns true if this property is an IRI. +func (this TootDiscoverableProperty) IsIRI() bool { + return this.iri != nil +} + +// IsXMLSchemaBoolean returns true if this property is set and not an IRI. +func (this TootDiscoverableProperty) IsXMLSchemaBoolean() bool { + return this.hasBooleanMember +} + +// 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 TootDiscoverableProperty) JSONLDContext() map[string]string { + m := map[string]string{"http://joinmastodon.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 TootDiscoverableProperty) KindIndex() int { + if this.IsXMLSchemaBoolean() { + 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 TootDiscoverableProperty) LessThan(o vocab.TootDiscoverableProperty) 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.IsXMLSchemaBoolean() && !o.IsXMLSchemaBoolean() { + // Both are unknowns. + return false + } else if this.IsXMLSchemaBoolean() && !o.IsXMLSchemaBoolean() { + // Values are always greater than unknown values. + return false + } else if !this.IsXMLSchemaBoolean() && o.IsXMLSchemaBoolean() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return boolean.LessBoolean(this.Get(), o.Get()) + } +} + +// Name returns the name of this property: "discoverable". +func (this TootDiscoverableProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "discoverable" + } else { + return "discoverable" + } +} + +// 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 TootDiscoverableProperty) Serialize() (interface{}, error) { + if this.IsXMLSchemaBoolean() { + return boolean.SerializeBoolean(this.Get()) + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// Set sets the value of this property. Calling IsXMLSchemaBoolean afterwards will +// return true. +func (this *TootDiscoverableProperty) Set(v bool) { + this.Clear() + this.xmlschemaBooleanMember = v + this.hasBooleanMember = true +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *TootDiscoverableProperty) SetIRI(v *url.URL) { + this.Clear() + this.iri = v +} diff --git a/streams/impl/toot/property_featured/gen_doc.go b/streams/impl/toot/property_featured/gen_doc.go new file mode 100644 index 0000000..a1465f0 --- /dev/null +++ b/streams/impl/toot/property_featured/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertyfeatured contains the implementation for the featured 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 propertyfeatured diff --git a/streams/impl/toot/property_featured/gen_pkg.go b/streams/impl/toot/property_featured/gen_pkg.go new file mode 100644 index 0000000..3cfcaa4 --- /dev/null +++ b/streams/impl/toot/property_featured/gen_pkg.go @@ -0,0 +1,27 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyfeatured + +import vocab "github.com/go-fed/activity/streams/vocab" + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface { + // DeserializeOrderedCollectionActivityStreams returns the deserialization + // method for the "ActivityStreamsOrderedCollection" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeOrderedCollectionActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollection, error) + // DeserializeOrderedCollectionPageActivityStreams returns the + // deserialization method for the + // "ActivityStreamsOrderedCollectionPage" non-functional property in + // the vocabulary "ActivityStreams" + DeserializeOrderedCollectionPageActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsOrderedCollectionPage, error) +} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/streams/impl/toot/property_featured/gen_property_toot_featured.go b/streams/impl/toot/property_featured/gen_property_toot_featured.go new file mode 100644 index 0000000..dd1ea60 --- /dev/null +++ b/streams/impl/toot/property_featured/gen_property_toot_featured.go @@ -0,0 +1,268 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyfeatured + +import ( + "fmt" + vocab "github.com/go-fed/activity/streams/vocab" + "net/url" +) + +// TootFeaturedProperty is the functional property "featured". It is permitted to +// be one of multiple value types. At most, one type of value can be present, +// or none at all. Setting a value will clear the other types of values so +// that only one of the 'Is' methods will return true. It is possible to clear +// all values, so that this property is empty. +type TootFeaturedProperty struct { + activitystreamsOrderedCollectionMember vocab.ActivityStreamsOrderedCollection + activitystreamsOrderedCollectionPageMember vocab.ActivityStreamsOrderedCollectionPage + unknown interface{} + iri *url.URL + alias string +} + +// DeserializeFeaturedProperty creates a "featured" property from an interface +// representation that has been unmarshalled from a text or binary format. +func DeserializeFeaturedProperty(m map[string]interface{}, aliasMap map[string]string) (*TootFeaturedProperty, error) { + alias := "" + if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok { + alias = a + } + propName := "featured" + if len(alias) > 0 { + // Use alias both to find the property, and set within the property. + propName = fmt.Sprintf("%s:%s", alias, "featured") + } + i, ok := m[propName] + + if ok { + 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 := &TootFeaturedProperty{ + alias: alias, + iri: u, + } + return this, nil + } + } + if m, ok := i.(map[string]interface{}); ok { + if v, err := mgr.DeserializeOrderedCollectionActivityStreams()(m, aliasMap); err == nil { + this := &TootFeaturedProperty{ + activitystreamsOrderedCollectionMember: v, + alias: alias, + } + return this, nil + } else if v, err := mgr.DeserializeOrderedCollectionPageActivityStreams()(m, aliasMap); err == nil { + this := &TootFeaturedProperty{ + activitystreamsOrderedCollectionPageMember: v, + alias: alias, + } + return this, nil + } + } + this := &TootFeaturedProperty{ + alias: alias, + unknown: i, + } + return this, nil + } + return nil, nil +} + +// NewTootFeaturedProperty creates a new featured property. +func NewTootFeaturedProperty() *TootFeaturedProperty { + return &TootFeaturedProperty{alias: ""} +} + +// Clear ensures no value of this property is set. Calling HasAny or any of the +// 'Is' methods afterwards will return false. +func (this *TootFeaturedProperty) Clear() { + this.activitystreamsOrderedCollectionMember = nil + this.activitystreamsOrderedCollectionPageMember = nil + this.unknown = nil + this.iri = nil +} + +// GetActivityStreamsOrderedCollection returns the value of this property. When +// IsActivityStreamsOrderedCollection returns false, +// GetActivityStreamsOrderedCollection will return an arbitrary value. +func (this TootFeaturedProperty) GetActivityStreamsOrderedCollection() vocab.ActivityStreamsOrderedCollection { + return this.activitystreamsOrderedCollectionMember +} + +// GetActivityStreamsOrderedCollectionPage returns the value of this property. +// When IsActivityStreamsOrderedCollectionPage returns false, +// GetActivityStreamsOrderedCollectionPage will return an arbitrary value. +func (this TootFeaturedProperty) GetActivityStreamsOrderedCollectionPage() vocab.ActivityStreamsOrderedCollectionPage { + return this.activitystreamsOrderedCollectionPageMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return an arbitrary value. +func (this TootFeaturedProperty) 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 TootFeaturedProperty) GetType() vocab.Type { + if this.IsActivityStreamsOrderedCollection() { + return this.GetActivityStreamsOrderedCollection() + } + if this.IsActivityStreamsOrderedCollectionPage() { + return this.GetActivityStreamsOrderedCollectionPage() + } + + return nil +} + +// HasAny returns true if any of the different values is set. +func (this TootFeaturedProperty) HasAny() bool { + return this.IsActivityStreamsOrderedCollection() || + this.IsActivityStreamsOrderedCollectionPage() || + this.iri != nil +} + +// IsActivityStreamsOrderedCollection returns true if this property has a type of +// "OrderedCollection". When true, use the GetActivityStreamsOrderedCollection +// and SetActivityStreamsOrderedCollection methods to access and set this +// property. +func (this TootFeaturedProperty) IsActivityStreamsOrderedCollection() bool { + return this.activitystreamsOrderedCollectionMember != nil +} + +// IsActivityStreamsOrderedCollectionPage returns true if this property has a type +// of "OrderedCollectionPage". When true, use the +// GetActivityStreamsOrderedCollectionPage and +// SetActivityStreamsOrderedCollectionPage methods to access and set this +// property. +func (this TootFeaturedProperty) IsActivityStreamsOrderedCollectionPage() bool { + return this.activitystreamsOrderedCollectionPageMember != nil +} + +// IsIRI returns true if this property is an IRI. When true, use GetIRI and SetIRI +// to access and set this property +func (this TootFeaturedProperty) 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 TootFeaturedProperty) JSONLDContext() map[string]string { + m := map[string]string{"http://joinmastodon.org/ns": this.alias} + var child map[string]string + if this.IsActivityStreamsOrderedCollection() { + child = this.GetActivityStreamsOrderedCollection().JSONLDContext() + } else if this.IsActivityStreamsOrderedCollectionPage() { + child = this.GetActivityStreamsOrderedCollectionPage().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 TootFeaturedProperty) KindIndex() int { + if this.IsActivityStreamsOrderedCollection() { + return 0 + } + if this.IsActivityStreamsOrderedCollectionPage() { + return 1 + } + 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 TootFeaturedProperty) LessThan(o vocab.TootFeaturedProperty) bool { + idx1 := this.KindIndex() + idx2 := o.KindIndex() + if idx1 < idx2 { + return true + } else if idx1 > idx2 { + return false + } else if this.IsActivityStreamsOrderedCollection() { + return this.GetActivityStreamsOrderedCollection().LessThan(o.GetActivityStreamsOrderedCollection()) + } else if this.IsActivityStreamsOrderedCollectionPage() { + return this.GetActivityStreamsOrderedCollectionPage().LessThan(o.GetActivityStreamsOrderedCollectionPage()) + } else if this.IsIRI() { + return this.iri.String() < o.GetIRI().String() + } + return false +} + +// Name returns the name of this property: "featured". +func (this TootFeaturedProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "featured" + } else { + return "featured" + } +} + +// 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 TootFeaturedProperty) Serialize() (interface{}, error) { + if this.IsActivityStreamsOrderedCollection() { + return this.GetActivityStreamsOrderedCollection().Serialize() + } else if this.IsActivityStreamsOrderedCollectionPage() { + return this.GetActivityStreamsOrderedCollectionPage().Serialize() + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// SetActivityStreamsOrderedCollection sets the value of this property. Calling +// IsActivityStreamsOrderedCollection afterwards returns true. +func (this *TootFeaturedProperty) SetActivityStreamsOrderedCollection(v vocab.ActivityStreamsOrderedCollection) { + this.Clear() + this.activitystreamsOrderedCollectionMember = v +} + +// SetActivityStreamsOrderedCollectionPage sets the value of this property. +// Calling IsActivityStreamsOrderedCollectionPage afterwards returns true. +func (this *TootFeaturedProperty) SetActivityStreamsOrderedCollectionPage(v vocab.ActivityStreamsOrderedCollectionPage) { + this.Clear() + this.activitystreamsOrderedCollectionPageMember = v +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards returns true. +func (this *TootFeaturedProperty) 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 *TootFeaturedProperty) SetType(t vocab.Type) error { + if v, ok := t.(vocab.ActivityStreamsOrderedCollection); ok { + this.SetActivityStreamsOrderedCollection(v) + return nil + } + if v, ok := t.(vocab.ActivityStreamsOrderedCollectionPage); ok { + this.SetActivityStreamsOrderedCollectionPage(v) + return nil + } + + return fmt.Errorf("illegal type to set on featured property: %T", t) +} diff --git a/streams/impl/toot/property_signaturealgorithm/gen_doc.go b/streams/impl/toot/property_signaturealgorithm/gen_doc.go new file mode 100644 index 0000000..d2293a4 --- /dev/null +++ b/streams/impl/toot/property_signaturealgorithm/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertysignaturealgorithm contains the implementation for the +// signatureAlgorithm 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 propertysignaturealgorithm diff --git a/streams/impl/toot/property_signaturealgorithm/gen_pkg.go b/streams/impl/toot/property_signaturealgorithm/gen_pkg.go new file mode 100644 index 0000000..2ed0e28 --- /dev/null +++ b/streams/impl/toot/property_signaturealgorithm/gen_pkg.go @@ -0,0 +1,15 @@ +// Code generated by astool. DO NOT EDIT. + +package propertysignaturealgorithm + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface{} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/streams/impl/toot/property_signaturealgorithm/gen_property_toot_signatureAlgorithm.go b/streams/impl/toot/property_signaturealgorithm/gen_property_toot_signatureAlgorithm.go new file mode 100644 index 0000000..cf01533 --- /dev/null +++ b/streams/impl/toot/property_signaturealgorithm/gen_property_toot_signatureAlgorithm.go @@ -0,0 +1,204 @@ +// Code generated by astool. DO NOT EDIT. + +package propertysignaturealgorithm + +import ( + "fmt" + string1 "github.com/go-fed/activity/streams/values/string" + vocab "github.com/go-fed/activity/streams/vocab" + "net/url" +) + +// TootSignatureAlgorithmProperty is the functional property "signatureAlgorithm". +// It is permitted to be a single default-valued value type. +type TootSignatureAlgorithmProperty struct { + xmlschemaStringMember string + hasStringMember bool + unknown interface{} + iri *url.URL + alias string +} + +// DeserializeSignatureAlgorithmProperty creates a "signatureAlgorithm" property +// from an interface representation that has been unmarshalled from a text or +// binary format. +func DeserializeSignatureAlgorithmProperty(m map[string]interface{}, aliasMap map[string]string) (*TootSignatureAlgorithmProperty, error) { + alias := "" + if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok { + alias = a + } + propName := "signatureAlgorithm" + if len(alias) > 0 { + // Use alias both to find the property, and set within the property. + propName = fmt.Sprintf("%s:%s", alias, "signatureAlgorithm") + } + i, ok := m[propName] + + if ok { + 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 := &TootSignatureAlgorithmProperty{ + alias: alias, + iri: u, + } + return this, nil + } + } + if v, err := string1.DeserializeString(i); err == nil { + this := &TootSignatureAlgorithmProperty{ + alias: alias, + hasStringMember: true, + xmlschemaStringMember: v, + } + return this, nil + } + this := &TootSignatureAlgorithmProperty{ + alias: alias, + unknown: i, + } + return this, nil + } + return nil, nil +} + +// NewTootSignatureAlgorithmProperty creates a new signatureAlgorithm property. +func NewTootSignatureAlgorithmProperty() *TootSignatureAlgorithmProperty { + return &TootSignatureAlgorithmProperty{alias: ""} +} + +// Clear ensures no value of this property is set. Calling IsXMLSchemaString +// afterwards will return false. +func (this *TootSignatureAlgorithmProperty) Clear() { + this.unknown = nil + this.iri = nil + this.hasStringMember = false +} + +// Get returns the value of this property. When IsXMLSchemaString returns false, +// Get will return any arbitrary value. +func (this TootSignatureAlgorithmProperty) Get() string { + return this.xmlschemaStringMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this TootSignatureAlgorithmProperty) GetIRI() *url.URL { + return this.iri +} + +// HasAny returns true if the value or IRI is set. +func (this TootSignatureAlgorithmProperty) HasAny() bool { + return this.IsXMLSchemaString() || this.iri != nil +} + +// IsIRI returns true if this property is an IRI. +func (this TootSignatureAlgorithmProperty) IsIRI() bool { + return this.iri != nil +} + +// IsXMLSchemaString returns true if this property is set and not an IRI. +func (this TootSignatureAlgorithmProperty) IsXMLSchemaString() bool { + return this.hasStringMember +} + +// 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 TootSignatureAlgorithmProperty) JSONLDContext() map[string]string { + m := map[string]string{"http://joinmastodon.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 TootSignatureAlgorithmProperty) KindIndex() int { + if this.IsXMLSchemaString() { + 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 TootSignatureAlgorithmProperty) LessThan(o vocab.TootSignatureAlgorithmProperty) 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.IsXMLSchemaString() && !o.IsXMLSchemaString() { + // Both are unknowns. + return false + } else if this.IsXMLSchemaString() && !o.IsXMLSchemaString() { + // Values are always greater than unknown values. + return false + } else if !this.IsXMLSchemaString() && o.IsXMLSchemaString() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return string1.LessString(this.Get(), o.Get()) + } +} + +// Name returns the name of this property: "signatureAlgorithm". +func (this TootSignatureAlgorithmProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "signatureAlgorithm" + } else { + return "signatureAlgorithm" + } +} + +// 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 TootSignatureAlgorithmProperty) Serialize() (interface{}, error) { + if this.IsXMLSchemaString() { + return string1.SerializeString(this.Get()) + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// Set sets the value of this property. Calling IsXMLSchemaString afterwards will +// return true. +func (this *TootSignatureAlgorithmProperty) Set(v string) { + this.Clear() + this.xmlschemaStringMember = v + this.hasStringMember = true +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *TootSignatureAlgorithmProperty) SetIRI(v *url.URL) { + this.Clear() + this.iri = v +} diff --git a/streams/impl/toot/property_signaturevalue/gen_doc.go b/streams/impl/toot/property_signaturevalue/gen_doc.go new file mode 100644 index 0000000..668c4e8 --- /dev/null +++ b/streams/impl/toot/property_signaturevalue/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertysignaturevalue contains the implementation for the +// signatureValue 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 propertysignaturevalue diff --git a/streams/impl/toot/property_signaturevalue/gen_pkg.go b/streams/impl/toot/property_signaturevalue/gen_pkg.go new file mode 100644 index 0000000..540b6f1 --- /dev/null +++ b/streams/impl/toot/property_signaturevalue/gen_pkg.go @@ -0,0 +1,15 @@ +// Code generated by astool. DO NOT EDIT. + +package propertysignaturevalue + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface{} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/streams/impl/toot/property_signaturevalue/gen_property_toot_signatureValue.go b/streams/impl/toot/property_signaturevalue/gen_property_toot_signatureValue.go new file mode 100644 index 0000000..5810d60 --- /dev/null +++ b/streams/impl/toot/property_signaturevalue/gen_property_toot_signatureValue.go @@ -0,0 +1,204 @@ +// Code generated by astool. DO NOT EDIT. + +package propertysignaturevalue + +import ( + "fmt" + string1 "github.com/go-fed/activity/streams/values/string" + vocab "github.com/go-fed/activity/streams/vocab" + "net/url" +) + +// TootSignatureValueProperty is the functional property "signatureValue". It is +// permitted to be a single default-valued value type. +type TootSignatureValueProperty struct { + xmlschemaStringMember string + hasStringMember bool + unknown interface{} + iri *url.URL + alias string +} + +// DeserializeSignatureValueProperty creates a "signatureValue" property from an +// interface representation that has been unmarshalled from a text or binary +// format. +func DeserializeSignatureValueProperty(m map[string]interface{}, aliasMap map[string]string) (*TootSignatureValueProperty, error) { + alias := "" + if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok { + alias = a + } + propName := "signatureValue" + if len(alias) > 0 { + // Use alias both to find the property, and set within the property. + propName = fmt.Sprintf("%s:%s", alias, "signatureValue") + } + i, ok := m[propName] + + if ok { + 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 := &TootSignatureValueProperty{ + alias: alias, + iri: u, + } + return this, nil + } + } + if v, err := string1.DeserializeString(i); err == nil { + this := &TootSignatureValueProperty{ + alias: alias, + hasStringMember: true, + xmlschemaStringMember: v, + } + return this, nil + } + this := &TootSignatureValueProperty{ + alias: alias, + unknown: i, + } + return this, nil + } + return nil, nil +} + +// NewTootSignatureValueProperty creates a new signatureValue property. +func NewTootSignatureValueProperty() *TootSignatureValueProperty { + return &TootSignatureValueProperty{alias: ""} +} + +// Clear ensures no value of this property is set. Calling IsXMLSchemaString +// afterwards will return false. +func (this *TootSignatureValueProperty) Clear() { + this.unknown = nil + this.iri = nil + this.hasStringMember = false +} + +// Get returns the value of this property. When IsXMLSchemaString returns false, +// Get will return any arbitrary value. +func (this TootSignatureValueProperty) Get() string { + return this.xmlschemaStringMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this TootSignatureValueProperty) GetIRI() *url.URL { + return this.iri +} + +// HasAny returns true if the value or IRI is set. +func (this TootSignatureValueProperty) HasAny() bool { + return this.IsXMLSchemaString() || this.iri != nil +} + +// IsIRI returns true if this property is an IRI. +func (this TootSignatureValueProperty) IsIRI() bool { + return this.iri != nil +} + +// IsXMLSchemaString returns true if this property is set and not an IRI. +func (this TootSignatureValueProperty) IsXMLSchemaString() bool { + return this.hasStringMember +} + +// 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 TootSignatureValueProperty) JSONLDContext() map[string]string { + m := map[string]string{"http://joinmastodon.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 TootSignatureValueProperty) KindIndex() int { + if this.IsXMLSchemaString() { + 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 TootSignatureValueProperty) LessThan(o vocab.TootSignatureValueProperty) 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.IsXMLSchemaString() && !o.IsXMLSchemaString() { + // Both are unknowns. + return false + } else if this.IsXMLSchemaString() && !o.IsXMLSchemaString() { + // Values are always greater than unknown values. + return false + } else if !this.IsXMLSchemaString() && o.IsXMLSchemaString() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return string1.LessString(this.Get(), o.Get()) + } +} + +// Name returns the name of this property: "signatureValue". +func (this TootSignatureValueProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "signatureValue" + } else { + return "signatureValue" + } +} + +// 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 TootSignatureValueProperty) Serialize() (interface{}, error) { + if this.IsXMLSchemaString() { + return string1.SerializeString(this.Get()) + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// Set sets the value of this property. Calling IsXMLSchemaString afterwards will +// return true. +func (this *TootSignatureValueProperty) Set(v string) { + this.Clear() + this.xmlschemaStringMember = v + this.hasStringMember = true +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *TootSignatureValueProperty) SetIRI(v *url.URL) { + this.Clear() + this.iri = v +} diff --git a/streams/impl/toot/property_voterscount/gen_doc.go b/streams/impl/toot/property_voterscount/gen_doc.go new file mode 100644 index 0000000..e2d1296 --- /dev/null +++ b/streams/impl/toot/property_voterscount/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package propertyvoterscount contains the implementation for the votersCount +// 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 propertyvoterscount diff --git a/streams/impl/toot/property_voterscount/gen_pkg.go b/streams/impl/toot/property_voterscount/gen_pkg.go new file mode 100644 index 0000000..668695c --- /dev/null +++ b/streams/impl/toot/property_voterscount/gen_pkg.go @@ -0,0 +1,15 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyvoterscount + +var mgr privateManager + +// privateManager abstracts the code-generated manager that provides access to +// concrete implementations. +type privateManager interface{} + +// SetManager sets the manager package-global variable. For internal use only, do +// not use as part of Application behavior. Must be called at golang init time. +func SetManager(m privateManager) { + mgr = m +} diff --git a/streams/impl/toot/property_voterscount/gen_property_toot_votersCount.go b/streams/impl/toot/property_voterscount/gen_property_toot_votersCount.go new file mode 100644 index 0000000..01d2ddf --- /dev/null +++ b/streams/impl/toot/property_voterscount/gen_property_toot_votersCount.go @@ -0,0 +1,205 @@ +// Code generated by astool. DO NOT EDIT. + +package propertyvoterscount + +import ( + "fmt" + nonnegativeinteger "github.com/go-fed/activity/streams/values/nonNegativeInteger" + vocab "github.com/go-fed/activity/streams/vocab" + "net/url" +) + +// TootVotersCountProperty is the functional property "votersCount". It is +// permitted to be a single default-valued value type. +type TootVotersCountProperty struct { + xmlschemaNonNegativeIntegerMember int + hasNonNegativeIntegerMember bool + unknown interface{} + iri *url.URL + alias string +} + +// DeserializeVotersCountProperty creates a "votersCount" property from an +// interface representation that has been unmarshalled from a text or binary +// format. +func DeserializeVotersCountProperty(m map[string]interface{}, aliasMap map[string]string) (*TootVotersCountProperty, error) { + alias := "" + if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok { + alias = a + } + propName := "votersCount" + if len(alias) > 0 { + // Use alias both to find the property, and set within the property. + propName = fmt.Sprintf("%s:%s", alias, "votersCount") + } + i, ok := m[propName] + + if ok { + 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 := &TootVotersCountProperty{ + alias: alias, + iri: u, + } + return this, nil + } + } + if v, err := nonnegativeinteger.DeserializeNonNegativeInteger(i); err == nil { + this := &TootVotersCountProperty{ + alias: alias, + hasNonNegativeIntegerMember: true, + xmlschemaNonNegativeIntegerMember: v, + } + return this, nil + } + this := &TootVotersCountProperty{ + alias: alias, + unknown: i, + } + return this, nil + } + return nil, nil +} + +// NewTootVotersCountProperty creates a new votersCount property. +func NewTootVotersCountProperty() *TootVotersCountProperty { + return &TootVotersCountProperty{alias: ""} +} + +// Clear ensures no value of this property is set. Calling +// IsXMLSchemaNonNegativeInteger afterwards will return false. +func (this *TootVotersCountProperty) Clear() { + this.unknown = nil + this.iri = nil + this.hasNonNegativeIntegerMember = false +} + +// Get returns the value of this property. When IsXMLSchemaNonNegativeInteger +// returns false, Get will return any arbitrary value. +func (this TootVotersCountProperty) Get() int { + return this.xmlschemaNonNegativeIntegerMember +} + +// GetIRI returns the IRI of this property. When IsIRI returns false, GetIRI will +// return any arbitrary value. +func (this TootVotersCountProperty) GetIRI() *url.URL { + return this.iri +} + +// HasAny returns true if the value or IRI is set. +func (this TootVotersCountProperty) HasAny() bool { + return this.IsXMLSchemaNonNegativeInteger() || this.iri != nil +} + +// IsIRI returns true if this property is an IRI. +func (this TootVotersCountProperty) IsIRI() bool { + return this.iri != nil +} + +// IsXMLSchemaNonNegativeInteger returns true if this property is set and not an +// IRI. +func (this TootVotersCountProperty) IsXMLSchemaNonNegativeInteger() bool { + return this.hasNonNegativeIntegerMember +} + +// 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 TootVotersCountProperty) JSONLDContext() map[string]string { + m := map[string]string{"http://joinmastodon.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 TootVotersCountProperty) KindIndex() int { + if this.IsXMLSchemaNonNegativeInteger() { + 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 TootVotersCountProperty) LessThan(o vocab.TootVotersCountProperty) 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.IsXMLSchemaNonNegativeInteger() && !o.IsXMLSchemaNonNegativeInteger() { + // Both are unknowns. + return false + } else if this.IsXMLSchemaNonNegativeInteger() && !o.IsXMLSchemaNonNegativeInteger() { + // Values are always greater than unknown values. + return false + } else if !this.IsXMLSchemaNonNegativeInteger() && o.IsXMLSchemaNonNegativeInteger() { + // Unknowns are always less than known values. + return true + } else { + // Actual comparison. + return nonnegativeinteger.LessNonNegativeInteger(this.Get(), o.Get()) + } +} + +// Name returns the name of this property: "votersCount". +func (this TootVotersCountProperty) Name() string { + if len(this.alias) > 0 { + return this.alias + ":" + "votersCount" + } else { + return "votersCount" + } +} + +// 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 TootVotersCountProperty) Serialize() (interface{}, error) { + if this.IsXMLSchemaNonNegativeInteger() { + return nonnegativeinteger.SerializeNonNegativeInteger(this.Get()) + } else if this.IsIRI() { + return this.iri.String(), nil + } + return this.unknown, nil +} + +// Set sets the value of this property. Calling IsXMLSchemaNonNegativeInteger +// afterwards will return true. +func (this *TootVotersCountProperty) Set(v int) { + this.Clear() + this.xmlschemaNonNegativeIntegerMember = v + this.hasNonNegativeIntegerMember = true +} + +// SetIRI sets the value of this property. Calling IsIRI afterwards will return +// true. +func (this *TootVotersCountProperty) SetIRI(v *url.URL) { + this.Clear() + this.iri = v +} diff --git a/streams/impl/toot/type_emoji/gen_doc.go b/streams/impl/toot/type_emoji/gen_doc.go new file mode 100644 index 0000000..1fadb2f --- /dev/null +++ b/streams/impl/toot/type_emoji/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package typeemoji contains the implementation for the Emoji 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 typeemoji diff --git a/streams/impl/toot/type_emoji/gen_pkg.go b/streams/impl/toot/type_emoji/gen_pkg.go new file mode 100644 index 0000000..7ceca4a --- /dev/null +++ b/streams/impl/toot/type_emoji/gen_pkg.go @@ -0,0 +1,171 @@ +// Code generated by astool. DO NOT EDIT. + +package typeemoji + +import vocab "github.com/go-fed/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 { + // DeserializeAltitudePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsAltitudeProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeAttachmentPropertyActivityStreams returns the + // deserialization method for the "ActivityStreamsAttachmentProperty" + // non-functional property in the vocabulary "ActivityStreams" + DeserializeAttachmentPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAttachmentProperty, error) + // 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) + // DeserializeAudiencePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsAudienceProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeAudiencePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudienceProperty, error) + // DeserializeBccPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsBccProperty" non-functional property + // in the vocabulary "ActivityStreams" + DeserializeBccPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBccProperty, error) + // DeserializeBtoPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsBtoProperty" non-functional property + // in the vocabulary "ActivityStreams" + DeserializeBtoPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBtoProperty, error) + // DeserializeCcPropertyActivityStreams returns the deserialization method + // for the "ActivityStreamsCcProperty" non-functional property in the + // vocabulary "ActivityStreams" + DeserializeCcPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCcProperty, error) + // DeserializeContentPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsContentProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeContentPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContentProperty, error) + // DeserializeContextPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsContextProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeContextPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContextProperty, error) + // DeserializeDurationPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsDurationProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeDurationPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDurationProperty, error) + // DeserializeEndTimePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsEndTimeProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeEndTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndTimeProperty, error) + // DeserializeGeneratorPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsGeneratorProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeGeneratorPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGeneratorProperty, error) + // DeserializeIconPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsIconProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeIconPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIconProperty, 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) + // DeserializeImagePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsImageProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeImagePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImageProperty, error) + // DeserializeInReplyToPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsInReplyToProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeLikesPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsLikesProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeLikesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLikesProperty, error) + // DeserializeLocationPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsLocationProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeLocationPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLocationProperty, 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) + // DeserializeObjectPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsObjectProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeObjectPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObjectProperty, 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) + // DeserializePublishedPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsPublishedProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializePublishedPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPublishedProperty, error) + // DeserializeRepliesPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsRepliesProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeRepliesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRepliesProperty, error) + // DeserializeSharesPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsSharesProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeSharesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSharesProperty, error) + // DeserializeStartTimePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsStartTimeProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeStartTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsStartTimeProperty, 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) + // DeserializeTagPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsTagProperty" non-functional property + // in the vocabulary "ActivityStreams" + DeserializeTagPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTagProperty, 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) + // 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) + // DeserializeUpdatedPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsUpdatedProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeUpdatedPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdatedProperty, error) + // DeserializeUrlPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsUrlProperty" non-functional property + // in the vocabulary "ActivityStreams" + DeserializeUrlPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUrlProperty, 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/streams/impl/toot/type_emoji/gen_type_toot_emoji.go b/streams/impl/toot/type_emoji/gen_type_toot_emoji.go new file mode 100644 index 0000000..14fff04 --- /dev/null +++ b/streams/impl/toot/type_emoji/gen_type_toot_emoji.go @@ -0,0 +1,1573 @@ +// Code generated by astool. DO NOT EDIT. + +package typeemoji + +import ( + "fmt" + vocab "github.com/go-fed/activity/streams/vocab" + "strings" +) + +// +// +// { +// "content": "Hello world :Kappa:", +// "id": "https://example.com/@alice/hello-world", +// "tag": [ +// { +// "icon": { +// "mediaType": "image/png", +// "type": "Image", +// "url": "https://example.com/files/kappa.png" +// }, +// "id": "https://example.com/emoji/123", +// "name": ":Kappa:", +// "type": "Emoji" +// } +// ], +// "type": "Note" +// } +type TootEmoji struct { + ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty + ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty + ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty + ActivityStreamsBcc vocab.ActivityStreamsBccProperty + ActivityStreamsBto vocab.ActivityStreamsBtoProperty + ActivityStreamsCc vocab.ActivityStreamsCcProperty + ActivityStreamsContent vocab.ActivityStreamsContentProperty + ActivityStreamsContext vocab.ActivityStreamsContextProperty + ActivityStreamsDuration vocab.ActivityStreamsDurationProperty + ActivityStreamsEndTime vocab.ActivityStreamsEndTimeProperty + ActivityStreamsGenerator vocab.ActivityStreamsGeneratorProperty + ActivityStreamsIcon vocab.ActivityStreamsIconProperty + JSONLDId vocab.JSONLDIdProperty + ActivityStreamsImage vocab.ActivityStreamsImageProperty + ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + ActivityStreamsLikes vocab.ActivityStreamsLikesProperty + ActivityStreamsLocation vocab.ActivityStreamsLocationProperty + ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty + ActivityStreamsName vocab.ActivityStreamsNameProperty + ActivityStreamsObject vocab.ActivityStreamsObjectProperty + ActivityStreamsPreview vocab.ActivityStreamsPreviewProperty + ActivityStreamsPublished vocab.ActivityStreamsPublishedProperty + ActivityStreamsReplies vocab.ActivityStreamsRepliesProperty + ActivityStreamsShares vocab.ActivityStreamsSharesProperty + ActivityStreamsStartTime vocab.ActivityStreamsStartTimeProperty + ActivityStreamsSummary vocab.ActivityStreamsSummaryProperty + ActivityStreamsTag vocab.ActivityStreamsTagProperty + ActivityStreamsTo vocab.ActivityStreamsToProperty + JSONLDType vocab.JSONLDTypeProperty + ActivityStreamsUpdated vocab.ActivityStreamsUpdatedProperty + ActivityStreamsUrl vocab.ActivityStreamsUrlProperty + alias string + unknown map[string]interface{} +} + +// DeserializeEmoji creates a Emoji from a map representation that has been +// unmarshalled from a text or binary format. +func DeserializeEmoji(m map[string]interface{}, aliasMap map[string]string) (*TootEmoji, error) { + alias := "" + aliasPrefix := "" + if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok { + alias = a + aliasPrefix = a + ":" + } + this := &TootEmoji{ + 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 != "Emoji" { + return nil, fmt.Errorf("\"type\" property is not of %q type: %s", "Emoji", 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) == "Emoji" { + found = true + break + } + } + if !found { + return nil, fmt.Errorf("could not find a \"type\" property of value %q", "Emoji") + } + // 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.DeserializeAltitudePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsAltitude = p + } + if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsAttachment = p + } + if p, err := mgr.DeserializeAttributedToPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsAttributedTo = p + } + if p, err := mgr.DeserializeAudiencePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsAudience = p + } + if p, err := mgr.DeserializeBccPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsBcc = p + } + if p, err := mgr.DeserializeBtoPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsBto = p + } + if p, err := mgr.DeserializeCcPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsCc = p + } + if p, err := mgr.DeserializeContentPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsContent = p + } + if p, err := mgr.DeserializeContextPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsContext = p + } + if p, err := mgr.DeserializeDurationPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsDuration = p + } + if p, err := mgr.DeserializeEndTimePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsEndTime = p + } + if p, err := mgr.DeserializeGeneratorPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsGenerator = p + } + if p, err := mgr.DeserializeIconPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsIcon = p + } + if p, err := mgr.DeserializeIdPropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDId = p + } + if p, err := mgr.DeserializeImagePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsImage = p + } + if p, err := mgr.DeserializeInReplyToPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsInReplyTo = p + } + if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsLikes = p + } + if p, err := mgr.DeserializeLocationPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsLocation = 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.DeserializeObjectPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsObject = p + } + if p, err := mgr.DeserializePreviewPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsPreview = p + } + if p, err := mgr.DeserializePublishedPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsPublished = p + } + if p, err := mgr.DeserializeRepliesPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsReplies = p + } + if p, err := mgr.DeserializeSharesPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsShares = p + } + if p, err := mgr.DeserializeStartTimePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsStartTime = p + } + if p, err := mgr.DeserializeSummaryPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsSummary = p + } + if p, err := mgr.DeserializeTagPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsTag = p + } + if p, err := mgr.DeserializeToPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsTo = p + } + if p, err := mgr.DeserializeTypePropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDType = p + } + if p, err := mgr.DeserializeUpdatedPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsUpdated = p + } + if p, err := mgr.DeserializeUrlPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsUrl = p + } + // End: Known property deserialization + + // Begin: Unknown deserialization + for k, v := range m { + // Begin: Code that ensures a property name is unknown + if k == "altitude" { + continue + } else if k == "attachment" { + continue + } else if k == "attributedTo" { + continue + } else if k == "audience" { + continue + } else if k == "bcc" { + continue + } else if k == "bto" { + continue + } else if k == "cc" { + continue + } else if k == "content" { + continue + } else if k == "contentMap" { + continue + } else if k == "context" { + continue + } else if k == "duration" { + continue + } else if k == "endTime" { + continue + } else if k == "generator" { + continue + } else if k == "icon" { + continue + } else if k == "id" { + continue + } else if k == "image" { + continue + } else if k == "inReplyTo" { + continue + } else if k == "likes" { + continue + } else if k == "location" { + continue + } else if k == "mediaType" { + continue + } else if k == "name" { + continue + } else if k == "nameMap" { + continue + } else if k == "object" { + continue + } else if k == "preview" { + continue + } else if k == "published" { + continue + } else if k == "replies" { + continue + } else if k == "shares" { + continue + } else if k == "startTime" { + continue + } else if k == "summary" { + continue + } else if k == "summaryMap" { + continue + } else if k == "tag" { + continue + } else if k == "to" { + continue + } else if k == "type" { + continue + } else if k == "updated" { + continue + } else if k == "url" { + continue + } // End: Code that ensures a property name is unknown + + this.unknown[k] = v + } + // End: Unknown deserialization + + return this, nil +} + +// EmojiIsDisjointWith returns true if the other provided type is disjoint with +// the Emoji type. +func EmojiIsDisjointWith(other vocab.Type) bool { + disjointWith := []string{"Link", "Mention"} + for _, disjoint := range disjointWith { + if disjoint == other.GetTypeName() { + return true + } + } + return false +} + +// EmojiIsExtendedBy returns true if the other provided type extends from the +// Emoji type. Note that it returns false if the types are the same; see the +// "IsOrExtendsEmoji" variant instead. +func EmojiIsExtendedBy(other vocab.Type) bool { + // Shortcut implementation: is not extended by anything. + return false +} + +// IsOrExtendsEmoji returns true if the other provided type is the Emoji type or +// extends from the Emoji type. +func IsOrExtendsEmoji(other vocab.Type) bool { + if other.GetTypeName() == "Emoji" { + return true + } + return EmojiIsExtendedBy(other) +} + +// NewTootEmoji creates a new Emoji type +func NewTootEmoji() *TootEmoji { + typeProp := typePropertyConstructor() + typeProp.AppendXMLSchemaString("Emoji") + return &TootEmoji{ + JSONLDType: typeProp, + alias: "", + unknown: make(map[string]interface{}), + } +} + +// TootEmojiExtends returns true if the Emoji type extends from the other type. +func TootEmojiExtends(other vocab.Type) bool { + extensions := []string{"Object"} + for _, ext := range extensions { + if ext == other.GetTypeName() { + return true + } + } + return false +} + +// GetActivityStreamsAltitude returns the "altitude" property if it exists, and +// nil otherwise. +func (this TootEmoji) GetActivityStreamsAltitude() vocab.ActivityStreamsAltitudeProperty { + return this.ActivityStreamsAltitude +} + +// GetActivityStreamsAttachment returns the "attachment" property if it exists, +// and nil otherwise. +func (this TootEmoji) GetActivityStreamsAttachment() vocab.ActivityStreamsAttachmentProperty { + return this.ActivityStreamsAttachment +} + +// GetActivityStreamsAttributedTo returns the "attributedTo" property if it +// exists, and nil otherwise. +func (this TootEmoji) GetActivityStreamsAttributedTo() vocab.ActivityStreamsAttributedToProperty { + return this.ActivityStreamsAttributedTo +} + +// GetActivityStreamsAudience returns the "audience" property if it exists, and +// nil otherwise. +func (this TootEmoji) GetActivityStreamsAudience() vocab.ActivityStreamsAudienceProperty { + return this.ActivityStreamsAudience +} + +// GetActivityStreamsBcc returns the "bcc" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsBcc() vocab.ActivityStreamsBccProperty { + return this.ActivityStreamsBcc +} + +// GetActivityStreamsBto returns the "bto" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsBto() vocab.ActivityStreamsBtoProperty { + return this.ActivityStreamsBto +} + +// GetActivityStreamsCc returns the "cc" property if it exists, and nil otherwise. +func (this TootEmoji) GetActivityStreamsCc() vocab.ActivityStreamsCcProperty { + return this.ActivityStreamsCc +} + +// GetActivityStreamsContent returns the "content" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsContent() vocab.ActivityStreamsContentProperty { + return this.ActivityStreamsContent +} + +// GetActivityStreamsContext returns the "context" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsContext() vocab.ActivityStreamsContextProperty { + return this.ActivityStreamsContext +} + +// GetActivityStreamsDuration returns the "duration" property if it exists, and +// nil otherwise. +func (this TootEmoji) GetActivityStreamsDuration() vocab.ActivityStreamsDurationProperty { + return this.ActivityStreamsDuration +} + +// GetActivityStreamsEndTime returns the "endTime" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsEndTime() vocab.ActivityStreamsEndTimeProperty { + return this.ActivityStreamsEndTime +} + +// GetActivityStreamsGenerator returns the "generator" property if it exists, and +// nil otherwise. +func (this TootEmoji) GetActivityStreamsGenerator() vocab.ActivityStreamsGeneratorProperty { + return this.ActivityStreamsGenerator +} + +// GetActivityStreamsIcon returns the "icon" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsIcon() vocab.ActivityStreamsIconProperty { + return this.ActivityStreamsIcon +} + +// GetActivityStreamsImage returns the "image" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsImage() vocab.ActivityStreamsImageProperty { + return this.ActivityStreamsImage +} + +// GetActivityStreamsInReplyTo returns the "inReplyTo" property if it exists, and +// nil otherwise. +func (this TootEmoji) GetActivityStreamsInReplyTo() vocab.ActivityStreamsInReplyToProperty { + return this.ActivityStreamsInReplyTo +} + +// GetActivityStreamsLikes returns the "likes" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsLikes() vocab.ActivityStreamsLikesProperty { + return this.ActivityStreamsLikes +} + +// GetActivityStreamsLocation returns the "location" property if it exists, and +// nil otherwise. +func (this TootEmoji) GetActivityStreamsLocation() vocab.ActivityStreamsLocationProperty { + return this.ActivityStreamsLocation +} + +// GetActivityStreamsMediaType returns the "mediaType" property if it exists, and +// nil otherwise. +func (this TootEmoji) GetActivityStreamsMediaType() vocab.ActivityStreamsMediaTypeProperty { + return this.ActivityStreamsMediaType +} + +// GetActivityStreamsName returns the "name" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsName() vocab.ActivityStreamsNameProperty { + return this.ActivityStreamsName +} + +// GetActivityStreamsObject returns the "object" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsObject() vocab.ActivityStreamsObjectProperty { + return this.ActivityStreamsObject +} + +// GetActivityStreamsPreview returns the "preview" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsPreview() vocab.ActivityStreamsPreviewProperty { + return this.ActivityStreamsPreview +} + +// GetActivityStreamsPublished returns the "published" property if it exists, and +// nil otherwise. +func (this TootEmoji) GetActivityStreamsPublished() vocab.ActivityStreamsPublishedProperty { + return this.ActivityStreamsPublished +} + +// GetActivityStreamsReplies returns the "replies" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsReplies() vocab.ActivityStreamsRepliesProperty { + return this.ActivityStreamsReplies +} + +// GetActivityStreamsShares returns the "shares" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsShares() vocab.ActivityStreamsSharesProperty { + return this.ActivityStreamsShares +} + +// GetActivityStreamsStartTime returns the "startTime" property if it exists, and +// nil otherwise. +func (this TootEmoji) GetActivityStreamsStartTime() vocab.ActivityStreamsStartTimeProperty { + return this.ActivityStreamsStartTime +} + +// GetActivityStreamsSummary returns the "summary" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsSummary() vocab.ActivityStreamsSummaryProperty { + return this.ActivityStreamsSummary +} + +// GetActivityStreamsTag returns the "tag" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsTag() vocab.ActivityStreamsTagProperty { + return this.ActivityStreamsTag +} + +// GetActivityStreamsTo returns the "to" property if it exists, and nil otherwise. +func (this TootEmoji) GetActivityStreamsTo() vocab.ActivityStreamsToProperty { + return this.ActivityStreamsTo +} + +// GetActivityStreamsUpdated returns the "updated" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsUpdated() vocab.ActivityStreamsUpdatedProperty { + return this.ActivityStreamsUpdated +} + +// GetActivityStreamsUrl returns the "url" property if it exists, and nil +// otherwise. +func (this TootEmoji) GetActivityStreamsUrl() vocab.ActivityStreamsUrlProperty { + return this.ActivityStreamsUrl +} + +// GetJSONLDId returns the "id" property if it exists, and nil otherwise. +func (this TootEmoji) GetJSONLDId() vocab.JSONLDIdProperty { + return this.JSONLDId +} + +// GetJSONLDType returns the "type" property if it exists, and nil otherwise. +func (this TootEmoji) GetJSONLDType() vocab.JSONLDTypeProperty { + return this.JSONLDType +} + +// GetTypeName returns the name of this type. +func (this TootEmoji) GetTypeName() string { + return "Emoji" +} + +// GetUnknownProperties returns the unknown properties for the Emoji 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 TootEmoji) GetUnknownProperties() map[string]interface{} { + return this.unknown +} + +// IsExtending returns true if the Emoji type extends from the other type. +func (this TootEmoji) IsExtending(other vocab.Type) bool { + return TootEmojiExtends(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 TootEmoji) JSONLDContext() map[string]string { + m := map[string]string{"http://joinmastodon.org/ns": this.alias} + m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) + m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) + m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) + m = this.helperJSONLDContext(this.ActivityStreamsBcc, m) + m = this.helperJSONLDContext(this.ActivityStreamsBto, m) + m = this.helperJSONLDContext(this.ActivityStreamsCc, m) + m = this.helperJSONLDContext(this.ActivityStreamsContent, m) + m = this.helperJSONLDContext(this.ActivityStreamsContext, m) + m = this.helperJSONLDContext(this.ActivityStreamsDuration, m) + m = this.helperJSONLDContext(this.ActivityStreamsEndTime, m) + m = this.helperJSONLDContext(this.ActivityStreamsGenerator, m) + m = this.helperJSONLDContext(this.ActivityStreamsIcon, m) + m = this.helperJSONLDContext(this.JSONLDId, m) + m = this.helperJSONLDContext(this.ActivityStreamsImage, m) + m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) + m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) + m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) + m = this.helperJSONLDContext(this.ActivityStreamsName, m) + m = this.helperJSONLDContext(this.ActivityStreamsObject, m) + m = this.helperJSONLDContext(this.ActivityStreamsPreview, m) + m = this.helperJSONLDContext(this.ActivityStreamsPublished, m) + m = this.helperJSONLDContext(this.ActivityStreamsReplies, m) + m = this.helperJSONLDContext(this.ActivityStreamsShares, m) + m = this.helperJSONLDContext(this.ActivityStreamsStartTime, m) + m = this.helperJSONLDContext(this.ActivityStreamsSummary, m) + m = this.helperJSONLDContext(this.ActivityStreamsTag, m) + m = this.helperJSONLDContext(this.ActivityStreamsTo, m) + m = this.helperJSONLDContext(this.JSONLDType, m) + m = this.helperJSONLDContext(this.ActivityStreamsUpdated, m) + m = this.helperJSONLDContext(this.ActivityStreamsUrl, m) + + return m +} + +// LessThan computes if this Emoji is lesser, with an arbitrary but stable +// determination. +func (this TootEmoji) LessThan(o vocab.TootEmoji) bool { + // Begin: Compare known properties + // Compare property "altitude" + if lhs, rhs := this.ActivityStreamsAltitude, o.GetActivityStreamsAltitude(); 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) { + 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 "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 "audience" + if lhs, rhs := this.ActivityStreamsAudience, o.GetActivityStreamsAudience(); 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 "bcc" + if lhs, rhs := this.ActivityStreamsBcc, o.GetActivityStreamsBcc(); 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 "bto" + if lhs, rhs := this.ActivityStreamsBto, o.GetActivityStreamsBto(); 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 "cc" + if lhs, rhs := this.ActivityStreamsCc, o.GetActivityStreamsCc(); 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 "content" + if lhs, rhs := this.ActivityStreamsContent, o.GetActivityStreamsContent(); 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 "context" + if lhs, rhs := this.ActivityStreamsContext, o.GetActivityStreamsContext(); 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 "duration" + if lhs, rhs := this.ActivityStreamsDuration, o.GetActivityStreamsDuration(); 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 "endTime" + if lhs, rhs := this.ActivityStreamsEndTime, o.GetActivityStreamsEndTime(); 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 "generator" + if lhs, rhs := this.ActivityStreamsGenerator, o.GetActivityStreamsGenerator(); 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 "icon" + if lhs, rhs := this.ActivityStreamsIcon, o.GetActivityStreamsIcon(); 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 "image" + if lhs, rhs := this.ActivityStreamsImage, o.GetActivityStreamsImage(); 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 "inReplyTo" + if lhs, rhs := this.ActivityStreamsInReplyTo, o.GetActivityStreamsInReplyTo(); 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) { + 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 "location" + if lhs, rhs := this.ActivityStreamsLocation, o.GetActivityStreamsLocation(); 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 "object" + if lhs, rhs := this.ActivityStreamsObject, o.GetActivityStreamsObject(); 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 "published" + if lhs, rhs := this.ActivityStreamsPublished, o.GetActivityStreamsPublished(); 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 "replies" + if lhs, rhs := this.ActivityStreamsReplies, o.GetActivityStreamsReplies(); 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 "shares" + if lhs, rhs := this.ActivityStreamsShares, o.GetActivityStreamsShares(); 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 "startTime" + if lhs, rhs := this.ActivityStreamsStartTime, o.GetActivityStreamsStartTime(); 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 "tag" + if lhs, rhs := this.ActivityStreamsTag, o.GetActivityStreamsTag(); 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) { + 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 "updated" + if lhs, rhs := this.ActivityStreamsUpdated, o.GetActivityStreamsUpdated(); 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 "url" + if lhs, rhs := this.ActivityStreamsUrl, o.GetActivityStreamsUrl(); 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 TootEmoji) Serialize() (map[string]interface{}, error) { + m := make(map[string]interface{}) + typeName := "Emoji" + if len(this.alias) > 0 { + typeName = this.alias + ":" + "Emoji" + } + m["type"] = typeName + // Begin: Serialize known properties + // Maybe serialize property "altitude" + if this.ActivityStreamsAltitude != nil { + if i, err := this.ActivityStreamsAltitude.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsAltitude.Name()] = i + } + } + // Maybe serialize property "attachment" + if this.ActivityStreamsAttachment != nil { + if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsAttachment.Name()] = i + } + } + // 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 "audience" + if this.ActivityStreamsAudience != nil { + if i, err := this.ActivityStreamsAudience.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsAudience.Name()] = i + } + } + // Maybe serialize property "bcc" + if this.ActivityStreamsBcc != nil { + if i, err := this.ActivityStreamsBcc.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsBcc.Name()] = i + } + } + // Maybe serialize property "bto" + if this.ActivityStreamsBto != nil { + if i, err := this.ActivityStreamsBto.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsBto.Name()] = i + } + } + // Maybe serialize property "cc" + if this.ActivityStreamsCc != nil { + if i, err := this.ActivityStreamsCc.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsCc.Name()] = i + } + } + // Maybe serialize property "content" + if this.ActivityStreamsContent != nil { + if i, err := this.ActivityStreamsContent.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsContent.Name()] = i + } + } + // Maybe serialize property "context" + if this.ActivityStreamsContext != nil { + if i, err := this.ActivityStreamsContext.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsContext.Name()] = i + } + } + // Maybe serialize property "duration" + if this.ActivityStreamsDuration != nil { + if i, err := this.ActivityStreamsDuration.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsDuration.Name()] = i + } + } + // Maybe serialize property "endTime" + if this.ActivityStreamsEndTime != nil { + if i, err := this.ActivityStreamsEndTime.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsEndTime.Name()] = i + } + } + // Maybe serialize property "generator" + if this.ActivityStreamsGenerator != nil { + if i, err := this.ActivityStreamsGenerator.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsGenerator.Name()] = i + } + } + // Maybe serialize property "icon" + if this.ActivityStreamsIcon != nil { + if i, err := this.ActivityStreamsIcon.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsIcon.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 "image" + if this.ActivityStreamsImage != nil { + if i, err := this.ActivityStreamsImage.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsImage.Name()] = i + } + } + // Maybe serialize property "inReplyTo" + if this.ActivityStreamsInReplyTo != nil { + if i, err := this.ActivityStreamsInReplyTo.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsInReplyTo.Name()] = i + } + } + // Maybe serialize property "likes" + if this.ActivityStreamsLikes != nil { + if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsLikes.Name()] = i + } + } + // Maybe serialize property "location" + if this.ActivityStreamsLocation != nil { + if i, err := this.ActivityStreamsLocation.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsLocation.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 "object" + if this.ActivityStreamsObject != nil { + if i, err := this.ActivityStreamsObject.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsObject.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 "published" + if this.ActivityStreamsPublished != nil { + if i, err := this.ActivityStreamsPublished.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsPublished.Name()] = i + } + } + // Maybe serialize property "replies" + if this.ActivityStreamsReplies != nil { + if i, err := this.ActivityStreamsReplies.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsReplies.Name()] = i + } + } + // Maybe serialize property "shares" + if this.ActivityStreamsShares != nil { + if i, err := this.ActivityStreamsShares.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsShares.Name()] = i + } + } + // Maybe serialize property "startTime" + if this.ActivityStreamsStartTime != nil { + if i, err := this.ActivityStreamsStartTime.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsStartTime.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 "tag" + if this.ActivityStreamsTag != nil { + if i, err := this.ActivityStreamsTag.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsTag.Name()] = i + } + } + // Maybe serialize property "to" + if this.ActivityStreamsTo != nil { + if i, err := this.ActivityStreamsTo.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsTo.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 "updated" + if this.ActivityStreamsUpdated != nil { + if i, err := this.ActivityStreamsUpdated.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsUpdated.Name()] = i + } + } + // Maybe serialize property "url" + if this.ActivityStreamsUrl != nil { + if i, err := this.ActivityStreamsUrl.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsUrl.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 +} + +// SetActivityStreamsAltitude sets the "altitude" property. +func (this *TootEmoji) SetActivityStreamsAltitude(i vocab.ActivityStreamsAltitudeProperty) { + this.ActivityStreamsAltitude = i +} + +// SetActivityStreamsAttachment sets the "attachment" property. +func (this *TootEmoji) SetActivityStreamsAttachment(i vocab.ActivityStreamsAttachmentProperty) { + this.ActivityStreamsAttachment = i +} + +// SetActivityStreamsAttributedTo sets the "attributedTo" property. +func (this *TootEmoji) SetActivityStreamsAttributedTo(i vocab.ActivityStreamsAttributedToProperty) { + this.ActivityStreamsAttributedTo = i +} + +// SetActivityStreamsAudience sets the "audience" property. +func (this *TootEmoji) SetActivityStreamsAudience(i vocab.ActivityStreamsAudienceProperty) { + this.ActivityStreamsAudience = i +} + +// SetActivityStreamsBcc sets the "bcc" property. +func (this *TootEmoji) SetActivityStreamsBcc(i vocab.ActivityStreamsBccProperty) { + this.ActivityStreamsBcc = i +} + +// SetActivityStreamsBto sets the "bto" property. +func (this *TootEmoji) SetActivityStreamsBto(i vocab.ActivityStreamsBtoProperty) { + this.ActivityStreamsBto = i +} + +// SetActivityStreamsCc sets the "cc" property. +func (this *TootEmoji) SetActivityStreamsCc(i vocab.ActivityStreamsCcProperty) { + this.ActivityStreamsCc = i +} + +// SetActivityStreamsContent sets the "content" property. +func (this *TootEmoji) SetActivityStreamsContent(i vocab.ActivityStreamsContentProperty) { + this.ActivityStreamsContent = i +} + +// SetActivityStreamsContext sets the "context" property. +func (this *TootEmoji) SetActivityStreamsContext(i vocab.ActivityStreamsContextProperty) { + this.ActivityStreamsContext = i +} + +// SetActivityStreamsDuration sets the "duration" property. +func (this *TootEmoji) SetActivityStreamsDuration(i vocab.ActivityStreamsDurationProperty) { + this.ActivityStreamsDuration = i +} + +// SetActivityStreamsEndTime sets the "endTime" property. +func (this *TootEmoji) SetActivityStreamsEndTime(i vocab.ActivityStreamsEndTimeProperty) { + this.ActivityStreamsEndTime = i +} + +// SetActivityStreamsGenerator sets the "generator" property. +func (this *TootEmoji) SetActivityStreamsGenerator(i vocab.ActivityStreamsGeneratorProperty) { + this.ActivityStreamsGenerator = i +} + +// SetActivityStreamsIcon sets the "icon" property. +func (this *TootEmoji) SetActivityStreamsIcon(i vocab.ActivityStreamsIconProperty) { + this.ActivityStreamsIcon = i +} + +// SetActivityStreamsImage sets the "image" property. +func (this *TootEmoji) SetActivityStreamsImage(i vocab.ActivityStreamsImageProperty) { + this.ActivityStreamsImage = i +} + +// SetActivityStreamsInReplyTo sets the "inReplyTo" property. +func (this *TootEmoji) SetActivityStreamsInReplyTo(i vocab.ActivityStreamsInReplyToProperty) { + this.ActivityStreamsInReplyTo = i +} + +// SetActivityStreamsLikes sets the "likes" property. +func (this *TootEmoji) SetActivityStreamsLikes(i vocab.ActivityStreamsLikesProperty) { + this.ActivityStreamsLikes = i +} + +// SetActivityStreamsLocation sets the "location" property. +func (this *TootEmoji) SetActivityStreamsLocation(i vocab.ActivityStreamsLocationProperty) { + this.ActivityStreamsLocation = i +} + +// SetActivityStreamsMediaType sets the "mediaType" property. +func (this *TootEmoji) SetActivityStreamsMediaType(i vocab.ActivityStreamsMediaTypeProperty) { + this.ActivityStreamsMediaType = i +} + +// SetActivityStreamsName sets the "name" property. +func (this *TootEmoji) SetActivityStreamsName(i vocab.ActivityStreamsNameProperty) { + this.ActivityStreamsName = i +} + +// SetActivityStreamsObject sets the "object" property. +func (this *TootEmoji) SetActivityStreamsObject(i vocab.ActivityStreamsObjectProperty) { + this.ActivityStreamsObject = i +} + +// SetActivityStreamsPreview sets the "preview" property. +func (this *TootEmoji) SetActivityStreamsPreview(i vocab.ActivityStreamsPreviewProperty) { + this.ActivityStreamsPreview = i +} + +// SetActivityStreamsPublished sets the "published" property. +func (this *TootEmoji) SetActivityStreamsPublished(i vocab.ActivityStreamsPublishedProperty) { + this.ActivityStreamsPublished = i +} + +// SetActivityStreamsReplies sets the "replies" property. +func (this *TootEmoji) SetActivityStreamsReplies(i vocab.ActivityStreamsRepliesProperty) { + this.ActivityStreamsReplies = i +} + +// SetActivityStreamsShares sets the "shares" property. +func (this *TootEmoji) SetActivityStreamsShares(i vocab.ActivityStreamsSharesProperty) { + this.ActivityStreamsShares = i +} + +// SetActivityStreamsStartTime sets the "startTime" property. +func (this *TootEmoji) SetActivityStreamsStartTime(i vocab.ActivityStreamsStartTimeProperty) { + this.ActivityStreamsStartTime = i +} + +// SetActivityStreamsSummary sets the "summary" property. +func (this *TootEmoji) SetActivityStreamsSummary(i vocab.ActivityStreamsSummaryProperty) { + this.ActivityStreamsSummary = i +} + +// SetActivityStreamsTag sets the "tag" property. +func (this *TootEmoji) SetActivityStreamsTag(i vocab.ActivityStreamsTagProperty) { + this.ActivityStreamsTag = i +} + +// SetActivityStreamsTo sets the "to" property. +func (this *TootEmoji) SetActivityStreamsTo(i vocab.ActivityStreamsToProperty) { + this.ActivityStreamsTo = i +} + +// SetActivityStreamsUpdated sets the "updated" property. +func (this *TootEmoji) SetActivityStreamsUpdated(i vocab.ActivityStreamsUpdatedProperty) { + this.ActivityStreamsUpdated = i +} + +// SetActivityStreamsUrl sets the "url" property. +func (this *TootEmoji) SetActivityStreamsUrl(i vocab.ActivityStreamsUrlProperty) { + this.ActivityStreamsUrl = i +} + +// SetJSONLDId sets the "id" property. +func (this *TootEmoji) SetJSONLDId(i vocab.JSONLDIdProperty) { + this.JSONLDId = i +} + +// SetJSONLDType sets the "type" property. +func (this *TootEmoji) SetJSONLDType(i vocab.JSONLDTypeProperty) { + this.JSONLDType = i +} + +// VocabularyURI returns the vocabulary's URI as a string. +func (this TootEmoji) 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 TootEmoji) 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/streams/impl/toot/type_identityproof/gen_doc.go b/streams/impl/toot/type_identityproof/gen_doc.go new file mode 100644 index 0000000..a785de5 --- /dev/null +++ b/streams/impl/toot/type_identityproof/gen_doc.go @@ -0,0 +1,17 @@ +// Code generated by astool. DO NOT EDIT. + +// Package typeidentityproof contains the implementation for the IdentityProof +// 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 typeidentityproof diff --git a/streams/impl/toot/type_identityproof/gen_pkg.go b/streams/impl/toot/type_identityproof/gen_pkg.go new file mode 100644 index 0000000..49bfd3e --- /dev/null +++ b/streams/impl/toot/type_identityproof/gen_pkg.go @@ -0,0 +1,179 @@ +// Code generated by astool. DO NOT EDIT. + +package typeidentityproof + +import vocab "github.com/go-fed/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 { + // DeserializeAltitudePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsAltitudeProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeAltitudePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAltitudeProperty, error) + // DeserializeAttachmentPropertyActivityStreams returns the + // deserialization method for the "ActivityStreamsAttachmentProperty" + // non-functional property in the vocabulary "ActivityStreams" + DeserializeAttachmentPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAttachmentProperty, error) + // 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) + // DeserializeAudiencePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsAudienceProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeAudiencePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsAudienceProperty, error) + // DeserializeBccPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsBccProperty" non-functional property + // in the vocabulary "ActivityStreams" + DeserializeBccPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBccProperty, error) + // DeserializeBtoPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsBtoProperty" non-functional property + // in the vocabulary "ActivityStreams" + DeserializeBtoPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsBtoProperty, error) + // DeserializeCcPropertyActivityStreams returns the deserialization method + // for the "ActivityStreamsCcProperty" non-functional property in the + // vocabulary "ActivityStreams" + DeserializeCcPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsCcProperty, error) + // DeserializeContentPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsContentProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeContentPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContentProperty, error) + // DeserializeContextPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsContextProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeContextPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsContextProperty, error) + // DeserializeDurationPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsDurationProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeDurationPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsDurationProperty, error) + // DeserializeEndTimePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsEndTimeProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeEndTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndTimeProperty, error) + // DeserializeGeneratorPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsGeneratorProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeGeneratorPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsGeneratorProperty, error) + // DeserializeIconPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsIconProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeIconPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsIconProperty, 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) + // DeserializeImagePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsImageProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeImagePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsImageProperty, error) + // DeserializeInReplyToPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsInReplyToProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeInReplyToPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsInReplyToProperty, error) + // DeserializeLikesPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsLikesProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeLikesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLikesProperty, error) + // DeserializeLocationPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsLocationProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeLocationPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsLocationProperty, 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) + // DeserializeObjectPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsObjectProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeObjectPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsObjectProperty, 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) + // DeserializePublishedPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsPublishedProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializePublishedPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsPublishedProperty, error) + // DeserializeRepliesPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsRepliesProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeRepliesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsRepliesProperty, error) + // DeserializeSharesPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsSharesProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeSharesPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSharesProperty, error) + // DeserializeSignatureAlgorithmPropertyToot returns the deserialization + // method for the "TootSignatureAlgorithmProperty" non-functional + // property in the vocabulary "Toot" + DeserializeSignatureAlgorithmPropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootSignatureAlgorithmProperty, error) + // DeserializeSignatureValuePropertyToot returns the deserialization + // method for the "TootSignatureValueProperty" non-functional property + // in the vocabulary "Toot" + DeserializeSignatureValuePropertyToot() func(map[string]interface{}, map[string]string) (vocab.TootSignatureValueProperty, error) + // DeserializeStartTimePropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsStartTimeProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeStartTimePropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsStartTimeProperty, 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) + // DeserializeTagPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsTagProperty" non-functional property + // in the vocabulary "ActivityStreams" + DeserializeTagPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsTagProperty, 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) + // 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) + // DeserializeUpdatedPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsUpdatedProperty" non-functional + // property in the vocabulary "ActivityStreams" + DeserializeUpdatedPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUpdatedProperty, error) + // DeserializeUrlPropertyActivityStreams returns the deserialization + // method for the "ActivityStreamsUrlProperty" non-functional property + // in the vocabulary "ActivityStreams" + DeserializeUrlPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsUrlProperty, 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/streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go b/streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go new file mode 100644 index 0000000..d4391e9 --- /dev/null +++ b/streams/impl/toot/type_identityproof/gen_type_toot_identityproof.go @@ -0,0 +1,1642 @@ +// Code generated by astool. DO NOT EDIT. + +package typeidentityproof + +import ( + "fmt" + vocab "github.com/go-fed/activity/streams/vocab" + "strings" +) + +// +// +// null +type TootIdentityProof struct { + ActivityStreamsAltitude vocab.ActivityStreamsAltitudeProperty + ActivityStreamsAttachment vocab.ActivityStreamsAttachmentProperty + ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty + ActivityStreamsAudience vocab.ActivityStreamsAudienceProperty + ActivityStreamsBcc vocab.ActivityStreamsBccProperty + ActivityStreamsBto vocab.ActivityStreamsBtoProperty + ActivityStreamsCc vocab.ActivityStreamsCcProperty + ActivityStreamsContent vocab.ActivityStreamsContentProperty + ActivityStreamsContext vocab.ActivityStreamsContextProperty + ActivityStreamsDuration vocab.ActivityStreamsDurationProperty + ActivityStreamsEndTime vocab.ActivityStreamsEndTimeProperty + ActivityStreamsGenerator vocab.ActivityStreamsGeneratorProperty + ActivityStreamsIcon vocab.ActivityStreamsIconProperty + JSONLDId vocab.JSONLDIdProperty + ActivityStreamsImage vocab.ActivityStreamsImageProperty + ActivityStreamsInReplyTo vocab.ActivityStreamsInReplyToProperty + ActivityStreamsLikes vocab.ActivityStreamsLikesProperty + ActivityStreamsLocation vocab.ActivityStreamsLocationProperty + ActivityStreamsMediaType vocab.ActivityStreamsMediaTypeProperty + ActivityStreamsName vocab.ActivityStreamsNameProperty + ActivityStreamsObject vocab.ActivityStreamsObjectProperty + ActivityStreamsPreview vocab.ActivityStreamsPreviewProperty + ActivityStreamsPublished vocab.ActivityStreamsPublishedProperty + ActivityStreamsReplies vocab.ActivityStreamsRepliesProperty + ActivityStreamsShares vocab.ActivityStreamsSharesProperty + TootSignatureAlgorithm vocab.TootSignatureAlgorithmProperty + TootSignatureValue vocab.TootSignatureValueProperty + ActivityStreamsStartTime vocab.ActivityStreamsStartTimeProperty + ActivityStreamsSummary vocab.ActivityStreamsSummaryProperty + ActivityStreamsTag vocab.ActivityStreamsTagProperty + ActivityStreamsTo vocab.ActivityStreamsToProperty + JSONLDType vocab.JSONLDTypeProperty + ActivityStreamsUpdated vocab.ActivityStreamsUpdatedProperty + ActivityStreamsUrl vocab.ActivityStreamsUrlProperty + alias string + unknown map[string]interface{} +} + +// DeserializeIdentityProof creates a IdentityProof from a map representation that +// has been unmarshalled from a text or binary format. +func DeserializeIdentityProof(m map[string]interface{}, aliasMap map[string]string) (*TootIdentityProof, error) { + alias := "" + aliasPrefix := "" + if a, ok := aliasMap["http://joinmastodon.org/ns"]; ok { + alias = a + aliasPrefix = a + ":" + } + this := &TootIdentityProof{ + 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 != "IdentityProof" { + return nil, fmt.Errorf("\"type\" property is not of %q type: %s", "IdentityProof", 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) == "IdentityProof" { + found = true + break + } + } + if !found { + return nil, fmt.Errorf("could not find a \"type\" property of value %q", "IdentityProof") + } + // 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.DeserializeAltitudePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsAltitude = p + } + if p, err := mgr.DeserializeAttachmentPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsAttachment = p + } + if p, err := mgr.DeserializeAttributedToPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsAttributedTo = p + } + if p, err := mgr.DeserializeAudiencePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsAudience = p + } + if p, err := mgr.DeserializeBccPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsBcc = p + } + if p, err := mgr.DeserializeBtoPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsBto = p + } + if p, err := mgr.DeserializeCcPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsCc = p + } + if p, err := mgr.DeserializeContentPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsContent = p + } + if p, err := mgr.DeserializeContextPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsContext = p + } + if p, err := mgr.DeserializeDurationPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsDuration = p + } + if p, err := mgr.DeserializeEndTimePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsEndTime = p + } + if p, err := mgr.DeserializeGeneratorPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsGenerator = p + } + if p, err := mgr.DeserializeIconPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsIcon = p + } + if p, err := mgr.DeserializeIdPropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDId = p + } + if p, err := mgr.DeserializeImagePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsImage = p + } + if p, err := mgr.DeserializeInReplyToPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsInReplyTo = p + } + if p, err := mgr.DeserializeLikesPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsLikes = p + } + if p, err := mgr.DeserializeLocationPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsLocation = 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.DeserializeObjectPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsObject = p + } + if p, err := mgr.DeserializePreviewPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsPreview = p + } + if p, err := mgr.DeserializePublishedPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsPublished = p + } + if p, err := mgr.DeserializeRepliesPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsReplies = p + } + if p, err := mgr.DeserializeSharesPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsShares = p + } + if p, err := mgr.DeserializeSignatureAlgorithmPropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootSignatureAlgorithm = p + } + if p, err := mgr.DeserializeSignatureValuePropertyToot()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.TootSignatureValue = p + } + if p, err := mgr.DeserializeStartTimePropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsStartTime = p + } + if p, err := mgr.DeserializeSummaryPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsSummary = p + } + if p, err := mgr.DeserializeTagPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsTag = p + } + if p, err := mgr.DeserializeToPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsTo = p + } + if p, err := mgr.DeserializeTypePropertyJSONLD()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.JSONLDType = p + } + if p, err := mgr.DeserializeUpdatedPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsUpdated = p + } + if p, err := mgr.DeserializeUrlPropertyActivityStreams()(m, aliasMap); err != nil { + return nil, err + } else if p != nil { + this.ActivityStreamsUrl = p + } + // End: Known property deserialization + + // Begin: Unknown deserialization + for k, v := range m { + // Begin: Code that ensures a property name is unknown + if k == "altitude" { + continue + } else if k == "attachment" { + continue + } else if k == "attributedTo" { + continue + } else if k == "audience" { + continue + } else if k == "bcc" { + continue + } else if k == "bto" { + continue + } else if k == "cc" { + continue + } else if k == "content" { + continue + } else if k == "contentMap" { + continue + } else if k == "context" { + continue + } else if k == "duration" { + continue + } else if k == "endTime" { + continue + } else if k == "generator" { + continue + } else if k == "icon" { + continue + } else if k == "id" { + continue + } else if k == "image" { + continue + } else if k == "inReplyTo" { + continue + } else if k == "likes" { + continue + } else if k == "location" { + continue + } else if k == "mediaType" { + continue + } else if k == "name" { + continue + } else if k == "nameMap" { + continue + } else if k == "object" { + continue + } else if k == "preview" { + continue + } else if k == "published" { + continue + } else if k == "replies" { + continue + } else if k == "shares" { + continue + } else if k == "signatureAlgorithm" { + continue + } else if k == "signatureValue" { + continue + } else if k == "startTime" { + continue + } else if k == "summary" { + continue + } else if k == "summaryMap" { + continue + } else if k == "tag" { + continue + } else if k == "to" { + continue + } else if k == "type" { + continue + } else if k == "updated" { + continue + } else if k == "url" { + continue + } // End: Code that ensures a property name is unknown + + this.unknown[k] = v + } + // End: Unknown deserialization + + return this, nil +} + +// IdentityProofIsDisjointWith returns true if the other provided type is disjoint +// with the IdentityProof type. +func IdentityProofIsDisjointWith(other vocab.Type) bool { + disjointWith := []string{"Link", "Mention"} + for _, disjoint := range disjointWith { + if disjoint == other.GetTypeName() { + return true + } + } + return false +} + +// IdentityProofIsExtendedBy returns true if the other provided type extends from +// the IdentityProof type. Note that it returns false if the types are the +// same; see the "IsOrExtendsIdentityProof" variant instead. +func IdentityProofIsExtendedBy(other vocab.Type) bool { + // Shortcut implementation: is not extended by anything. + return false +} + +// IsOrExtendsIdentityProof returns true if the other provided type is the +// IdentityProof type or extends from the IdentityProof type. +func IsOrExtendsIdentityProof(other vocab.Type) bool { + if other.GetTypeName() == "IdentityProof" { + return true + } + return IdentityProofIsExtendedBy(other) +} + +// NewTootIdentityProof creates a new IdentityProof type +func NewTootIdentityProof() *TootIdentityProof { + typeProp := typePropertyConstructor() + typeProp.AppendXMLSchemaString("IdentityProof") + return &TootIdentityProof{ + JSONLDType: typeProp, + alias: "", + unknown: make(map[string]interface{}), + } +} + +// TootIdentityProofExtends returns true if the IdentityProof type extends from +// the other type. +func TootIdentityProofExtends(other vocab.Type) bool { + extensions := []string{"Object"} + for _, ext := range extensions { + if ext == other.GetTypeName() { + return true + } + } + return false +} + +// GetActivityStreamsAltitude returns the "altitude" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetActivityStreamsAltitude() vocab.ActivityStreamsAltitudeProperty { + return this.ActivityStreamsAltitude +} + +// GetActivityStreamsAttachment returns the "attachment" property if it exists, +// and nil otherwise. +func (this TootIdentityProof) GetActivityStreamsAttachment() vocab.ActivityStreamsAttachmentProperty { + return this.ActivityStreamsAttachment +} + +// GetActivityStreamsAttributedTo returns the "attributedTo" property if it +// exists, and nil otherwise. +func (this TootIdentityProof) GetActivityStreamsAttributedTo() vocab.ActivityStreamsAttributedToProperty { + return this.ActivityStreamsAttributedTo +} + +// GetActivityStreamsAudience returns the "audience" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetActivityStreamsAudience() vocab.ActivityStreamsAudienceProperty { + return this.ActivityStreamsAudience +} + +// GetActivityStreamsBcc returns the "bcc" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsBcc() vocab.ActivityStreamsBccProperty { + return this.ActivityStreamsBcc +} + +// GetActivityStreamsBto returns the "bto" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsBto() vocab.ActivityStreamsBtoProperty { + return this.ActivityStreamsBto +} + +// GetActivityStreamsCc returns the "cc" property if it exists, and nil otherwise. +func (this TootIdentityProof) GetActivityStreamsCc() vocab.ActivityStreamsCcProperty { + return this.ActivityStreamsCc +} + +// GetActivityStreamsContent returns the "content" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsContent() vocab.ActivityStreamsContentProperty { + return this.ActivityStreamsContent +} + +// GetActivityStreamsContext returns the "context" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsContext() vocab.ActivityStreamsContextProperty { + return this.ActivityStreamsContext +} + +// GetActivityStreamsDuration returns the "duration" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetActivityStreamsDuration() vocab.ActivityStreamsDurationProperty { + return this.ActivityStreamsDuration +} + +// GetActivityStreamsEndTime returns the "endTime" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsEndTime() vocab.ActivityStreamsEndTimeProperty { + return this.ActivityStreamsEndTime +} + +// GetActivityStreamsGenerator returns the "generator" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetActivityStreamsGenerator() vocab.ActivityStreamsGeneratorProperty { + return this.ActivityStreamsGenerator +} + +// GetActivityStreamsIcon returns the "icon" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsIcon() vocab.ActivityStreamsIconProperty { + return this.ActivityStreamsIcon +} + +// GetActivityStreamsImage returns the "image" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsImage() vocab.ActivityStreamsImageProperty { + return this.ActivityStreamsImage +} + +// GetActivityStreamsInReplyTo returns the "inReplyTo" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetActivityStreamsInReplyTo() vocab.ActivityStreamsInReplyToProperty { + return this.ActivityStreamsInReplyTo +} + +// GetActivityStreamsLikes returns the "likes" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsLikes() vocab.ActivityStreamsLikesProperty { + return this.ActivityStreamsLikes +} + +// GetActivityStreamsLocation returns the "location" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetActivityStreamsLocation() vocab.ActivityStreamsLocationProperty { + return this.ActivityStreamsLocation +} + +// GetActivityStreamsMediaType returns the "mediaType" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetActivityStreamsMediaType() vocab.ActivityStreamsMediaTypeProperty { + return this.ActivityStreamsMediaType +} + +// GetActivityStreamsName returns the "name" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsName() vocab.ActivityStreamsNameProperty { + return this.ActivityStreamsName +} + +// GetActivityStreamsObject returns the "object" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsObject() vocab.ActivityStreamsObjectProperty { + return this.ActivityStreamsObject +} + +// GetActivityStreamsPreview returns the "preview" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsPreview() vocab.ActivityStreamsPreviewProperty { + return this.ActivityStreamsPreview +} + +// GetActivityStreamsPublished returns the "published" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetActivityStreamsPublished() vocab.ActivityStreamsPublishedProperty { + return this.ActivityStreamsPublished +} + +// GetActivityStreamsReplies returns the "replies" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsReplies() vocab.ActivityStreamsRepliesProperty { + return this.ActivityStreamsReplies +} + +// GetActivityStreamsShares returns the "shares" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsShares() vocab.ActivityStreamsSharesProperty { + return this.ActivityStreamsShares +} + +// GetActivityStreamsStartTime returns the "startTime" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetActivityStreamsStartTime() vocab.ActivityStreamsStartTimeProperty { + return this.ActivityStreamsStartTime +} + +// GetActivityStreamsSummary returns the "summary" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsSummary() vocab.ActivityStreamsSummaryProperty { + return this.ActivityStreamsSummary +} + +// GetActivityStreamsTag returns the "tag" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsTag() vocab.ActivityStreamsTagProperty { + return this.ActivityStreamsTag +} + +// GetActivityStreamsTo returns the "to" property if it exists, and nil otherwise. +func (this TootIdentityProof) GetActivityStreamsTo() vocab.ActivityStreamsToProperty { + return this.ActivityStreamsTo +} + +// GetActivityStreamsUpdated returns the "updated" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsUpdated() vocab.ActivityStreamsUpdatedProperty { + return this.ActivityStreamsUpdated +} + +// GetActivityStreamsUrl returns the "url" property if it exists, and nil +// otherwise. +func (this TootIdentityProof) GetActivityStreamsUrl() vocab.ActivityStreamsUrlProperty { + return this.ActivityStreamsUrl +} + +// GetJSONLDId returns the "id" property if it exists, and nil otherwise. +func (this TootIdentityProof) GetJSONLDId() vocab.JSONLDIdProperty { + return this.JSONLDId +} + +// GetJSONLDType returns the "type" property if it exists, and nil otherwise. +func (this TootIdentityProof) GetJSONLDType() vocab.JSONLDTypeProperty { + return this.JSONLDType +} + +// GetTootSignatureAlgorithm returns the "signatureAlgorithm" property if it +// exists, and nil otherwise. +func (this TootIdentityProof) GetTootSignatureAlgorithm() vocab.TootSignatureAlgorithmProperty { + return this.TootSignatureAlgorithm +} + +// GetTootSignatureValue returns the "signatureValue" property if it exists, and +// nil otherwise. +func (this TootIdentityProof) GetTootSignatureValue() vocab.TootSignatureValueProperty { + return this.TootSignatureValue +} + +// GetTypeName returns the name of this type. +func (this TootIdentityProof) GetTypeName() string { + return "IdentityProof" +} + +// GetUnknownProperties returns the unknown properties for the IdentityProof 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 TootIdentityProof) GetUnknownProperties() map[string]interface{} { + return this.unknown +} + +// IsExtending returns true if the IdentityProof type extends from the other type. +func (this TootIdentityProof) IsExtending(other vocab.Type) bool { + return TootIdentityProofExtends(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 TootIdentityProof) JSONLDContext() map[string]string { + m := map[string]string{"http://joinmastodon.org/ns": this.alias} + m = this.helperJSONLDContext(this.ActivityStreamsAltitude, m) + m = this.helperJSONLDContext(this.ActivityStreamsAttachment, m) + m = this.helperJSONLDContext(this.ActivityStreamsAttributedTo, m) + m = this.helperJSONLDContext(this.ActivityStreamsAudience, m) + m = this.helperJSONLDContext(this.ActivityStreamsBcc, m) + m = this.helperJSONLDContext(this.ActivityStreamsBto, m) + m = this.helperJSONLDContext(this.ActivityStreamsCc, m) + m = this.helperJSONLDContext(this.ActivityStreamsContent, m) + m = this.helperJSONLDContext(this.ActivityStreamsContext, m) + m = this.helperJSONLDContext(this.ActivityStreamsDuration, m) + m = this.helperJSONLDContext(this.ActivityStreamsEndTime, m) + m = this.helperJSONLDContext(this.ActivityStreamsGenerator, m) + m = this.helperJSONLDContext(this.ActivityStreamsIcon, m) + m = this.helperJSONLDContext(this.JSONLDId, m) + m = this.helperJSONLDContext(this.ActivityStreamsImage, m) + m = this.helperJSONLDContext(this.ActivityStreamsInReplyTo, m) + m = this.helperJSONLDContext(this.ActivityStreamsLikes, m) + m = this.helperJSONLDContext(this.ActivityStreamsLocation, m) + m = this.helperJSONLDContext(this.ActivityStreamsMediaType, m) + m = this.helperJSONLDContext(this.ActivityStreamsName, m) + m = this.helperJSONLDContext(this.ActivityStreamsObject, m) + m = this.helperJSONLDContext(this.ActivityStreamsPreview, m) + m = this.helperJSONLDContext(this.ActivityStreamsPublished, m) + m = this.helperJSONLDContext(this.ActivityStreamsReplies, m) + m = this.helperJSONLDContext(this.ActivityStreamsShares, m) + m = this.helperJSONLDContext(this.TootSignatureAlgorithm, m) + m = this.helperJSONLDContext(this.TootSignatureValue, m) + m = this.helperJSONLDContext(this.ActivityStreamsStartTime, m) + m = this.helperJSONLDContext(this.ActivityStreamsSummary, m) + m = this.helperJSONLDContext(this.ActivityStreamsTag, m) + m = this.helperJSONLDContext(this.ActivityStreamsTo, m) + m = this.helperJSONLDContext(this.JSONLDType, m) + m = this.helperJSONLDContext(this.ActivityStreamsUpdated, m) + m = this.helperJSONLDContext(this.ActivityStreamsUrl, m) + + return m +} + +// LessThan computes if this IdentityProof is lesser, with an arbitrary but stable +// determination. +func (this TootIdentityProof) LessThan(o vocab.TootIdentityProof) bool { + // Begin: Compare known properties + // Compare property "altitude" + if lhs, rhs := this.ActivityStreamsAltitude, o.GetActivityStreamsAltitude(); 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) { + 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 "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 "audience" + if lhs, rhs := this.ActivityStreamsAudience, o.GetActivityStreamsAudience(); 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 "bcc" + if lhs, rhs := this.ActivityStreamsBcc, o.GetActivityStreamsBcc(); 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 "bto" + if lhs, rhs := this.ActivityStreamsBto, o.GetActivityStreamsBto(); 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 "cc" + if lhs, rhs := this.ActivityStreamsCc, o.GetActivityStreamsCc(); 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 "content" + if lhs, rhs := this.ActivityStreamsContent, o.GetActivityStreamsContent(); 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 "context" + if lhs, rhs := this.ActivityStreamsContext, o.GetActivityStreamsContext(); 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 "duration" + if lhs, rhs := this.ActivityStreamsDuration, o.GetActivityStreamsDuration(); 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 "endTime" + if lhs, rhs := this.ActivityStreamsEndTime, o.GetActivityStreamsEndTime(); 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 "generator" + if lhs, rhs := this.ActivityStreamsGenerator, o.GetActivityStreamsGenerator(); 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 "icon" + if lhs, rhs := this.ActivityStreamsIcon, o.GetActivityStreamsIcon(); 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 "image" + if lhs, rhs := this.ActivityStreamsImage, o.GetActivityStreamsImage(); 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 "inReplyTo" + if lhs, rhs := this.ActivityStreamsInReplyTo, o.GetActivityStreamsInReplyTo(); 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) { + 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 "location" + if lhs, rhs := this.ActivityStreamsLocation, o.GetActivityStreamsLocation(); 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 "object" + if lhs, rhs := this.ActivityStreamsObject, o.GetActivityStreamsObject(); 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 "published" + if lhs, rhs := this.ActivityStreamsPublished, o.GetActivityStreamsPublished(); 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 "replies" + if lhs, rhs := this.ActivityStreamsReplies, o.GetActivityStreamsReplies(); 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 "shares" + if lhs, rhs := this.ActivityStreamsShares, o.GetActivityStreamsShares(); 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 "signatureAlgorithm" + if lhs, rhs := this.TootSignatureAlgorithm, o.GetTootSignatureAlgorithm(); 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 "signatureValue" + if lhs, rhs := this.TootSignatureValue, o.GetTootSignatureValue(); 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 "startTime" + if lhs, rhs := this.ActivityStreamsStartTime, o.GetActivityStreamsStartTime(); 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 "tag" + if lhs, rhs := this.ActivityStreamsTag, o.GetActivityStreamsTag(); 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) { + 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 "updated" + if lhs, rhs := this.ActivityStreamsUpdated, o.GetActivityStreamsUpdated(); 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 "url" + if lhs, rhs := this.ActivityStreamsUrl, o.GetActivityStreamsUrl(); 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 TootIdentityProof) Serialize() (map[string]interface{}, error) { + m := make(map[string]interface{}) + typeName := "IdentityProof" + if len(this.alias) > 0 { + typeName = this.alias + ":" + "IdentityProof" + } + m["type"] = typeName + // Begin: Serialize known properties + // Maybe serialize property "altitude" + if this.ActivityStreamsAltitude != nil { + if i, err := this.ActivityStreamsAltitude.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsAltitude.Name()] = i + } + } + // Maybe serialize property "attachment" + if this.ActivityStreamsAttachment != nil { + if i, err := this.ActivityStreamsAttachment.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsAttachment.Name()] = i + } + } + // 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 "audience" + if this.ActivityStreamsAudience != nil { + if i, err := this.ActivityStreamsAudience.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsAudience.Name()] = i + } + } + // Maybe serialize property "bcc" + if this.ActivityStreamsBcc != nil { + if i, err := this.ActivityStreamsBcc.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsBcc.Name()] = i + } + } + // Maybe serialize property "bto" + if this.ActivityStreamsBto != nil { + if i, err := this.ActivityStreamsBto.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsBto.Name()] = i + } + } + // Maybe serialize property "cc" + if this.ActivityStreamsCc != nil { + if i, err := this.ActivityStreamsCc.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsCc.Name()] = i + } + } + // Maybe serialize property "content" + if this.ActivityStreamsContent != nil { + if i, err := this.ActivityStreamsContent.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsContent.Name()] = i + } + } + // Maybe serialize property "context" + if this.ActivityStreamsContext != nil { + if i, err := this.ActivityStreamsContext.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsContext.Name()] = i + } + } + // Maybe serialize property "duration" + if this.ActivityStreamsDuration != nil { + if i, err := this.ActivityStreamsDuration.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsDuration.Name()] = i + } + } + // Maybe serialize property "endTime" + if this.ActivityStreamsEndTime != nil { + if i, err := this.ActivityStreamsEndTime.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsEndTime.Name()] = i + } + } + // Maybe serialize property "generator" + if this.ActivityStreamsGenerator != nil { + if i, err := this.ActivityStreamsGenerator.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsGenerator.Name()] = i + } + } + // Maybe serialize property "icon" + if this.ActivityStreamsIcon != nil { + if i, err := this.ActivityStreamsIcon.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsIcon.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 "image" + if this.ActivityStreamsImage != nil { + if i, err := this.ActivityStreamsImage.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsImage.Name()] = i + } + } + // Maybe serialize property "inReplyTo" + if this.ActivityStreamsInReplyTo != nil { + if i, err := this.ActivityStreamsInReplyTo.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsInReplyTo.Name()] = i + } + } + // Maybe serialize property "likes" + if this.ActivityStreamsLikes != nil { + if i, err := this.ActivityStreamsLikes.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsLikes.Name()] = i + } + } + // Maybe serialize property "location" + if this.ActivityStreamsLocation != nil { + if i, err := this.ActivityStreamsLocation.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsLocation.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 "object" + if this.ActivityStreamsObject != nil { + if i, err := this.ActivityStreamsObject.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsObject.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 "published" + if this.ActivityStreamsPublished != nil { + if i, err := this.ActivityStreamsPublished.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsPublished.Name()] = i + } + } + // Maybe serialize property "replies" + if this.ActivityStreamsReplies != nil { + if i, err := this.ActivityStreamsReplies.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsReplies.Name()] = i + } + } + // Maybe serialize property "shares" + if this.ActivityStreamsShares != nil { + if i, err := this.ActivityStreamsShares.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsShares.Name()] = i + } + } + // Maybe serialize property "signatureAlgorithm" + if this.TootSignatureAlgorithm != nil { + if i, err := this.TootSignatureAlgorithm.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootSignatureAlgorithm.Name()] = i + } + } + // Maybe serialize property "signatureValue" + if this.TootSignatureValue != nil { + if i, err := this.TootSignatureValue.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.TootSignatureValue.Name()] = i + } + } + // Maybe serialize property "startTime" + if this.ActivityStreamsStartTime != nil { + if i, err := this.ActivityStreamsStartTime.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsStartTime.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 "tag" + if this.ActivityStreamsTag != nil { + if i, err := this.ActivityStreamsTag.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsTag.Name()] = i + } + } + // Maybe serialize property "to" + if this.ActivityStreamsTo != nil { + if i, err := this.ActivityStreamsTo.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsTo.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 "updated" + if this.ActivityStreamsUpdated != nil { + if i, err := this.ActivityStreamsUpdated.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsUpdated.Name()] = i + } + } + // Maybe serialize property "url" + if this.ActivityStreamsUrl != nil { + if i, err := this.ActivityStreamsUrl.Serialize(); err != nil { + return nil, err + } else if i != nil { + m[this.ActivityStreamsUrl.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 +} + +// SetActivityStreamsAltitude sets the "altitude" property. +func (this *TootIdentityProof) SetActivityStreamsAltitude(i vocab.ActivityStreamsAltitudeProperty) { + this.ActivityStreamsAltitude = i +} + +// SetActivityStreamsAttachment sets the "attachment" property. +func (this *TootIdentityProof) SetActivityStreamsAttachment(i vocab.ActivityStreamsAttachmentProperty) { + this.ActivityStreamsAttachment = i +} + +// SetActivityStreamsAttributedTo sets the "attributedTo" property. +func (this *TootIdentityProof) SetActivityStreamsAttributedTo(i vocab.ActivityStreamsAttributedToProperty) { + this.ActivityStreamsAttributedTo = i +} + +// SetActivityStreamsAudience sets the "audience" property. +func (this *TootIdentityProof) SetActivityStreamsAudience(i vocab.ActivityStreamsAudienceProperty) { + this.ActivityStreamsAudience = i +} + +// SetActivityStreamsBcc sets the "bcc" property. +func (this *TootIdentityProof) SetActivityStreamsBcc(i vocab.ActivityStreamsBccProperty) { + this.ActivityStreamsBcc = i +} + +// SetActivityStreamsBto sets the "bto" property. +func (this *TootIdentityProof) SetActivityStreamsBto(i vocab.ActivityStreamsBtoProperty) { + this.ActivityStreamsBto = i +} + +// SetActivityStreamsCc sets the "cc" property. +func (this *TootIdentityProof) SetActivityStreamsCc(i vocab.ActivityStreamsCcProperty) { + this.ActivityStreamsCc = i +} + +// SetActivityStreamsContent sets the "content" property. +func (this *TootIdentityProof) SetActivityStreamsContent(i vocab.ActivityStreamsContentProperty) { + this.ActivityStreamsContent = i +} + +// SetActivityStreamsContext sets the "context" property. +func (this *TootIdentityProof) SetActivityStreamsContext(i vocab.ActivityStreamsContextProperty) { + this.ActivityStreamsContext = i +} + +// SetActivityStreamsDuration sets the "duration" property. +func (this *TootIdentityProof) SetActivityStreamsDuration(i vocab.ActivityStreamsDurationProperty) { + this.ActivityStreamsDuration = i +} + +// SetActivityStreamsEndTime sets the "endTime" property. +func (this *TootIdentityProof) SetActivityStreamsEndTime(i vocab.ActivityStreamsEndTimeProperty) { + this.ActivityStreamsEndTime = i +} + +// SetActivityStreamsGenerator sets the "generator" property. +func (this *TootIdentityProof) SetActivityStreamsGenerator(i vocab.ActivityStreamsGeneratorProperty) { + this.ActivityStreamsGenerator = i +} + +// SetActivityStreamsIcon sets the "icon" property. +func (this *TootIdentityProof) SetActivityStreamsIcon(i vocab.ActivityStreamsIconProperty) { + this.ActivityStreamsIcon = i +} + +// SetActivityStreamsImage sets the "image" property. +func (this *TootIdentityProof) SetActivityStreamsImage(i vocab.ActivityStreamsImageProperty) { + this.ActivityStreamsImage = i +} + +// SetActivityStreamsInReplyTo sets the "inReplyTo" property. +func (this *TootIdentityProof) SetActivityStreamsInReplyTo(i vocab.ActivityStreamsInReplyToProperty) { + this.ActivityStreamsInReplyTo = i +} + +// SetActivityStreamsLikes sets the "likes" property. +func (this *TootIdentityProof) SetActivityStreamsLikes(i vocab.ActivityStreamsLikesProperty) { + this.ActivityStreamsLikes = i +} + +// SetActivityStreamsLocation sets the "location" property. +func (this *TootIdentityProof) SetActivityStreamsLocation(i vocab.ActivityStreamsLocationProperty) { + this.ActivityStreamsLocation = i +} + +// SetActivityStreamsMediaType sets the "mediaType" property. +func (this *TootIdentityProof) SetActivityStreamsMediaType(i vocab.ActivityStreamsMediaTypeProperty) { + this.ActivityStreamsMediaType = i +} + +// SetActivityStreamsName sets the "name" property. +func (this *TootIdentityProof) SetActivityStreamsName(i vocab.ActivityStreamsNameProperty) { + this.ActivityStreamsName = i +} + +// SetActivityStreamsObject sets the "object" property. +func (this *TootIdentityProof) SetActivityStreamsObject(i vocab.ActivityStreamsObjectProperty) { + this.ActivityStreamsObject = i +} + +// SetActivityStreamsPreview sets the "preview" property. +func (this *TootIdentityProof) SetActivityStreamsPreview(i vocab.ActivityStreamsPreviewProperty) { + this.ActivityStreamsPreview = i +} + +// SetActivityStreamsPublished sets the "published" property. +func (this *TootIdentityProof) SetActivityStreamsPublished(i vocab.ActivityStreamsPublishedProperty) { + this.ActivityStreamsPublished = i +} + +// SetActivityStreamsReplies sets the "replies" property. +func (this *TootIdentityProof) SetActivityStreamsReplies(i vocab.ActivityStreamsRepliesProperty) { + this.ActivityStreamsReplies = i +} + +// SetActivityStreamsShares sets the "shares" property. +func (this *TootIdentityProof) SetActivityStreamsShares(i vocab.ActivityStreamsSharesProperty) { + this.ActivityStreamsShares = i +} + +// SetActivityStreamsStartTime sets the "startTime" property. +func (this *TootIdentityProof) SetActivityStreamsStartTime(i vocab.ActivityStreamsStartTimeProperty) { + this.ActivityStreamsStartTime = i +} + +// SetActivityStreamsSummary sets the "summary" property. +func (this *TootIdentityProof) SetActivityStreamsSummary(i vocab.ActivityStreamsSummaryProperty) { + this.ActivityStreamsSummary = i +} + +// SetActivityStreamsTag sets the "tag" property. +func (this *TootIdentityProof) SetActivityStreamsTag(i vocab.ActivityStreamsTagProperty) { + this.ActivityStreamsTag = i +} + +// SetActivityStreamsTo sets the "to" property. +func (this *TootIdentityProof) SetActivityStreamsTo(i vocab.ActivityStreamsToProperty) { + this.ActivityStreamsTo = i +} + +// SetActivityStreamsUpdated sets the "updated" property. +func (this *TootIdentityProof) SetActivityStreamsUpdated(i vocab.ActivityStreamsUpdatedProperty) { + this.ActivityStreamsUpdated = i +} + +// SetActivityStreamsUrl sets the "url" property. +func (this *TootIdentityProof) SetActivityStreamsUrl(i vocab.ActivityStreamsUrlProperty) { + this.ActivityStreamsUrl = i +} + +// SetJSONLDId sets the "id" property. +func (this *TootIdentityProof) SetJSONLDId(i vocab.JSONLDIdProperty) { + this.JSONLDId = i +} + +// SetJSONLDType sets the "type" property. +func (this *TootIdentityProof) SetJSONLDType(i vocab.JSONLDTypeProperty) { + this.JSONLDType = i +} + +// SetTootSignatureAlgorithm sets the "signatureAlgorithm" property. +func (this *TootIdentityProof) SetTootSignatureAlgorithm(i vocab.TootSignatureAlgorithmProperty) { + this.TootSignatureAlgorithm = i +} + +// SetTootSignatureValue sets the "signatureValue" property. +func (this *TootIdentityProof) SetTootSignatureValue(i vocab.TootSignatureValueProperty) { + this.TootSignatureValue = i +} + +// VocabularyURI returns the vocabulary's URI as a string. +func (this TootIdentityProof) 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 TootIdentityProof) 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/streams/vocab/gen_property_activitystreams_actor_interface.go b/streams/vocab/gen_property_activitystreams_actor_interface.go index 92fdc5b..faa9f8d 100644 --- a/streams/vocab/gen_property_activitystreams_actor_interface.go +++ b/streams/vocab/gen_property_activitystreams_actor_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsActorPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsActorPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsActorPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -920,6 +941,14 @@ type ActivityStreamsActorProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "actor" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "actor". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "actor". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "actor". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1164,6 +1193,14 @@ type ActivityStreamsActorProperty interface { // "actor". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "actor". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "actor". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "actor". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1361,6 +1398,12 @@ type ActivityStreamsActorProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "actor". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "actor". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "actor". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "actor". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1594,6 +1637,14 @@ type ActivityStreamsActorProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "actor". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "actor". Panics if the index is out of bounds. Invalidates + // all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "actor". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "actor". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_anyOf_interface.go b/streams/vocab/gen_property_activitystreams_anyOf_interface.go index e9b0402..82924d5 100644 --- a/streams/vocab/gen_property_activitystreams_anyOf_interface.go +++ b/streams/vocab/gen_property_activitystreams_anyOf_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsAnyOfPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsAnyOfPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsAnyOfPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -901,6 +922,14 @@ type ActivityStreamsAnyOfProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "anyOf" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "anyOf". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "anyOf". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "anyOf". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1145,6 +1174,14 @@ type ActivityStreamsAnyOfProperty interface { // "anyOf". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "anyOf". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "anyOf". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "anyOf". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1342,6 +1379,12 @@ type ActivityStreamsAnyOfProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "anyOf". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "anyOf". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "anyOf". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "anyOf". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1575,6 +1618,14 @@ type ActivityStreamsAnyOfProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "anyOf". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "anyOf". Panics if the index is out of bounds. Invalidates + // all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "anyOf". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "anyOf". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_attachment_interface.go b/streams/vocab/gen_property_activitystreams_attachment_interface.go index 6f3a33d..8efe65c 100644 --- a/streams/vocab/gen_property_activitystreams_attachment_interface.go +++ b/streams/vocab/gen_property_activitystreams_attachment_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsAttachmentPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsAttachmentPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsAttachmentPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -896,6 +917,14 @@ type ActivityStreamsAttachmentProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "attachment" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "attachment". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "attachment". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "attachment". Invalidates iterators that are // traversing using Prev. Returns an error if the type is not a valid @@ -1145,6 +1174,14 @@ type ActivityStreamsAttachmentProperty interface { // "attachment". Existing elements at that index and higher are // shifted back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "attachment". Existing elements at that index and higher + // are shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "attachment". Existing elements at that index + // and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "attachment". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1347,6 +1384,12 @@ type ActivityStreamsAttachmentProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "attachment". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "attachment". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "attachment". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "attachment". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1580,6 +1623,14 @@ type ActivityStreamsAttachmentProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "attachment". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "attachment". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "attachment". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "attachment". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. Panics if diff --git a/streams/vocab/gen_property_activitystreams_attributedTo_interface.go b/streams/vocab/gen_property_activitystreams_attributedTo_interface.go index 56647b8..966d7a3 100644 --- a/streams/vocab/gen_property_activitystreams_attributedTo_interface.go +++ b/streams/vocab/gen_property_activitystreams_attributedTo_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsAttributedToPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsAttributedToPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsAttributedToPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -912,6 +933,14 @@ type ActivityStreamsAttributedToProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "attributedTo" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "attributedTo". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "attributedTo". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "attributedTo". Invalidates iterators that are // traversing using Prev. Returns an error if the type is not a valid @@ -1161,6 +1190,14 @@ type ActivityStreamsAttributedToProperty interface { // "attributedTo". Existing elements at that index and higher are // shifted back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "attributedTo". Existing elements at that index and higher + // are shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "attributedTo". Existing elements at that + // index and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "attributedTo". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1363,6 +1400,12 @@ type ActivityStreamsAttributedToProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "attributedTo". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "attributedTo". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "attributedTo". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "attributedTo". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1596,6 +1639,14 @@ type ActivityStreamsAttributedToProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "attributedTo". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "attributedTo". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "attributedTo". Panics if the index is out + // of bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "attributedTo". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. diff --git a/streams/vocab/gen_property_activitystreams_audience_interface.go b/streams/vocab/gen_property_activitystreams_audience_interface.go index c131205..7e83024 100644 --- a/streams/vocab/gen_property_activitystreams_audience_interface.go +++ b/streams/vocab/gen_property_activitystreams_audience_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsAudiencePropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsAudiencePropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsAudiencePropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -896,6 +917,14 @@ type ActivityStreamsAudienceProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "audience" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "audience". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "audience". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "audience". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1145,6 +1174,14 @@ type ActivityStreamsAudienceProperty interface { // "audience". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "audience". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "audience". Existing elements at that index + // and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "audience". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1346,6 +1383,12 @@ type ActivityStreamsAudienceProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "audience". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "audience". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "audience". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "audience". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1579,6 +1622,14 @@ type ActivityStreamsAudienceProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "audience". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "audience". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "audience". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "audience". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_bcc_interface.go b/streams/vocab/gen_property_activitystreams_bcc_interface.go index 45f75a3..9233e88 100644 --- a/streams/vocab/gen_property_activitystreams_bcc_interface.go +++ b/streams/vocab/gen_property_activitystreams_bcc_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsBccPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsBccPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsBccPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -894,6 +915,14 @@ type ActivityStreamsBccProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "bcc" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "bcc". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "bcc". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "bcc". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for @@ -1135,6 +1164,14 @@ type ActivityStreamsBccProperty interface { // "bcc". Existing elements at that index and higher are shifted back // once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "bcc". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "bcc". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "bcc". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1332,6 +1369,12 @@ type ActivityStreamsBccProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "bcc". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "bcc". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "bcc". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "bcc". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1565,6 +1608,14 @@ type ActivityStreamsBccProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "bcc". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "bcc". Panics if the index is out of bounds. Invalidates + // all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "bcc". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "bcc". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_bto_interface.go b/streams/vocab/gen_property_activitystreams_bto_interface.go index b34301d..70e1ca2 100644 --- a/streams/vocab/gen_property_activitystreams_bto_interface.go +++ b/streams/vocab/gen_property_activitystreams_bto_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsBtoPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsBtoPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsBtoPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -894,6 +915,14 @@ type ActivityStreamsBtoProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "bto" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "bto". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "bto". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "bto". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for @@ -1135,6 +1164,14 @@ type ActivityStreamsBtoProperty interface { // "bto". Existing elements at that index and higher are shifted back // once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "bto". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "bto". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "bto". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1332,6 +1369,12 @@ type ActivityStreamsBtoProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "bto". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "bto". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "bto". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "bto". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1565,6 +1608,14 @@ type ActivityStreamsBtoProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "bto". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "bto". Panics if the index is out of bounds. Invalidates + // all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "bto". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "bto". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_cc_interface.go b/streams/vocab/gen_property_activitystreams_cc_interface.go index c2b28ee..353c936 100644 --- a/streams/vocab/gen_property_activitystreams_cc_interface.go +++ b/streams/vocab/gen_property_activitystreams_cc_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsCcPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsCcPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsCcPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -894,6 +915,13 @@ type ActivityStreamsCcProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "cc" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "cc". Invalidates iterators that are traversing using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "cc". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "cc". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for @@ -1135,6 +1163,14 @@ type ActivityStreamsCcProperty interface { // Existing elements at that index and higher are shifted back once. // Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "cc". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "cc". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "cc". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1331,6 +1367,12 @@ type ActivityStreamsCcProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "cc". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "cc". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "cc". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "cc". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1564,6 +1606,14 @@ type ActivityStreamsCcProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "cc". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "cc". Panics if the index is out of bounds. Invalidates + // all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "cc". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "cc". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_closed_interface.go b/streams/vocab/gen_property_activitystreams_closed_interface.go index 2287ab9..00c6b6d 100644 --- a/streams/vocab/gen_property_activitystreams_closed_interface.go +++ b/streams/vocab/gen_property_activitystreams_closed_interface.go @@ -231,6 +231,13 @@ type ActivityStreamsClosedPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -480,6 +487,14 @@ type ActivityStreamsClosedPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() bool // IsXMLSchemaBoolean returns true if this property has a type of // "boolean". When true, use the GetXMLSchemaBoolean and // SetXMLSchemaBoolean methods to access and set this property. @@ -676,6 +691,12 @@ type ActivityStreamsClosedPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -915,6 +936,14 @@ type ActivityStreamsClosedProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "closed" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "closed". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "closed". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "closed". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1167,6 +1196,14 @@ type ActivityStreamsClosedProperty interface { // "closed". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "closed". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "closed". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "closed". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1372,6 +1409,12 @@ type ActivityStreamsClosedProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "closed". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "closed". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "closed". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "closed". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1611,6 +1654,14 @@ type ActivityStreamsClosedProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "closed". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "closed". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "closed". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "closed". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_context_interface.go b/streams/vocab/gen_property_activitystreams_context_interface.go index 9fb9904..f1a7cb5 100644 --- a/streams/vocab/gen_property_activitystreams_context_interface.go +++ b/streams/vocab/gen_property_activitystreams_context_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsContextPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsContextPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsContextPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -908,6 +929,14 @@ type ActivityStreamsContextProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "context" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "context". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "context". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "context". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1152,6 +1181,14 @@ type ActivityStreamsContextProperty interface { // "context". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "context". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "context". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "context". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1353,6 +1390,12 @@ type ActivityStreamsContextProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "context". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "context". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "context". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "context". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1586,6 +1629,14 @@ type ActivityStreamsContextProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "context". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "context". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "context". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "context". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_describes_interface.go b/streams/vocab/gen_property_activitystreams_describes_interface.go index 07c9840..b9cb846 100644 --- a/streams/vocab/gen_property_activitystreams_describes_interface.go +++ b/streams/vocab/gen_property_activitystreams_describes_interface.go @@ -234,6 +234,13 @@ type ActivityStreamsDescribesProperty interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -467,6 +474,14 @@ type ActivityStreamsDescribesProperty interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -650,6 +665,12 @@ type ActivityStreamsDescribesProperty interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 diff --git a/streams/vocab/gen_property_activitystreams_formerType_interface.go b/streams/vocab/gen_property_activitystreams_formerType_interface.go index e12b51f..005e804 100644 --- a/streams/vocab/gen_property_activitystreams_formerType_interface.go +++ b/streams/vocab/gen_property_activitystreams_formerType_interface.go @@ -220,6 +220,13 @@ type ActivityStreamsFormerTypePropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -457,6 +464,14 @@ type ActivityStreamsFormerTypePropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() bool // IsXMLSchemaString returns true if this property has a type of "string". // When true, use the GetXMLSchemaString and SetXMLSchemaString // methods to access and set this property. @@ -643,6 +658,12 @@ type ActivityStreamsFormerTypePropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -873,6 +894,14 @@ type ActivityStreamsFormerTypeProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "formerType" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "formerType". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "formerType". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "formerType". Invalidates iterators that are // traversing using Prev. Returns an error if the type is not a valid @@ -1118,6 +1147,14 @@ type ActivityStreamsFormerTypeProperty interface { // "formerType". Existing elements at that index and higher are // shifted back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "formerType". Existing elements at that index and higher + // are shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "formerType". Existing elements at that index + // and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "formerType". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1318,6 +1355,12 @@ type ActivityStreamsFormerTypeProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "formerType". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "formerType". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "formerType". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "formerType". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1546,6 +1589,14 @@ type ActivityStreamsFormerTypeProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "formerType". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "formerType". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "formerType". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "formerType". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. Panics if diff --git a/streams/vocab/gen_property_activitystreams_generator_interface.go b/streams/vocab/gen_property_activitystreams_generator_interface.go index e9649b6..a4495d3 100644 --- a/streams/vocab/gen_property_activitystreams_generator_interface.go +++ b/streams/vocab/gen_property_activitystreams_generator_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsGeneratorPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsGeneratorPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsGeneratorPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -894,6 +915,14 @@ type ActivityStreamsGeneratorProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "generator" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "generator". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "generator". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "generator". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1143,6 +1172,14 @@ type ActivityStreamsGeneratorProperty interface { // "generator". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "generator". Existing elements at that index and higher + // are shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "generator". Existing elements at that index + // and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "generator". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1345,6 +1382,12 @@ type ActivityStreamsGeneratorProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "generator". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "generator". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "generator". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "generator". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1578,6 +1621,14 @@ type ActivityStreamsGeneratorProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "generator". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "generator". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "generator". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "generator". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. Panics if diff --git a/streams/vocab/gen_property_activitystreams_inReplyTo_interface.go b/streams/vocab/gen_property_activitystreams_inReplyTo_interface.go index 1baa442..ac89cb2 100644 --- a/streams/vocab/gen_property_activitystreams_inReplyTo_interface.go +++ b/streams/vocab/gen_property_activitystreams_inReplyTo_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsInReplyToPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsInReplyToPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsInReplyToPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -903,6 +924,14 @@ type ActivityStreamsInReplyToProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "inReplyTo" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "inReplyTo". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "inReplyTo". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "inReplyTo". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1152,6 +1181,14 @@ type ActivityStreamsInReplyToProperty interface { // "inReplyTo". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "inReplyTo". Existing elements at that index and higher + // are shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "inReplyTo". Existing elements at that index + // and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "inReplyTo". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1354,6 +1391,12 @@ type ActivityStreamsInReplyToProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "inReplyTo". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "inReplyTo". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "inReplyTo". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "inReplyTo". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1587,6 +1630,14 @@ type ActivityStreamsInReplyToProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "inReplyTo". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "inReplyTo". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "inReplyTo". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "inReplyTo". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. Panics if diff --git a/streams/vocab/gen_property_activitystreams_instrument_interface.go b/streams/vocab/gen_property_activitystreams_instrument_interface.go index 0aba5be..328607f 100644 --- a/streams/vocab/gen_property_activitystreams_instrument_interface.go +++ b/streams/vocab/gen_property_activitystreams_instrument_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsInstrumentPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsInstrumentPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsInstrumentPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -900,6 +921,14 @@ type ActivityStreamsInstrumentProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "instrument" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "instrument". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "instrument". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "instrument". Invalidates iterators that are // traversing using Prev. Returns an error if the type is not a valid @@ -1149,6 +1178,14 @@ type ActivityStreamsInstrumentProperty interface { // "instrument". Existing elements at that index and higher are // shifted back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "instrument". Existing elements at that index and higher + // are shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "instrument". Existing elements at that index + // and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "instrument". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1351,6 +1388,12 @@ type ActivityStreamsInstrumentProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "instrument". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "instrument". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "instrument". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "instrument". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1584,6 +1627,14 @@ type ActivityStreamsInstrumentProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "instrument". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "instrument". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "instrument". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "instrument". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. Panics if diff --git a/streams/vocab/gen_property_activitystreams_items_interface.go b/streams/vocab/gen_property_activitystreams_items_interface.go index 58e9af8..702f4c8 100644 --- a/streams/vocab/gen_property_activitystreams_items_interface.go +++ b/streams/vocab/gen_property_activitystreams_items_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsItemsPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsItemsPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsItemsPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -901,6 +922,14 @@ type ActivityStreamsItemsProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "items" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "items". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "items". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "items". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1145,6 +1174,14 @@ type ActivityStreamsItemsProperty interface { // "items". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "items". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "items". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "items". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1342,6 +1379,12 @@ type ActivityStreamsItemsProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "items". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "items". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "items". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "items". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1575,6 +1618,14 @@ type ActivityStreamsItemsProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "items". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "items". Panics if the index is out of bounds. Invalidates + // all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "items". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "items". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_location_interface.go b/streams/vocab/gen_property_activitystreams_location_interface.go index 5689f05..83395bf 100644 --- a/streams/vocab/gen_property_activitystreams_location_interface.go +++ b/streams/vocab/gen_property_activitystreams_location_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsLocationPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsLocationPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsLocationPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -898,6 +919,14 @@ type ActivityStreamsLocationProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "location" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "location". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "location". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "location". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1147,6 +1176,14 @@ type ActivityStreamsLocationProperty interface { // "location". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "location". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "location". Existing elements at that index + // and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "location". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1348,6 +1385,12 @@ type ActivityStreamsLocationProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "location". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "location". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "location". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "location". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1581,6 +1624,14 @@ type ActivityStreamsLocationProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "location". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "location". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "location". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "location". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_object_interface.go b/streams/vocab/gen_property_activitystreams_object_interface.go index 33079b4..c505483 100644 --- a/streams/vocab/gen_property_activitystreams_object_interface.go +++ b/streams/vocab/gen_property_activitystreams_object_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsObjectPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsObjectPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsObjectPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -919,6 +940,14 @@ type ActivityStreamsObjectProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "object" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "object". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "object". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "object". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1163,6 +1192,14 @@ type ActivityStreamsObjectProperty interface { // "object". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "object". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "object". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "object". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1360,6 +1397,12 @@ type ActivityStreamsObjectProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "object". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "object". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "object". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "object". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1593,6 +1636,14 @@ type ActivityStreamsObjectProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "object". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "object". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "object". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "object". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_oneOf_interface.go b/streams/vocab/gen_property_activitystreams_oneOf_interface.go index ad69018..4dcb4e0 100644 --- a/streams/vocab/gen_property_activitystreams_oneOf_interface.go +++ b/streams/vocab/gen_property_activitystreams_oneOf_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsOneOfPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsOneOfPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsOneOfPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -901,6 +922,14 @@ type ActivityStreamsOneOfProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "oneOf" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "oneOf". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "oneOf". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "oneOf". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1145,6 +1174,14 @@ type ActivityStreamsOneOfProperty interface { // "oneOf". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "oneOf". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "oneOf". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "oneOf". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1342,6 +1379,12 @@ type ActivityStreamsOneOfProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "oneOf". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "oneOf". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "oneOf". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "oneOf". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1575,6 +1618,14 @@ type ActivityStreamsOneOfProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "oneOf". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "oneOf". Panics if the index is out of bounds. Invalidates + // all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "oneOf". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "oneOf". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_orderedItems_interface.go b/streams/vocab/gen_property_activitystreams_orderedItems_interface.go index be7577f..102f039 100644 --- a/streams/vocab/gen_property_activitystreams_orderedItems_interface.go +++ b/streams/vocab/gen_property_activitystreams_orderedItems_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsOrderedItemsPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsOrderedItemsPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsOrderedItemsPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -902,6 +923,14 @@ type ActivityStreamsOrderedItemsProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "orderedItems" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "orderedItems". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "orderedItems". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "orderedItems". Invalidates iterators that are // traversing using Prev. Returns an error if the type is not a valid @@ -1151,6 +1180,14 @@ type ActivityStreamsOrderedItemsProperty interface { // "orderedItems". Existing elements at that index and higher are // shifted back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "orderedItems". Existing elements at that index and higher + // are shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "orderedItems". Existing elements at that + // index and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "orderedItems". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1353,6 +1390,12 @@ type ActivityStreamsOrderedItemsProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "orderedItems". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "orderedItems". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "orderedItems". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "orderedItems". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1586,6 +1629,14 @@ type ActivityStreamsOrderedItemsProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "orderedItems". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "orderedItems". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "orderedItems". Panics if the index is out + // of bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "orderedItems". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. diff --git a/streams/vocab/gen_property_activitystreams_origin_interface.go b/streams/vocab/gen_property_activitystreams_origin_interface.go index a53bab5..2d99560 100644 --- a/streams/vocab/gen_property_activitystreams_origin_interface.go +++ b/streams/vocab/gen_property_activitystreams_origin_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsOriginPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsOriginPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsOriginPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -902,6 +923,14 @@ type ActivityStreamsOriginProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "origin" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "origin". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "origin". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "origin". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1146,6 +1175,14 @@ type ActivityStreamsOriginProperty interface { // "origin". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "origin". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "origin". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "origin". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1343,6 +1380,12 @@ type ActivityStreamsOriginProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "origin". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "origin". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "origin". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "origin". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1576,6 +1619,14 @@ type ActivityStreamsOriginProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "origin". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "origin". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "origin". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "origin". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_preview_interface.go b/streams/vocab/gen_property_activitystreams_preview_interface.go index b537564..522c517 100644 --- a/streams/vocab/gen_property_activitystreams_preview_interface.go +++ b/streams/vocab/gen_property_activitystreams_preview_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsPreviewPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsPreviewPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsPreviewPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -899,6 +920,14 @@ type ActivityStreamsPreviewProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "preview" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "preview". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "preview". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "preview". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1143,6 +1172,14 @@ type ActivityStreamsPreviewProperty interface { // "preview". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "preview". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "preview". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "preview". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1344,6 +1381,12 @@ type ActivityStreamsPreviewProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "preview". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "preview". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "preview". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "preview". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1577,6 +1620,14 @@ type ActivityStreamsPreviewProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "preview". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "preview". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "preview". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "preview". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_relationship_interface.go b/streams/vocab/gen_property_activitystreams_relationship_interface.go index 9c919df..562faaa 100644 --- a/streams/vocab/gen_property_activitystreams_relationship_interface.go +++ b/streams/vocab/gen_property_activitystreams_relationship_interface.go @@ -220,6 +220,13 @@ type ActivityStreamsRelationshipPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -453,6 +460,14 @@ type ActivityStreamsRelationshipPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -635,6 +650,12 @@ type ActivityStreamsRelationshipPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -871,6 +892,14 @@ type ActivityStreamsRelationshipProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "relationship" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "relationship". Invalidates iterators that are traversing + // using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "relationship". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "relationship". Invalidates iterators that are // traversing using Prev. Returns an error if the type is not a valid @@ -1112,6 +1141,14 @@ type ActivityStreamsRelationshipProperty interface { // "relationship". Existing elements at that index and higher are // shifted back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "relationship". Existing elements at that index and higher + // are shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "relationship". Existing elements at that + // index and higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "relationship". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1308,6 +1345,12 @@ type ActivityStreamsRelationshipProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "relationship". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "relationship". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "relationship". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "relationship". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. @@ -1533,6 +1576,14 @@ type ActivityStreamsRelationshipProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "relationship". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "relationship". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "relationship". Panics if the index is out + // of bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "relationship". Invalidates all iterators. Returns an // error if the type is not a valid one to set for this property. diff --git a/streams/vocab/gen_property_activitystreams_result_interface.go b/streams/vocab/gen_property_activitystreams_result_interface.go index 94d5c76..99d3396 100644 --- a/streams/vocab/gen_property_activitystreams_result_interface.go +++ b/streams/vocab/gen_property_activitystreams_result_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsResultPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsResultPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsResultPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -900,6 +921,14 @@ type ActivityStreamsResultProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "result" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "result". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "result". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "result". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1144,6 +1173,14 @@ type ActivityStreamsResultProperty interface { // "result". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "result". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "result". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "result". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1341,6 +1378,12 @@ type ActivityStreamsResultProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "result". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "result". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "result". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "result". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1574,6 +1617,14 @@ type ActivityStreamsResultProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "result". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "result". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "result". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "result". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_subject_interface.go b/streams/vocab/gen_property_activitystreams_subject_interface.go index e2a67ec..705a399 100644 --- a/streams/vocab/gen_property_activitystreams_subject_interface.go +++ b/streams/vocab/gen_property_activitystreams_subject_interface.go @@ -247,6 +247,13 @@ type ActivityStreamsSubjectProperty interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -488,6 +495,14 @@ type ActivityStreamsSubjectProperty interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -677,6 +692,12 @@ type ActivityStreamsSubjectProperty interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 diff --git a/streams/vocab/gen_property_activitystreams_tag_interface.go b/streams/vocab/gen_property_activitystreams_tag_interface.go index b267890..c37e020 100644 --- a/streams/vocab/gen_property_activitystreams_tag_interface.go +++ b/streams/vocab/gen_property_activitystreams_tag_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsTagPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsTagPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsTagPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -898,6 +919,14 @@ type ActivityStreamsTagProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "tag" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "tag". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "tag". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "tag". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for @@ -1139,6 +1168,14 @@ type ActivityStreamsTagProperty interface { // "tag". Existing elements at that index and higher are shifted back // once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "tag". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "tag". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "tag". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1336,6 +1373,12 @@ type ActivityStreamsTagProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "tag". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "tag". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "tag". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "tag". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1569,6 +1612,14 @@ type ActivityStreamsTagProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "tag". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "tag". Panics if the index is out of bounds. Invalidates + // all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "tag". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "tag". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_target_interface.go b/streams/vocab/gen_property_activitystreams_target_interface.go index 196821a..50146c8 100644 --- a/streams/vocab/gen_property_activitystreams_target_interface.go +++ b/streams/vocab/gen_property_activitystreams_target_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsTargetPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsTargetPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsTargetPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -908,6 +929,14 @@ type ActivityStreamsTargetProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "target" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "target". Invalidates iterators that are traversing using + // Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "target". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "target". Invalidates iterators that are traversing // using Prev. Returns an error if the type is not a valid one to set @@ -1152,6 +1181,14 @@ type ActivityStreamsTargetProperty interface { // "target". Existing elements at that index and higher are shifted // back once. Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "target". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "target". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "target". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1349,6 +1386,12 @@ type ActivityStreamsTargetProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "target". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "target". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "target". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "target". Invalidates all iterators. Returns an error // if the type is not a valid one to set for this property. @@ -1582,6 +1625,14 @@ type ActivityStreamsTargetProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "target". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "target". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "target". Panics if the index is out of + // bounds. Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "target". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_activitystreams_to_interface.go b/streams/vocab/gen_property_activitystreams_to_interface.go index 9793af5..d25e61c 100644 --- a/streams/vocab/gen_property_activitystreams_to_interface.go +++ b/streams/vocab/gen_property_activitystreams_to_interface.go @@ -228,6 +228,13 @@ type ActivityStreamsToPropertyIterator interface { // GetIRI returns the IRI of this property. When IsIRI returns false, // GetIRI will return an arbitrary value. GetIRI() *url.URL + // GetTootEmoji returns the value of this property. When IsTootEmoji + // returns false, GetTootEmoji will return an arbitrary value. + GetTootEmoji() TootEmoji + // GetTootIdentityProof returns the value of this property. When + // IsTootIdentityProof returns false, GetTootIdentityProof will return + // an arbitrary value. + GetTootIdentityProof() TootIdentityProof // 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. @@ -469,6 +476,14 @@ type ActivityStreamsToPropertyIterator interface { // IsIRI returns true if this property is an IRI. When true, use GetIRI // and SetIRI to access and set this property IsIRI() bool + // IsTootEmoji returns true if this property has a type of "Emoji". When + // true, use the GetTootEmoji and SetTootEmoji methods to access and + // set this property. + IsTootEmoji() bool + // IsTootIdentityProof returns true if this property has a type of + // "IdentityProof". When true, use the GetTootIdentityProof and + // SetTootIdentityProof methods to access and set this property. + IsTootIdentityProof() 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 @@ -657,6 +672,12 @@ type ActivityStreamsToPropertyIterator interface { // SetIRI sets the value of this property. Calling IsIRI afterwards // returns true. SetIRI(v *url.URL) + // SetTootEmoji sets the value of this property. Calling IsTootEmoji + // afterwards returns true. + SetTootEmoji(v TootEmoji) + // SetTootIdentityProof sets the value of this property. Calling + // IsTootIdentityProof afterwards returns true. + SetTootIdentityProof(v TootIdentityProof) // 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 @@ -894,6 +915,13 @@ type ActivityStreamsToProperty interface { // AppendIRI appends an IRI value to the back of a list of the property // "to" AppendIRI(v *url.URL) + // AppendTootEmoji appends a Emoji value to the back of a list of the + // property "to". Invalidates iterators that are traversing using Prev. + AppendTootEmoji(v TootEmoji) + // AppendTootIdentityProof appends a IdentityProof value to the back of a + // list of the property "to". Invalidates iterators that are + // traversing using Prev. + AppendTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "to". Invalidates iterators that are traversing using // Prev. Returns an error if the type is not a valid one to set for @@ -1135,6 +1163,14 @@ type ActivityStreamsToProperty interface { // Existing elements at that index and higher are shifted back once. // Invalidates all iterators. InsertIRI(idx int, v *url.URL) + // InsertTootEmoji inserts a Emoji value at the specified index for a + // property "to". Existing elements at that index and higher are + // shifted back once. Invalidates all iterators. + InsertTootEmoji(idx int, v TootEmoji) + // InsertTootIdentityProof inserts a IdentityProof value at the specified + // index for a property "to". Existing elements at that index and + // higher are shifted back once. Invalidates all iterators. + InsertTootIdentityProof(idx int, v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "to". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1331,6 +1367,12 @@ type ActivityStreamsToProperty interface { // PrependIRI prepends an IRI value to the front of a list of the property // "to". PrependIRI(v *url.URL) + // PrependTootEmoji prepends a Emoji value to the front of a list of the + // property "to". Invalidates all iterators. + PrependTootEmoji(v TootEmoji) + // PrependTootIdentityProof prepends a IdentityProof value to the front of + // a list of the property "to". Invalidates all iterators. + PrependTootIdentityProof(v TootIdentityProof) // PrependType prepends an arbitrary type value to the front of a list of // the property "to". Invalidates all iterators. Returns an error if // the type is not a valid one to set for this property. @@ -1564,6 +1606,14 @@ type ActivityStreamsToProperty interface { // SetIRI sets an IRI value to be at the specified index for the property // "to". Panics if the index is out of bounds. SetIRI(idx int, v *url.URL) + // SetTootEmoji sets a Emoji value to be at the specified index for the + // property "to". Panics if the index is out of bounds. Invalidates + // all iterators. + SetTootEmoji(idx int, v TootEmoji) + // SetTootIdentityProof sets a IdentityProof value to be at the specified + // index for the property "to". Panics if the index is out of bounds. + // Invalidates all iterators. + SetTootIdentityProof(idx int, v TootIdentityProof) // SetType sets an arbitrary type value to the specified index of the // property "to". Invalidates all iterators. Returns an error if the // type is not a valid one to set for this property. Panics if the diff --git a/streams/vocab/gen_property_toot_blurhash_interface.go b/streams/vocab/gen_property_toot_blurhash_interface.go new file mode 100644 index 0000000..94e0785 --- /dev/null +++ b/streams/vocab/gen_property_toot_blurhash_interface.go @@ -0,0 +1,54 @@ +// Code generated by astool. DO NOT EDIT. + +package vocab + +import "net/url" + +// +// +// null +type TootBlurhashProperty interface { + // Clear ensures no value of this property is set. Calling + // IsXMLSchemaString afterwards will return false. + Clear() + // Get returns the value of this property. When IsXMLSchemaString returns + // false, Get will return any arbitrary value. + Get() string + // 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 + // IsXMLSchemaString returns true if this property is set and not an IRI. + IsXMLSchemaString() 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 TootBlurhashProperty) bool + // Name returns the name of this property: "blurhash". + 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 IsXMLSchemaString + // afterwards will return true. + Set(v string) + // SetIRI sets the value of this property. Calling IsIRI afterwards will + // return true. + SetIRI(v *url.URL) +} diff --git a/streams/vocab/gen_property_toot_discoverable_interface.go b/streams/vocab/gen_property_toot_discoverable_interface.go new file mode 100644 index 0000000..153c553 --- /dev/null +++ b/streams/vocab/gen_property_toot_discoverable_interface.go @@ -0,0 +1,54 @@ +// Code generated by astool. DO NOT EDIT. + +package vocab + +import "net/url" + +// +// +// null +type TootDiscoverableProperty interface { + // Clear ensures no value of this property is set. Calling + // IsXMLSchemaBoolean afterwards will return false. + Clear() + // Get returns the value of this property. When IsXMLSchemaBoolean returns + // false, Get will return any arbitrary value. + Get() bool + // 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 + // IsXMLSchemaBoolean returns true if this property is set and not an IRI. + IsXMLSchemaBoolean() 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 TootDiscoverableProperty) bool + // Name returns the name of this property: "discoverable". + 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 IsXMLSchemaBoolean + // afterwards will return true. + Set(v bool) + // SetIRI sets the value of this property. Calling IsIRI afterwards will + // return true. + SetIRI(v *url.URL) +} diff --git a/streams/vocab/gen_property_toot_featured_interface.go b/streams/vocab/gen_property_toot_featured_interface.go new file mode 100644 index 0000000..821a676 --- /dev/null +++ b/streams/vocab/gen_property_toot_featured_interface.go @@ -0,0 +1,82 @@ +// Code generated by astool. DO NOT EDIT. + +package vocab + +import "net/url" + +// +// +// null +type TootFeaturedProperty interface { + // Clear ensures no value of this property is set. Calling HasAny or any + // of the 'Is' methods afterwards will return false. + Clear() + // GetActivityStreamsOrderedCollection returns the value of this property. + // When IsActivityStreamsOrderedCollection returns false, + // GetActivityStreamsOrderedCollection will return an arbitrary value. + GetActivityStreamsOrderedCollection() ActivityStreamsOrderedCollection + // GetActivityStreamsOrderedCollectionPage returns the value of this + // property. When IsActivityStreamsOrderedCollectionPage returns + // false, GetActivityStreamsOrderedCollectionPage will return an + // arbitrary value. + GetActivityStreamsOrderedCollectionPage() ActivityStreamsOrderedCollectionPage + // GetIRI returns the IRI of this property. When IsIRI returns false, + // GetIRI will return an 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 any of the different values is set. + HasAny() bool + // IsActivityStreamsOrderedCollection returns true if this property has a + // type of "OrderedCollection". When true, use the + // GetActivityStreamsOrderedCollection and + // SetActivityStreamsOrderedCollection methods to access and set this + // property. + IsActivityStreamsOrderedCollection() bool + // IsActivityStreamsOrderedCollectionPage returns true if this property + // has a type of "OrderedCollectionPage". When true, use the + // GetActivityStreamsOrderedCollectionPage and + // SetActivityStreamsOrderedCollectionPage methods to access and set + // this property. + IsActivityStreamsOrderedCollectionPage() bool + // IsIRI returns true if this property is an IRI. When true, use GetIRI + // and SetIRI to access and set this property + 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 TootFeaturedProperty) bool + // Name returns the name of this property: "featured". + 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) + // SetActivityStreamsOrderedCollection sets the value of this property. + // Calling IsActivityStreamsOrderedCollection afterwards returns true. + SetActivityStreamsOrderedCollection(v ActivityStreamsOrderedCollection) + // SetActivityStreamsOrderedCollectionPage sets the value of this + // property. Calling IsActivityStreamsOrderedCollectionPage afterwards + // returns true. + SetActivityStreamsOrderedCollectionPage(v ActivityStreamsOrderedCollectionPage) + // SetIRI sets the value of this property. Calling IsIRI afterwards + // returns 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 +} diff --git a/streams/vocab/gen_property_toot_signatureAlgorithm_interface.go b/streams/vocab/gen_property_toot_signatureAlgorithm_interface.go new file mode 100644 index 0000000..e18dea3 --- /dev/null +++ b/streams/vocab/gen_property_toot_signatureAlgorithm_interface.go @@ -0,0 +1,54 @@ +// Code generated by astool. DO NOT EDIT. + +package vocab + +import "net/url" + +// +// +// null +type TootSignatureAlgorithmProperty interface { + // Clear ensures no value of this property is set. Calling + // IsXMLSchemaString afterwards will return false. + Clear() + // Get returns the value of this property. When IsXMLSchemaString returns + // false, Get will return any arbitrary value. + Get() string + // 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 + // IsXMLSchemaString returns true if this property is set and not an IRI. + IsXMLSchemaString() 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 TootSignatureAlgorithmProperty) bool + // Name returns the name of this property: "signatureAlgorithm". + 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 IsXMLSchemaString + // afterwards will return true. + Set(v string) + // SetIRI sets the value of this property. Calling IsIRI afterwards will + // return true. + SetIRI(v *url.URL) +} diff --git a/streams/vocab/gen_property_toot_signatureValue_interface.go b/streams/vocab/gen_property_toot_signatureValue_interface.go new file mode 100644 index 0000000..06b49b6 --- /dev/null +++ b/streams/vocab/gen_property_toot_signatureValue_interface.go @@ -0,0 +1,54 @@ +// Code generated by astool. DO NOT EDIT. + +package vocab + +import "net/url" + +// +// +// null +type TootSignatureValueProperty interface { + // Clear ensures no value of this property is set. Calling + // IsXMLSchemaString afterwards will return false. + Clear() + // Get returns the value of this property. When IsXMLSchemaString returns + // false, Get will return any arbitrary value. + Get() string + // 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 + // IsXMLSchemaString returns true if this property is set and not an IRI. + IsXMLSchemaString() 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 TootSignatureValueProperty) bool + // Name returns the name of this property: "signatureValue". + 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 IsXMLSchemaString + // afterwards will return true. + Set(v string) + // SetIRI sets the value of this property. Calling IsIRI afterwards will + // return true. + SetIRI(v *url.URL) +} diff --git a/streams/vocab/gen_property_toot_votersCount_interface.go b/streams/vocab/gen_property_toot_votersCount_interface.go new file mode 100644 index 0000000..52a45b4 --- /dev/null +++ b/streams/vocab/gen_property_toot_votersCount_interface.go @@ -0,0 +1,56 @@ +// Code generated by astool. DO NOT EDIT. + +package vocab + +import "net/url" + +// +// +// null +type TootVotersCountProperty interface { + // Clear ensures no value of this property is set. Calling + // IsXMLSchemaNonNegativeInteger afterwards will return false. + Clear() + // Get returns the value of this property. When + // IsXMLSchemaNonNegativeInteger returns false, Get will return any + // arbitrary value. + Get() int + // 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 + // IsXMLSchemaNonNegativeInteger returns true if this property is set and + // not an IRI. + IsXMLSchemaNonNegativeInteger() 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 TootVotersCountProperty) bool + // Name returns the name of this property: "votersCount". + 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 + // IsXMLSchemaNonNegativeInteger afterwards will return true. + Set(v int) + // SetIRI sets the value of this property. Calling IsIRI afterwards will + // return true. + SetIRI(v *url.URL) +} diff --git a/streams/vocab/gen_type_activitystreams_application_interface.go b/streams/vocab/gen_type_activitystreams_application_interface.go index f6f9fba..0e5e182 100644 --- a/streams/vocab/gen_type_activitystreams_application_interface.go +++ b/streams/vocab/gen_type_activitystreams_application_interface.go @@ -126,6 +126,12 @@ type ActivityStreamsApplication interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootDiscoverable returns the "discoverable" property if it exists, + // and nil otherwise. + GetTootDiscoverable() TootDiscoverableProperty + // GetTootFeatured returns the "featured" property if it exists, and nil + // otherwise. + GetTootFeatured() TootFeaturedProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Application @@ -231,6 +237,10 @@ type ActivityStreamsApplication interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootDiscoverable sets the "discoverable" property. + SetTootDiscoverable(i TootDiscoverableProperty) + // SetTootFeatured sets the "featured" property. + SetTootFeatured(i TootFeaturedProperty) // SetW3IDSecurityV1PublicKey sets the "publicKey" property. SetW3IDSecurityV1PublicKey(i W3IDSecurityV1PublicKeyProperty) // VocabularyURI returns the vocabulary's URI as a string. diff --git a/streams/vocab/gen_type_activitystreams_audio_interface.go b/streams/vocab/gen_type_activitystreams_audio_interface.go index 6e97f10..a370e73 100644 --- a/streams/vocab/gen_type_activitystreams_audio_interface.go +++ b/streams/vocab/gen_type_activitystreams_audio_interface.go @@ -110,6 +110,9 @@ type ActivityStreamsAudio interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootBlurhash returns the "blurhash" property if it exists, and nil + // otherwise. + GetTootBlurhash() TootBlurhashProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Audio type. @@ -196,6 +199,8 @@ type ActivityStreamsAudio interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootBlurhash sets the "blurhash" property. + SetTootBlurhash(i TootBlurhashProperty) // VocabularyURI returns the vocabulary's URI as a string. VocabularyURI() string } diff --git a/streams/vocab/gen_type_activitystreams_document_interface.go b/streams/vocab/gen_type_activitystreams_document_interface.go index 7072af6..4a50bbc 100644 --- a/streams/vocab/gen_type_activitystreams_document_interface.go +++ b/streams/vocab/gen_type_activitystreams_document_interface.go @@ -106,6 +106,9 @@ type ActivityStreamsDocument interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootBlurhash returns the "blurhash" property if it exists, and nil + // otherwise. + GetTootBlurhash() TootBlurhashProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Document @@ -193,6 +196,8 @@ type ActivityStreamsDocument interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootBlurhash sets the "blurhash" property. + SetTootBlurhash(i TootBlurhashProperty) // VocabularyURI returns the vocabulary's URI as a string. VocabularyURI() string } diff --git a/streams/vocab/gen_type_activitystreams_group_interface.go b/streams/vocab/gen_type_activitystreams_group_interface.go index 1c07199..5e4f69f 100644 --- a/streams/vocab/gen_type_activitystreams_group_interface.go +++ b/streams/vocab/gen_type_activitystreams_group_interface.go @@ -126,6 +126,12 @@ type ActivityStreamsGroup interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootDiscoverable returns the "discoverable" property if it exists, + // and nil otherwise. + GetTootDiscoverable() TootDiscoverableProperty + // GetTootFeatured returns the "featured" property if it exists, and nil + // otherwise. + GetTootFeatured() TootFeaturedProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Group type. @@ -230,6 +236,10 @@ type ActivityStreamsGroup interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootDiscoverable sets the "discoverable" property. + SetTootDiscoverable(i TootDiscoverableProperty) + // SetTootFeatured sets the "featured" property. + SetTootFeatured(i TootFeaturedProperty) // SetW3IDSecurityV1PublicKey sets the "publicKey" property. SetW3IDSecurityV1PublicKey(i W3IDSecurityV1PublicKeyProperty) // VocabularyURI returns the vocabulary's URI as a string. diff --git a/streams/vocab/gen_type_activitystreams_image_interface.go b/streams/vocab/gen_type_activitystreams_image_interface.go index 39fb6b9..db6241c 100644 --- a/streams/vocab/gen_type_activitystreams_image_interface.go +++ b/streams/vocab/gen_type_activitystreams_image_interface.go @@ -123,6 +123,9 @@ type ActivityStreamsImage interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootBlurhash returns the "blurhash" property if it exists, and nil + // otherwise. + GetTootBlurhash() TootBlurhashProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Image type. @@ -213,6 +216,8 @@ type ActivityStreamsImage interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootBlurhash sets the "blurhash" property. + SetTootBlurhash(i TootBlurhashProperty) // VocabularyURI returns the vocabulary's URI as a string. VocabularyURI() string } diff --git a/streams/vocab/gen_type_activitystreams_organization_interface.go b/streams/vocab/gen_type_activitystreams_organization_interface.go index 2ee3c66..a3fd226 100644 --- a/streams/vocab/gen_type_activitystreams_organization_interface.go +++ b/streams/vocab/gen_type_activitystreams_organization_interface.go @@ -126,6 +126,12 @@ type ActivityStreamsOrganization interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootDiscoverable returns the "discoverable" property if it exists, + // and nil otherwise. + GetTootDiscoverable() TootDiscoverableProperty + // GetTootFeatured returns the "featured" property if it exists, and nil + // otherwise. + GetTootFeatured() TootFeaturedProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the @@ -231,6 +237,10 @@ type ActivityStreamsOrganization interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootDiscoverable sets the "discoverable" property. + SetTootDiscoverable(i TootDiscoverableProperty) + // SetTootFeatured sets the "featured" property. + SetTootFeatured(i TootFeaturedProperty) // SetW3IDSecurityV1PublicKey sets the "publicKey" property. SetW3IDSecurityV1PublicKey(i W3IDSecurityV1PublicKeyProperty) // VocabularyURI returns the vocabulary's URI as a string. diff --git a/streams/vocab/gen_type_activitystreams_page_interface.go b/streams/vocab/gen_type_activitystreams_page_interface.go index 1d2d76e..e5beefc 100644 --- a/streams/vocab/gen_type_activitystreams_page_interface.go +++ b/streams/vocab/gen_type_activitystreams_page_interface.go @@ -106,6 +106,9 @@ type ActivityStreamsPage interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootBlurhash returns the "blurhash" property if it exists, and nil + // otherwise. + GetTootBlurhash() TootBlurhashProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Page type. @@ -192,6 +195,8 @@ type ActivityStreamsPage interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootBlurhash sets the "blurhash" property. + SetTootBlurhash(i TootBlurhashProperty) // VocabularyURI returns the vocabulary's URI as a string. VocabularyURI() string } diff --git a/streams/vocab/gen_type_activitystreams_person_interface.go b/streams/vocab/gen_type_activitystreams_person_interface.go index 9591bcf..9579aa9 100644 --- a/streams/vocab/gen_type_activitystreams_person_interface.go +++ b/streams/vocab/gen_type_activitystreams_person_interface.go @@ -126,6 +126,12 @@ type ActivityStreamsPerson interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootDiscoverable returns the "discoverable" property if it exists, + // and nil otherwise. + GetTootDiscoverable() TootDiscoverableProperty + // GetTootFeatured returns the "featured" property if it exists, and nil + // otherwise. + GetTootFeatured() TootFeaturedProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Person @@ -230,6 +236,10 @@ type ActivityStreamsPerson interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootDiscoverable sets the "discoverable" property. + SetTootDiscoverable(i TootDiscoverableProperty) + // SetTootFeatured sets the "featured" property. + SetTootFeatured(i TootFeaturedProperty) // SetW3IDSecurityV1PublicKey sets the "publicKey" property. SetW3IDSecurityV1PublicKey(i W3IDSecurityV1PublicKeyProperty) // VocabularyURI returns the vocabulary's URI as a string. diff --git a/streams/vocab/gen_type_activitystreams_question_interface.go b/streams/vocab/gen_type_activitystreams_question_interface.go index 667e88c..0d89b29 100644 --- a/streams/vocab/gen_type_activitystreams_question_interface.go +++ b/streams/vocab/gen_type_activitystreams_question_interface.go @@ -148,6 +148,9 @@ type ActivityStreamsQuestion interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootVotersCount returns the "votersCount" property if it exists, and + // nil otherwise. + GetTootVotersCount() TootVotersCountProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Question @@ -249,6 +252,8 @@ type ActivityStreamsQuestion interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootVotersCount sets the "votersCount" property. + SetTootVotersCount(i TootVotersCountProperty) // VocabularyURI returns the vocabulary's URI as a string. VocabularyURI() string } diff --git a/streams/vocab/gen_type_activitystreams_service_interface.go b/streams/vocab/gen_type_activitystreams_service_interface.go index 1516453..8d7a8fa 100644 --- a/streams/vocab/gen_type_activitystreams_service_interface.go +++ b/streams/vocab/gen_type_activitystreams_service_interface.go @@ -126,6 +126,12 @@ type ActivityStreamsService interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootDiscoverable returns the "discoverable" property if it exists, + // and nil otherwise. + GetTootDiscoverable() TootDiscoverableProperty + // GetTootFeatured returns the "featured" property if it exists, and nil + // otherwise. + GetTootFeatured() TootFeaturedProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Service @@ -231,6 +237,10 @@ type ActivityStreamsService interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootDiscoverable sets the "discoverable" property. + SetTootDiscoverable(i TootDiscoverableProperty) + // SetTootFeatured sets the "featured" property. + SetTootFeatured(i TootFeaturedProperty) // SetW3IDSecurityV1PublicKey sets the "publicKey" property. SetW3IDSecurityV1PublicKey(i W3IDSecurityV1PublicKeyProperty) // VocabularyURI returns the vocabulary's URI as a string. diff --git a/streams/vocab/gen_type_activitystreams_video_interface.go b/streams/vocab/gen_type_activitystreams_video_interface.go index 6f26525..8991c60 100644 --- a/streams/vocab/gen_type_activitystreams_video_interface.go +++ b/streams/vocab/gen_type_activitystreams_video_interface.go @@ -107,6 +107,9 @@ type ActivityStreamsVideo interface { // GetJSONLDType returns the "type" property if it exists, and nil // otherwise. GetJSONLDType() JSONLDTypeProperty + // GetTootBlurhash returns the "blurhash" property if it exists, and nil + // otherwise. + GetTootBlurhash() TootBlurhashProperty // GetTypeName returns the name of this type. GetTypeName() string // GetUnknownProperties returns the unknown properties for the Video type. @@ -193,6 +196,8 @@ type ActivityStreamsVideo interface { SetJSONLDId(i JSONLDIdProperty) // SetJSONLDType sets the "type" property. SetJSONLDType(i JSONLDTypeProperty) + // SetTootBlurhash sets the "blurhash" property. + SetTootBlurhash(i TootBlurhashProperty) // VocabularyURI returns the vocabulary's URI as a string. VocabularyURI() string } diff --git a/streams/vocab/gen_type_toot_emoji_interface.go b/streams/vocab/gen_type_toot_emoji_interface.go new file mode 100644 index 0000000..86ccfca --- /dev/null +++ b/streams/vocab/gen_type_toot_emoji_interface.go @@ -0,0 +1,208 @@ +// Code generated by astool. DO NOT EDIT. + +package vocab + +// +// +// { +// "content": "Hello world :Kappa:", +// "id": "https://example.com/@alice/hello-world", +// "tag": [ +// { +// "icon": { +// "mediaType": "image/png", +// "type": "Image", +// "url": "https://example.com/files/kappa.png" +// }, +// "id": "https://example.com/emoji/123", +// "name": ":Kappa:", +// "type": "Emoji" +// } +// ], +// "type": "Note" +// } +type TootEmoji interface { + // GetActivityStreamsAltitude returns the "altitude" property if it + // exists, and nil otherwise. + GetActivityStreamsAltitude() ActivityStreamsAltitudeProperty + // GetActivityStreamsAttachment returns the "attachment" property if it + // exists, and nil otherwise. + GetActivityStreamsAttachment() ActivityStreamsAttachmentProperty + // GetActivityStreamsAttributedTo returns the "attributedTo" property if + // it exists, and nil otherwise. + GetActivityStreamsAttributedTo() ActivityStreamsAttributedToProperty + // GetActivityStreamsAudience returns the "audience" property if it + // exists, and nil otherwise. + GetActivityStreamsAudience() ActivityStreamsAudienceProperty + // GetActivityStreamsBcc returns the "bcc" property if it exists, and nil + // otherwise. + GetActivityStreamsBcc() ActivityStreamsBccProperty + // GetActivityStreamsBto returns the "bto" property if it exists, and nil + // otherwise. + GetActivityStreamsBto() ActivityStreamsBtoProperty + // GetActivityStreamsCc returns the "cc" property if it exists, and nil + // otherwise. + GetActivityStreamsCc() ActivityStreamsCcProperty + // GetActivityStreamsContent returns the "content" property if it exists, + // and nil otherwise. + GetActivityStreamsContent() ActivityStreamsContentProperty + // GetActivityStreamsContext returns the "context" property if it exists, + // and nil otherwise. + GetActivityStreamsContext() ActivityStreamsContextProperty + // GetActivityStreamsDuration returns the "duration" property if it + // exists, and nil otherwise. + GetActivityStreamsDuration() ActivityStreamsDurationProperty + // GetActivityStreamsEndTime returns the "endTime" property if it exists, + // and nil otherwise. + GetActivityStreamsEndTime() ActivityStreamsEndTimeProperty + // GetActivityStreamsGenerator returns the "generator" property if it + // exists, and nil otherwise. + GetActivityStreamsGenerator() ActivityStreamsGeneratorProperty + // GetActivityStreamsIcon returns the "icon" property if it exists, and + // nil otherwise. + GetActivityStreamsIcon() ActivityStreamsIconProperty + // GetActivityStreamsImage returns the "image" property if it exists, and + // nil otherwise. + GetActivityStreamsImage() ActivityStreamsImageProperty + // GetActivityStreamsInReplyTo returns the "inReplyTo" property if it + // exists, and nil otherwise. + GetActivityStreamsInReplyTo() ActivityStreamsInReplyToProperty + // GetActivityStreamsLikes returns the "likes" property if it exists, and + // nil otherwise. + GetActivityStreamsLikes() ActivityStreamsLikesProperty + // GetActivityStreamsLocation returns the "location" property if it + // exists, and nil otherwise. + GetActivityStreamsLocation() ActivityStreamsLocationProperty + // GetActivityStreamsMediaType returns the "mediaType" property if it + // exists, and nil otherwise. + GetActivityStreamsMediaType() ActivityStreamsMediaTypeProperty + // GetActivityStreamsName returns the "name" property if it exists, and + // nil otherwise. + GetActivityStreamsName() ActivityStreamsNameProperty + // GetActivityStreamsObject returns the "object" property if it exists, + // and nil otherwise. + GetActivityStreamsObject() ActivityStreamsObjectProperty + // GetActivityStreamsPreview returns the "preview" property if it exists, + // and nil otherwise. + GetActivityStreamsPreview() ActivityStreamsPreviewProperty + // GetActivityStreamsPublished returns the "published" property if it + // exists, and nil otherwise. + GetActivityStreamsPublished() ActivityStreamsPublishedProperty + // GetActivityStreamsReplies returns the "replies" property if it exists, + // and nil otherwise. + GetActivityStreamsReplies() ActivityStreamsRepliesProperty + // GetActivityStreamsShares returns the "shares" property if it exists, + // and nil otherwise. + GetActivityStreamsShares() ActivityStreamsSharesProperty + // GetActivityStreamsStartTime returns the "startTime" property if it + // exists, and nil otherwise. + GetActivityStreamsStartTime() ActivityStreamsStartTimeProperty + // GetActivityStreamsSummary returns the "summary" property if it exists, + // and nil otherwise. + GetActivityStreamsSummary() ActivityStreamsSummaryProperty + // GetActivityStreamsTag returns the "tag" property if it exists, and nil + // otherwise. + GetActivityStreamsTag() ActivityStreamsTagProperty + // GetActivityStreamsTo returns the "to" property if it exists, and nil + // otherwise. + GetActivityStreamsTo() ActivityStreamsToProperty + // GetActivityStreamsUpdated returns the "updated" property if it exists, + // and nil otherwise. + GetActivityStreamsUpdated() ActivityStreamsUpdatedProperty + // GetActivityStreamsUrl returns the "url" property if it exists, and nil + // otherwise. + GetActivityStreamsUrl() ActivityStreamsUrlProperty + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. + GetJSONLDId() JSONLDIdProperty + // GetJSONLDType returns the "type" property if it exists, and nil + // otherwise. + GetJSONLDType() JSONLDTypeProperty + // GetTypeName returns the name of this type. + GetTypeName() string + // GetUnknownProperties returns the unknown properties for the Emoji 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 Emoji 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 Emoji is lesser, with an arbitrary but stable + // determination. + LessThan(o TootEmoji) bool + // Serialize converts this into an interface representation suitable for + // marshalling into a text or binary format. + Serialize() (map[string]interface{}, error) + // SetActivityStreamsAltitude sets the "altitude" property. + SetActivityStreamsAltitude(i ActivityStreamsAltitudeProperty) + // SetActivityStreamsAttachment sets the "attachment" property. + SetActivityStreamsAttachment(i ActivityStreamsAttachmentProperty) + // SetActivityStreamsAttributedTo sets the "attributedTo" property. + SetActivityStreamsAttributedTo(i ActivityStreamsAttributedToProperty) + // SetActivityStreamsAudience sets the "audience" property. + SetActivityStreamsAudience(i ActivityStreamsAudienceProperty) + // SetActivityStreamsBcc sets the "bcc" property. + SetActivityStreamsBcc(i ActivityStreamsBccProperty) + // SetActivityStreamsBto sets the "bto" property. + SetActivityStreamsBto(i ActivityStreamsBtoProperty) + // SetActivityStreamsCc sets the "cc" property. + SetActivityStreamsCc(i ActivityStreamsCcProperty) + // SetActivityStreamsContent sets the "content" property. + SetActivityStreamsContent(i ActivityStreamsContentProperty) + // SetActivityStreamsContext sets the "context" property. + SetActivityStreamsContext(i ActivityStreamsContextProperty) + // SetActivityStreamsDuration sets the "duration" property. + SetActivityStreamsDuration(i ActivityStreamsDurationProperty) + // SetActivityStreamsEndTime sets the "endTime" property. + SetActivityStreamsEndTime(i ActivityStreamsEndTimeProperty) + // SetActivityStreamsGenerator sets the "generator" property. + SetActivityStreamsGenerator(i ActivityStreamsGeneratorProperty) + // SetActivityStreamsIcon sets the "icon" property. + SetActivityStreamsIcon(i ActivityStreamsIconProperty) + // SetActivityStreamsImage sets the "image" property. + SetActivityStreamsImage(i ActivityStreamsImageProperty) + // SetActivityStreamsInReplyTo sets the "inReplyTo" property. + SetActivityStreamsInReplyTo(i ActivityStreamsInReplyToProperty) + // SetActivityStreamsLikes sets the "likes" property. + SetActivityStreamsLikes(i ActivityStreamsLikesProperty) + // SetActivityStreamsLocation sets the "location" property. + SetActivityStreamsLocation(i ActivityStreamsLocationProperty) + // SetActivityStreamsMediaType sets the "mediaType" property. + SetActivityStreamsMediaType(i ActivityStreamsMediaTypeProperty) + // SetActivityStreamsName sets the "name" property. + SetActivityStreamsName(i ActivityStreamsNameProperty) + // SetActivityStreamsObject sets the "object" property. + SetActivityStreamsObject(i ActivityStreamsObjectProperty) + // SetActivityStreamsPreview sets the "preview" property. + SetActivityStreamsPreview(i ActivityStreamsPreviewProperty) + // SetActivityStreamsPublished sets the "published" property. + SetActivityStreamsPublished(i ActivityStreamsPublishedProperty) + // SetActivityStreamsReplies sets the "replies" property. + SetActivityStreamsReplies(i ActivityStreamsRepliesProperty) + // SetActivityStreamsShares sets the "shares" property. + SetActivityStreamsShares(i ActivityStreamsSharesProperty) + // SetActivityStreamsStartTime sets the "startTime" property. + SetActivityStreamsStartTime(i ActivityStreamsStartTimeProperty) + // SetActivityStreamsSummary sets the "summary" property. + SetActivityStreamsSummary(i ActivityStreamsSummaryProperty) + // SetActivityStreamsTag sets the "tag" property. + SetActivityStreamsTag(i ActivityStreamsTagProperty) + // SetActivityStreamsTo sets the "to" property. + SetActivityStreamsTo(i ActivityStreamsToProperty) + // SetActivityStreamsUpdated sets the "updated" property. + SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty) + // SetActivityStreamsUrl sets the "url" property. + SetActivityStreamsUrl(i ActivityStreamsUrlProperty) + // SetJSONLDId sets the "id" property. + SetJSONLDId(i JSONLDIdProperty) + // SetJSONLDType sets the "type" property. + SetJSONLDType(i JSONLDTypeProperty) + // VocabularyURI returns the vocabulary's URI as a string. + VocabularyURI() string +} diff --git a/streams/vocab/gen_type_toot_identityproof_interface.go b/streams/vocab/gen_type_toot_identityproof_interface.go new file mode 100644 index 0000000..8ba9de2 --- /dev/null +++ b/streams/vocab/gen_type_toot_identityproof_interface.go @@ -0,0 +1,203 @@ +// Code generated by astool. DO NOT EDIT. + +package vocab + +// +// +// null +type TootIdentityProof interface { + // GetActivityStreamsAltitude returns the "altitude" property if it + // exists, and nil otherwise. + GetActivityStreamsAltitude() ActivityStreamsAltitudeProperty + // GetActivityStreamsAttachment returns the "attachment" property if it + // exists, and nil otherwise. + GetActivityStreamsAttachment() ActivityStreamsAttachmentProperty + // GetActivityStreamsAttributedTo returns the "attributedTo" property if + // it exists, and nil otherwise. + GetActivityStreamsAttributedTo() ActivityStreamsAttributedToProperty + // GetActivityStreamsAudience returns the "audience" property if it + // exists, and nil otherwise. + GetActivityStreamsAudience() ActivityStreamsAudienceProperty + // GetActivityStreamsBcc returns the "bcc" property if it exists, and nil + // otherwise. + GetActivityStreamsBcc() ActivityStreamsBccProperty + // GetActivityStreamsBto returns the "bto" property if it exists, and nil + // otherwise. + GetActivityStreamsBto() ActivityStreamsBtoProperty + // GetActivityStreamsCc returns the "cc" property if it exists, and nil + // otherwise. + GetActivityStreamsCc() ActivityStreamsCcProperty + // GetActivityStreamsContent returns the "content" property if it exists, + // and nil otherwise. + GetActivityStreamsContent() ActivityStreamsContentProperty + // GetActivityStreamsContext returns the "context" property if it exists, + // and nil otherwise. + GetActivityStreamsContext() ActivityStreamsContextProperty + // GetActivityStreamsDuration returns the "duration" property if it + // exists, and nil otherwise. + GetActivityStreamsDuration() ActivityStreamsDurationProperty + // GetActivityStreamsEndTime returns the "endTime" property if it exists, + // and nil otherwise. + GetActivityStreamsEndTime() ActivityStreamsEndTimeProperty + // GetActivityStreamsGenerator returns the "generator" property if it + // exists, and nil otherwise. + GetActivityStreamsGenerator() ActivityStreamsGeneratorProperty + // GetActivityStreamsIcon returns the "icon" property if it exists, and + // nil otherwise. + GetActivityStreamsIcon() ActivityStreamsIconProperty + // GetActivityStreamsImage returns the "image" property if it exists, and + // nil otherwise. + GetActivityStreamsImage() ActivityStreamsImageProperty + // GetActivityStreamsInReplyTo returns the "inReplyTo" property if it + // exists, and nil otherwise. + GetActivityStreamsInReplyTo() ActivityStreamsInReplyToProperty + // GetActivityStreamsLikes returns the "likes" property if it exists, and + // nil otherwise. + GetActivityStreamsLikes() ActivityStreamsLikesProperty + // GetActivityStreamsLocation returns the "location" property if it + // exists, and nil otherwise. + GetActivityStreamsLocation() ActivityStreamsLocationProperty + // GetActivityStreamsMediaType returns the "mediaType" property if it + // exists, and nil otherwise. + GetActivityStreamsMediaType() ActivityStreamsMediaTypeProperty + // GetActivityStreamsName returns the "name" property if it exists, and + // nil otherwise. + GetActivityStreamsName() ActivityStreamsNameProperty + // GetActivityStreamsObject returns the "object" property if it exists, + // and nil otherwise. + GetActivityStreamsObject() ActivityStreamsObjectProperty + // GetActivityStreamsPreview returns the "preview" property if it exists, + // and nil otherwise. + GetActivityStreamsPreview() ActivityStreamsPreviewProperty + // GetActivityStreamsPublished returns the "published" property if it + // exists, and nil otherwise. + GetActivityStreamsPublished() ActivityStreamsPublishedProperty + // GetActivityStreamsReplies returns the "replies" property if it exists, + // and nil otherwise. + GetActivityStreamsReplies() ActivityStreamsRepliesProperty + // GetActivityStreamsShares returns the "shares" property if it exists, + // and nil otherwise. + GetActivityStreamsShares() ActivityStreamsSharesProperty + // GetActivityStreamsStartTime returns the "startTime" property if it + // exists, and nil otherwise. + GetActivityStreamsStartTime() ActivityStreamsStartTimeProperty + // GetActivityStreamsSummary returns the "summary" property if it exists, + // and nil otherwise. + GetActivityStreamsSummary() ActivityStreamsSummaryProperty + // GetActivityStreamsTag returns the "tag" property if it exists, and nil + // otherwise. + GetActivityStreamsTag() ActivityStreamsTagProperty + // GetActivityStreamsTo returns the "to" property if it exists, and nil + // otherwise. + GetActivityStreamsTo() ActivityStreamsToProperty + // GetActivityStreamsUpdated returns the "updated" property if it exists, + // and nil otherwise. + GetActivityStreamsUpdated() ActivityStreamsUpdatedProperty + // GetActivityStreamsUrl returns the "url" property if it exists, and nil + // otherwise. + GetActivityStreamsUrl() ActivityStreamsUrlProperty + // GetJSONLDId returns the "id" property if it exists, and nil otherwise. + GetJSONLDId() JSONLDIdProperty + // GetJSONLDType returns the "type" property if it exists, and nil + // otherwise. + GetJSONLDType() JSONLDTypeProperty + // GetTootSignatureAlgorithm returns the "signatureAlgorithm" property if + // it exists, and nil otherwise. + GetTootSignatureAlgorithm() TootSignatureAlgorithmProperty + // GetTootSignatureValue returns the "signatureValue" property if it + // exists, and nil otherwise. + GetTootSignatureValue() TootSignatureValueProperty + // GetTypeName returns the name of this type. + GetTypeName() string + // GetUnknownProperties returns the unknown properties for the + // IdentityProof 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 IdentityProof 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 IdentityProof is lesser, with an arbitrary + // but stable determination. + LessThan(o TootIdentityProof) bool + // Serialize converts this into an interface representation suitable for + // marshalling into a text or binary format. + Serialize() (map[string]interface{}, error) + // SetActivityStreamsAltitude sets the "altitude" property. + SetActivityStreamsAltitude(i ActivityStreamsAltitudeProperty) + // SetActivityStreamsAttachment sets the "attachment" property. + SetActivityStreamsAttachment(i ActivityStreamsAttachmentProperty) + // SetActivityStreamsAttributedTo sets the "attributedTo" property. + SetActivityStreamsAttributedTo(i ActivityStreamsAttributedToProperty) + // SetActivityStreamsAudience sets the "audience" property. + SetActivityStreamsAudience(i ActivityStreamsAudienceProperty) + // SetActivityStreamsBcc sets the "bcc" property. + SetActivityStreamsBcc(i ActivityStreamsBccProperty) + // SetActivityStreamsBto sets the "bto" property. + SetActivityStreamsBto(i ActivityStreamsBtoProperty) + // SetActivityStreamsCc sets the "cc" property. + SetActivityStreamsCc(i ActivityStreamsCcProperty) + // SetActivityStreamsContent sets the "content" property. + SetActivityStreamsContent(i ActivityStreamsContentProperty) + // SetActivityStreamsContext sets the "context" property. + SetActivityStreamsContext(i ActivityStreamsContextProperty) + // SetActivityStreamsDuration sets the "duration" property. + SetActivityStreamsDuration(i ActivityStreamsDurationProperty) + // SetActivityStreamsEndTime sets the "endTime" property. + SetActivityStreamsEndTime(i ActivityStreamsEndTimeProperty) + // SetActivityStreamsGenerator sets the "generator" property. + SetActivityStreamsGenerator(i ActivityStreamsGeneratorProperty) + // SetActivityStreamsIcon sets the "icon" property. + SetActivityStreamsIcon(i ActivityStreamsIconProperty) + // SetActivityStreamsImage sets the "image" property. + SetActivityStreamsImage(i ActivityStreamsImageProperty) + // SetActivityStreamsInReplyTo sets the "inReplyTo" property. + SetActivityStreamsInReplyTo(i ActivityStreamsInReplyToProperty) + // SetActivityStreamsLikes sets the "likes" property. + SetActivityStreamsLikes(i ActivityStreamsLikesProperty) + // SetActivityStreamsLocation sets the "location" property. + SetActivityStreamsLocation(i ActivityStreamsLocationProperty) + // SetActivityStreamsMediaType sets the "mediaType" property. + SetActivityStreamsMediaType(i ActivityStreamsMediaTypeProperty) + // SetActivityStreamsName sets the "name" property. + SetActivityStreamsName(i ActivityStreamsNameProperty) + // SetActivityStreamsObject sets the "object" property. + SetActivityStreamsObject(i ActivityStreamsObjectProperty) + // SetActivityStreamsPreview sets the "preview" property. + SetActivityStreamsPreview(i ActivityStreamsPreviewProperty) + // SetActivityStreamsPublished sets the "published" property. + SetActivityStreamsPublished(i ActivityStreamsPublishedProperty) + // SetActivityStreamsReplies sets the "replies" property. + SetActivityStreamsReplies(i ActivityStreamsRepliesProperty) + // SetActivityStreamsShares sets the "shares" property. + SetActivityStreamsShares(i ActivityStreamsSharesProperty) + // SetActivityStreamsStartTime sets the "startTime" property. + SetActivityStreamsStartTime(i ActivityStreamsStartTimeProperty) + // SetActivityStreamsSummary sets the "summary" property. + SetActivityStreamsSummary(i ActivityStreamsSummaryProperty) + // SetActivityStreamsTag sets the "tag" property. + SetActivityStreamsTag(i ActivityStreamsTagProperty) + // SetActivityStreamsTo sets the "to" property. + SetActivityStreamsTo(i ActivityStreamsToProperty) + // SetActivityStreamsUpdated sets the "updated" property. + SetActivityStreamsUpdated(i ActivityStreamsUpdatedProperty) + // SetActivityStreamsUrl sets the "url" property. + SetActivityStreamsUrl(i ActivityStreamsUrlProperty) + // SetJSONLDId sets the "id" property. + SetJSONLDId(i JSONLDIdProperty) + // SetJSONLDType sets the "type" property. + SetJSONLDType(i JSONLDTypeProperty) + // SetTootSignatureAlgorithm sets the "signatureAlgorithm" property. + SetTootSignatureAlgorithm(i TootSignatureAlgorithmProperty) + // SetTootSignatureValue sets the "signatureValue" property. + SetTootSignatureValue(i TootSignatureValueProperty) + // VocabularyURI returns the vocabulary's URI as a string. + VocabularyURI() string +} From f502dfd0412b2bef74ca9b10e04da1fdc69c9d38 Mon Sep 17 00:00:00 2001 From: Dan Conley Date: Fri, 28 Feb 2020 21:55:38 -0500 Subject: [PATCH 03/28] Replace 'inbox' with 'outbox' when appropriate As I was ~~wholesale copying~~ using the `database` interface definition as a reference while creating my Federating implementation I noticed some instances of a variable being named `inboxIRI` in an outbox method. --- pub/database.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pub/database.go b/pub/database.go index 10b8484..30d2d2f 100644 --- a/pub/database.go +++ b/pub/database.go @@ -101,13 +101,13 @@ type Database interface { // at the specified IRI, for prepending new items. // // The library makes this call only after acquiring a lock first. - GetOutbox(c context.Context, inboxIRI *url.URL) (inbox vocab.ActivityStreamsOrderedCollectionPage, err error) + GetOutbox(c context.Context, outboxIRI *url.URL) (inbox vocab.ActivityStreamsOrderedCollectionPage, err error) // SetOutbox saves the outbox value given from GetOutbox, with new items // prepended. Note that the new items must not be added as independent // database entries. Separate calls to Create will do that. // // The library makes this call only after acquiring a lock first. - SetOutbox(c context.Context, inbox vocab.ActivityStreamsOrderedCollectionPage) error + SetOutbox(c context.Context, outbox vocab.ActivityStreamsOrderedCollectionPage) error // NewId creates a new IRI id for the provided activity or object. The // implementation does not need to set the 'id' property and simply // needs to determine the value. From 5f6df51cb81bfd722e8d87c395ba64b6a09ba6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sch=C3=A4rtl?= Date: Wed, 1 Apr 2020 14:40:41 +0200 Subject: [PATCH 04/28] Fix: Avoid nil-dereferences when wrapping object in Create activity --- pub/util.go | 95 ++++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/pub/util.go b/pub/util.go index 34d2a24..ddf0f01 100644 --- a/pub/util.go +++ b/pub/util.go @@ -266,69 +266,74 @@ func wrapInCreate(ctx context.Context, o vocab.Type, actor *url.URL) (c vocab.Ac } // Copying over properties. if v, ok := o.(toer); ok { - activityTo := streams.NewActivityStreamsToProperty() - to := v.GetActivityStreamsTo() - for iter := to.Begin(); iter != to.End(); iter = iter.Next() { - var id *url.URL - id, err = ToId(iter) - if err != nil { - return + if to := v.GetActivityStreamsTo(); to != nil { + activityTo := streams.NewActivityStreamsToProperty() + for iter := to.Begin(); iter != to.End(); iter = iter.Next() { + var id *url.URL + id, err = ToId(iter) + if err != nil { + return + } + activityTo.AppendIRI(id) } - activityTo.AppendIRI(id) + c.SetActivityStreamsTo(activityTo) } - c.SetActivityStreamsTo(activityTo) } if v, ok := o.(btoer); ok { - activityBto := streams.NewActivityStreamsBtoProperty() - bto := v.GetActivityStreamsBto() - for iter := bto.Begin(); iter != bto.End(); iter = iter.Next() { - var id *url.URL - id, err = ToId(iter) - if err != nil { - return + if bto := v.GetActivityStreamsBto(); bto != nil { + activityBto := streams.NewActivityStreamsBtoProperty() + for iter := bto.Begin(); iter != bto.End(); iter = iter.Next() { + var id *url.URL + id, err = ToId(iter) + if err != nil { + return + } + activityBto.AppendIRI(id) } - activityBto.AppendIRI(id) + c.SetActivityStreamsBto(activityBto) } - c.SetActivityStreamsBto(activityBto) } if v, ok := o.(ccer); ok { - activityCc := streams.NewActivityStreamsCcProperty() - cc := v.GetActivityStreamsCc() - for iter := cc.Begin(); iter != cc.End(); iter = iter.Next() { - var id *url.URL - id, err = ToId(iter) - if err != nil { - return + if cc := v.GetActivityStreamsCc(); cc != nil { + activityCc := streams.NewActivityStreamsCcProperty() + for iter := cc.Begin(); iter != cc.End(); iter = iter.Next() { + var id *url.URL + id, err = ToId(iter) + if err != nil { + return + } + activityCc.AppendIRI(id) } - activityCc.AppendIRI(id) + c.SetActivityStreamsCc(activityCc) } - c.SetActivityStreamsCc(activityCc) } if v, ok := o.(bccer); ok { - activityBcc := streams.NewActivityStreamsBccProperty() - bcc := v.GetActivityStreamsBcc() - for iter := bcc.Begin(); iter != bcc.End(); iter = iter.Next() { - var id *url.URL - id, err = ToId(iter) - if err != nil { - return + if bcc := v.GetActivityStreamsBcc(); bcc != nil { + activityBcc := streams.NewActivityStreamsBccProperty() + for iter := bcc.Begin(); iter != bcc.End(); iter = iter.Next() { + var id *url.URL + id, err = ToId(iter) + if err != nil { + return + } + activityBcc.AppendIRI(id) } - activityBcc.AppendIRI(id) + c.SetActivityStreamsBcc(activityBcc) } - c.SetActivityStreamsBcc(activityBcc) } if v, ok := o.(audiencer); ok { - activityAudience := streams.NewActivityStreamsAudienceProperty() - aud := v.GetActivityStreamsAudience() - for iter := aud.Begin(); iter != aud.End(); iter = iter.Next() { - var id *url.URL - id, err = ToId(iter) - if err != nil { - return + if aud := v.GetActivityStreamsAudience(); aud != nil { + activityAudience := streams.NewActivityStreamsAudienceProperty() + for iter := aud.Begin(); iter != aud.End(); iter = iter.Next() { + var id *url.URL + id, err = ToId(iter) + if err != nil { + return + } + activityAudience.AppendIRI(id) } - activityAudience.AppendIRI(id) + c.SetActivityStreamsAudience(activityAudience) } - c.SetActivityStreamsAudience(activityAudience) } return } From 01a23ee4d114d6c0b2e3b50da42dbf7ca6ad255a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sch=C3=A4rtl?= Date: Wed, 1 Apr 2020 14:47:23 +0200 Subject: [PATCH 05/28] Fix: Avoid nil-derferences when dealing with Create side-effects --- pub/social_wrapped_callbacks.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pub/social_wrapped_callbacks.go b/pub/social_wrapped_callbacks.go index 77f2c1c..b69ec78 100644 --- a/pub/social_wrapped_callbacks.go +++ b/pub/social_wrapped_callbacks.go @@ -234,11 +234,14 @@ func (w SocialWrappedCallbacks) create(c context.Context, a vocab.ActivityStream } } } - // Put all missing object attributedTo IRIs onto the actor property. - for _, attributedToMap := range objectAttributedToIds { - for k, v := range attributedToMap { - if _, ok := createActorIds[k]; !ok { - actors.AppendIRI(v) + // Put all missing object attributedTo IRIs onto the actor property + // if there is one. + if actors != nil { + for _, attributedToMap := range objectAttributedToIds { + for k, v := range attributedToMap { + if _, ok := createActorIds[k]; !ok { + actors.AppendIRI(v) + } } } } From 2efc3220faceb61cbb695807e99e043e4130ffd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sch=C3=A4rtl?= Date: Wed, 1 Apr 2020 14:48:39 +0200 Subject: [PATCH 06/28] Fix: Use correct database method to get actor IRI --- pub/social_wrapped_callbacks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pub/social_wrapped_callbacks.go b/pub/social_wrapped_callbacks.go index 77f2c1c..91b8272 100644 --- a/pub/social_wrapped_callbacks.go +++ b/pub/social_wrapped_callbacks.go @@ -458,7 +458,7 @@ func (w SocialWrappedCallbacks) like(c context.Context, a vocab.ActivityStreamsL return err } // WARNING: Unlock not deferred. - actorIRI, err := w.db.ActorForInbox(c, w.outboxIRI) + actorIRI, err := w.db.ActorForOutbox(c, w.outboxIRI) if err != nil { w.db.Unlock(c, w.outboxIRI) return err From 908aa3e9ae48712e969d84da28a3f79d49971ae0 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sat, 9 May 2020 12:33:27 -0500 Subject: [PATCH 07/28] add file to allow `go generate` to update generated code --- gen.go | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 gen.go diff --git a/gen.go b/gen.go new file mode 100644 index 0000000..4584014 --- /dev/null +++ b/gen.go @@ -0,0 +1,4 @@ +// +build generate +//go:generate go run ./astool -spec astool/activitystreams.jsonld -spec astool/security-v1.jsonld -path github.com/go-fed/activity ./streams + +package activity From f2a497bdc2a66489917705c4f96bbc0a8e9dc5e4 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Thu, 2 Jul 2020 21:15:02 +0200 Subject: [PATCH 08/28] Fix broken unit tests. --- pub/base_actor_test.go | 11 +++++++++++ pub/mock_database_test.go | 16 ++++++++-------- pub/side_effect_actor_test.go | 20 ++++++++++---------- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/pub/base_actor_test.go b/pub/base_actor_test.go index 35baa56..9b769c7 100644 --- a/pub/base_actor_test.go +++ b/pub/base_actor_test.go @@ -186,6 +186,7 @@ func TestBaseActorSocialProtocol(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostOutboxRequest(testCreateNoId)) delegate.EXPECT().AuthenticatePostOutbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostOutboxRequestBodyHook(ctx, req, toDeserializedForm(testCreateNoId)).Return(ctx, nil) delegate.EXPECT().AddNewIds(ctx, toDeserializedForm(testCreateNoId)).DoAndReturn(func(c context.Context, activity Activity) error { withNewId(activity) return nil @@ -213,6 +214,7 @@ func TestBaseActorSocialProtocol(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostOutboxRequest(testMyNote)) delegate.EXPECT().AuthenticatePostOutbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostOutboxRequestBodyHook(ctx, req, toDeserializedForm(testMyNote)).Return(ctx, nil) delegate.EXPECT().WrapInCreate(ctx, toDeserializedForm(testMyNote), mustParse(testMyOutboxIRI)).DoAndReturn(func(c context.Context, t vocab.Type, u *url.URL) (vocab.ActivityStreamsCreate, error) { return wrappedInCreate(t), nil }) @@ -241,6 +243,7 @@ func TestBaseActorSocialProtocol(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostOutboxRequest(testCreateNoId)) delegate.EXPECT().AuthenticatePostOutbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostOutboxRequestBodyHook(ctx, req, toDeserializedForm(testCreateNoId)).Return(ctx, nil) delegate.EXPECT().AddNewIds(ctx, toDeserializedForm(testCreateNoId)).DoAndReturn(func(c context.Context, activity Activity) error { withNewId(activity) return nil @@ -266,6 +269,7 @@ func TestBaseActorSocialProtocol(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostOutboxRequest(testCreateNoId)) delegate.EXPECT().AuthenticatePostOutbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostOutboxRequestBodyHook(ctx, req, toDeserializedForm(testCreateNoId)).Return(ctx, nil) delegate.EXPECT().AddNewIds(ctx, toDeserializedForm(testCreateNoId)).DoAndReturn(func(c context.Context, activity Activity) error { withNewId(activity) return nil @@ -428,6 +432,7 @@ func TestBaseActorFederatingProtocol(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostInboxRequest(testCreate)) delegate.EXPECT().AuthenticatePostInbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostInboxRequestBodyHook(ctx, req, toDeserializedForm(testCreate)).Return(ctx, nil) delegate.EXPECT().AuthorizePostInbox(ctx, resp, toDeserializedForm(testCreate)).DoAndReturn(func(ctx context.Context, resp http.ResponseWriter, activity Activity) (bool, error) { resp.WriteHeader(http.StatusForbidden) return false, nil @@ -447,6 +452,7 @@ func TestBaseActorFederatingProtocol(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostInboxRequest(testCreate)) delegate.EXPECT().AuthenticatePostInbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostInboxRequestBodyHook(ctx, req, toDeserializedForm(testCreate)).Return(ctx, nil) delegate.EXPECT().AuthorizePostInbox(ctx, resp, toDeserializedForm(testCreate)).Return(true, nil) delegate.EXPECT().PostInbox(ctx, mustParse(testMyInboxIRI), toDeserializedForm(testCreate)).Return(nil) delegate.EXPECT().InboxForwarding(ctx, mustParse(testMyInboxIRI), toDeserializedForm(testCreate)).Return(nil) @@ -465,6 +471,7 @@ func TestBaseActorFederatingProtocol(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostInboxRequest(testCreate)) delegate.EXPECT().AuthenticatePostInbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostInboxRequestBodyHook(ctx, req, toDeserializedForm(testCreate)).Return(ctx, nil) delegate.EXPECT().AuthorizePostInbox(ctx, resp, toDeserializedForm(testCreate)).Return(true, nil) delegate.EXPECT().PostInbox(ctx, mustParse(testMyInboxIRI), toDeserializedForm(testCreate)).Return(ErrObjectRequired) // Run the test @@ -482,6 +489,7 @@ func TestBaseActorFederatingProtocol(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostInboxRequest(testCreate)) delegate.EXPECT().AuthenticatePostInbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostInboxRequestBodyHook(ctx, req, toDeserializedForm(testCreate)).Return(ctx, nil) delegate.EXPECT().AuthorizePostInbox(ctx, resp, toDeserializedForm(testCreate)).Return(true, nil) delegate.EXPECT().PostInbox(ctx, mustParse(testMyInboxIRI), toDeserializedForm(testCreate)).Return(ErrTargetRequired) // Run the test @@ -677,6 +685,7 @@ func TestBaseActor(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostInboxRequest(testCreate)) delegate.EXPECT().AuthenticatePostInbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostInboxRequestBodyHook(ctx, req, toDeserializedForm(testCreate)).Return(ctx, nil) delegate.EXPECT().AuthorizePostInbox(ctx, resp, toDeserializedForm(testCreate)).Return(true, nil) delegate.EXPECT().PostInbox(ctx, mustParse(testMyInboxIRI), toDeserializedForm(testCreate)).Return(nil) delegate.EXPECT().InboxForwarding(ctx, mustParse(testMyInboxIRI), toDeserializedForm(testCreate)).Return(nil) @@ -695,6 +704,7 @@ func TestBaseActor(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostOutboxRequest(testCreateNoId)) delegate.EXPECT().AuthenticatePostOutbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostOutboxRequestBodyHook(ctx, req, toDeserializedForm(testCreateNoId)).Return(ctx, nil) delegate.EXPECT().AddNewIds(ctx, toDeserializedForm(testCreateNoId)).DoAndReturn(func(c context.Context, activity Activity) error { withNewId(activity) return nil @@ -722,6 +732,7 @@ func TestBaseActor(t *testing.T) { resp := httptest.NewRecorder() req := toAPRequest(toPostOutboxRequest(testCreateNoId)) delegate.EXPECT().AuthenticatePostOutbox(ctx, resp, req).Return(ctx, true, nil) + delegate.EXPECT().PostOutboxRequestBodyHook(ctx, req, toDeserializedForm(testCreateNoId)).Return(ctx, nil) delegate.EXPECT().AddNewIds(ctx, toDeserializedForm(testCreateNoId)).DoAndReturn(func(c context.Context, activity Activity) error { withNewId(activity) return nil diff --git a/pub/mock_database_test.go b/pub/mock_database_test.go index 35162e3..73d7153 100644 --- a/pub/mock_database_test.go +++ b/pub/mock_database_test.go @@ -240,32 +240,32 @@ func (mr *MockDatabaseMockRecorder) Delete(c, id interface{}) *gomock.Call { } // GetOutbox mocks base method -func (m *MockDatabase) GetOutbox(c context.Context, inboxIRI *url.URL) (vocab.ActivityStreamsOrderedCollectionPage, error) { +func (m *MockDatabase) GetOutbox(c context.Context, outboxIRI *url.URL) (vocab.ActivityStreamsOrderedCollectionPage, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetOutbox", c, inboxIRI) + ret := m.ctrl.Call(m, "GetOutbox", c, outboxIRI) ret0, _ := ret[0].(vocab.ActivityStreamsOrderedCollectionPage) ret1, _ := ret[1].(error) return ret0, ret1 } // GetOutbox indicates an expected call of GetOutbox -func (mr *MockDatabaseMockRecorder) GetOutbox(c, inboxIRI interface{}) *gomock.Call { +func (mr *MockDatabaseMockRecorder) GetOutbox(c, outboxIRI interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOutbox", reflect.TypeOf((*MockDatabase)(nil).GetOutbox), c, inboxIRI) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOutbox", reflect.TypeOf((*MockDatabase)(nil).GetOutbox), c, outboxIRI) } // SetOutbox mocks base method -func (m *MockDatabase) SetOutbox(c context.Context, inbox vocab.ActivityStreamsOrderedCollectionPage) error { +func (m *MockDatabase) SetOutbox(c context.Context, outbox vocab.ActivityStreamsOrderedCollectionPage) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetOutbox", c, inbox) + ret := m.ctrl.Call(m, "SetOutbox", c, outbox) ret0, _ := ret[0].(error) return ret0 } // SetOutbox indicates an expected call of SetOutbox -func (mr *MockDatabaseMockRecorder) SetOutbox(c, inbox interface{}) *gomock.Call { +func (mr *MockDatabaseMockRecorder) SetOutbox(c, outbox interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetOutbox", reflect.TypeOf((*MockDatabase)(nil).SetOutbox), c, inbox) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetOutbox", reflect.TypeOf((*MockDatabase)(nil).SetOutbox), c, outbox) } // NewId mocks base method diff --git a/pub/side_effect_actor_test.go b/pub/side_effect_actor_test.go index 2e519e4..bc7de35 100644 --- a/pub/side_effect_actor_test.go +++ b/pub/side_effect_actor_test.go @@ -217,7 +217,7 @@ func TestPostInbox(t *testing.T) { db.EXPECT().SetInbox(ctx, testOrderedCollectionWithFederatedId).Return(nil), db.EXPECT().Unlock(ctx, inboxIRI), ) - fp.EXPECT().Callbacks(ctx).Return(FederatingWrappedCallbacks{}, nil) + fp.EXPECT().Callbacks(ctx).Return(FederatingWrappedCallbacks{}, nil, nil) fp.EXPECT().DefaultCallback(ctx, testListen).Return(nil) // Run err := a.PostInbox(ctx, inboxIRI, testListen) @@ -253,7 +253,7 @@ func TestPostInbox(t *testing.T) { db.EXPECT().SetInbox(ctx, testOrderedCollectionWithBothFederatedIds).Return(nil), db.EXPECT().Unlock(ctx, inboxIRI), ) - fp.EXPECT().Callbacks(ctx).Return(FederatingWrappedCallbacks{}, nil) + fp.EXPECT().Callbacks(ctx).Return(FederatingWrappedCallbacks{}, nil, nil) fp.EXPECT().DefaultCallback(ctx, testListen).Return(nil) // Run err := a.PostInbox(ctx, inboxIRI, testListen) @@ -279,7 +279,7 @@ func TestPostInbox(t *testing.T) { pass = true return nil }, - }) + }, nil) // Run err := a.PostInbox(ctx, inboxIRI, testListen) // Verify @@ -305,7 +305,7 @@ func TestPostInbox(t *testing.T) { pass = true return nil }, - }) + }, nil) // Run err := a.PostInbox(ctx, inboxIRI, testCreate) // Verify @@ -331,7 +331,7 @@ func TestPostInbox(t *testing.T) { pass = true return nil }, - }, nil) + }, nil, nil) db.EXPECT().Lock(ctx, mustParse(testNoteId1)) db.EXPECT().Create(ctx, testFederatedNote) db.EXPECT().Unlock(ctx, mustParse(testNoteId1)) @@ -853,7 +853,7 @@ func TestPostOutbox(t *testing.T) { db.EXPECT().SetOutbox(ctx, testOrderedCollectionWithNewId).Return(nil), db.EXPECT().Unlock(ctx, outboxIRI), ) - sp.EXPECT().Callbacks(ctx).Return(SocialWrappedCallbacks{}, nil) + sp.EXPECT().Callbacks(ctx).Return(SocialWrappedCallbacks{}, nil, nil) sp.EXPECT().DefaultCallback(ctx, testMyListen).Return(nil) // Run deliverable, err := a.PostOutbox(ctx, testMyListen, outboxIRI, mustSerialize(testMyListen)) @@ -876,7 +876,7 @@ func TestPostOutbox(t *testing.T) { db.EXPECT().SetOutbox(ctx, testOrderedCollectionWithBothNewIds).Return(nil), db.EXPECT().Unlock(ctx, outboxIRI), ) - sp.EXPECT().Callbacks(ctx).Return(SocialWrappedCallbacks{}, nil) + sp.EXPECT().Callbacks(ctx).Return(SocialWrappedCallbacks{}, nil, nil) sp.EXPECT().DefaultCallback(ctx, testMyListen).Return(nil) // Run deliverable, err := a.PostOutbox(ctx, testMyListen, outboxIRI, mustSerialize(testMyListen)) @@ -905,7 +905,7 @@ func TestPostOutbox(t *testing.T) { pass = true return nil }, - }) + }, nil) // Run deliverable, err := a.PostOutbox(ctx, testMyListen, outboxIRI, mustSerialize(testMyListen)) // Verify @@ -934,7 +934,7 @@ func TestPostOutbox(t *testing.T) { pass = true return nil }, - }) + }, nil) // Run deliverable, err := a.PostOutbox(ctx, testMyCreate, outboxIRI, mustSerialize(testMyCreate)) // Verify @@ -963,7 +963,7 @@ func TestPostOutbox(t *testing.T) { pass = true return nil }, - }, nil) + }, nil, nil) db.EXPECT().Lock(ctx, mustParse(testNoteId1)) db.EXPECT().Create(ctx, testMyNote) db.EXPECT().Unlock(ctx, mustParse(testNoteId1)) From d11b96b9ede41374b07b42d7e5296b22f9c65a72 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Thu, 2 Jul 2020 22:10:35 +0200 Subject: [PATCH 09/28] Implement 18 more tests in the federation callbacks. --- pub/federating_wrapped_callbacks_test.go | 307 +++++++++++++++++++++-- pub/pub_test.go | 17 +- 2 files changed, 304 insertions(+), 20 deletions(-) diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index f09731d..b6471a7 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -1,70 +1,339 @@ package pub import ( + "context" + "net/url" "testing" + + "github.com/go-fed/activity/streams/vocab" + "github.com/go-fed/activity/streams" + "github.com/golang/mock/gomock" ) // TestFederatedCallbacks tests the overriding functionality. func TestFederatedCallbacks(t *testing.T) { t.Run("ReturnsOtherCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsListen) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsListen) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find extra function") + } + }) t.Run("OverridesCreate", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsCreate) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsCreate) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesUpdate", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsUpdate) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsUpdate) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesDelete", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsDelete) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsDelete) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesFollow", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsFollow) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsFollow) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesAccept", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsAccept) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsAccept) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesReject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsReject) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsReject) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesAdd", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsAdd) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsAdd) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesRemove", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsRemove) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsRemove) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesLike", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsLike) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsLike) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesAnnounce", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsAnnounce) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsAnnounce) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesUndo", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsUndo) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsUndo) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) t.Run("OverridesBlock", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ok := false + o := func(context.Context, vocab.ActivityStreamsBlock) error { + ok = true + return nil + } + var w FederatingWrappedCallbacks + for _, f := range w.callbacks([]interface{}{o}) { + if fn, ok := f.(func(context.Context, vocab.ActivityStreamsBlock) error); ok { + fn(nil, nil) + } + } + if !ok { + t.Fatalf("could not find overridden function") + } }) } func TestFederatedCreate(t *testing.T) { + newCreateFn := func() vocab.ActivityStreamsCreate { + c := streams.NewActivityStreamsCreate() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + c.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + c.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsNote(testFederatedNote) + c.SetActivityStreamsObject(op) + return c + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockDB *MockDatabase, mockTp *MockTransport) { + mockDB = NewMockDatabase(ctl) + mockTp = NewMockTransport(ctl) + w.db = mockDB + w.newTransport = func(c context.Context, a *url.URL, s string) (Transport, error) { + return mockTp, nil + } + return + } t.Run("ErrorIfNoObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + c := newCreateFn() + c.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.create(ctx, c) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfObjectLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + c := newCreateFn() + c.GetActivityStreamsObject().Remove(0) + var w FederatingWrappedCallbacks + err := w.create(ctx, c) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("CreatesFederatedObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB, _ := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Create(ctx, testFederatedNote) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + c := newCreateFn() + err := w.create(ctx, c) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("CreatesAllFederatedObjects", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB, _ := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Create(ctx, testFederatedNote) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId2)) + mockDB.EXPECT().Create(ctx, testFederatedNote2) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId2)) + c := newCreateFn() + c.GetActivityStreamsObject().AppendActivityStreamsNote(testFederatedNote2) + err := w.create(ctx, c) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("DereferencesIRIObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB, mockTp := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Create(ctx, toDeserializedForm(testFederatedNote)) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + mockTp.EXPECT().Dereference(ctx, mustParse(testNoteId1)).Return( + mustSerializeToBytes(testFederatedNote), nil) + c := newCreateFn() + op := streams.NewActivityStreamsObjectProperty() + op.AppendIRI(mustParse(testNoteId1)) + c.SetActivityStreamsObject(op) + err := w.create(ctx, c) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB, _ := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Create(ctx, testFederatedNote) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + c := newCreateFn() + var gotc context.Context + var got vocab.ActivityStreamsCreate + w.Create =func(ctx context.Context, v vocab.ActivityStreamsCreate) error { + gotc = ctx + got = v + return nil + } + err := w.create(ctx, c) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, c, got) }) } diff --git a/pub/pub_test.go b/pub/pub_test.go index 67ac2fb..8a9fbbc 100644 --- a/pub/pub_test.go +++ b/pub/pub_test.go @@ -76,8 +76,10 @@ func assertNotEqual(t *testing.T, a, b interface{}) { var ( // testErr is a test error. testErr = errors.New("test error") - // testNote is a test Note from a federated peer. + // testFederatedNote is a test Note from a federated peer. testFederatedNote vocab.ActivityStreamsNote + // testFederatedNote2 is a test Note from a federated peer. + testFederatedNote2 vocab.ActivityStreamsNote // testMyNote is a test Note owned by this server. testMyNote vocab.ActivityStreamsNote // testMyNoteNoId is a test Note owned by this server. @@ -151,6 +153,19 @@ func setupData() { id.Set(mustParse(testNoteId1)) testFederatedNote.SetJSONLDId(id) }() + // testFederatedNote2 + func() { + testFederatedNote2 = streams.NewActivityStreamsNote() + name := streams.NewActivityStreamsNameProperty() + name.AppendXMLSchemaString("A second federated note") + testFederatedNote2.SetActivityStreamsName(name) + content := streams.NewActivityStreamsContentProperty() + content.AppendXMLSchemaString("This is a simple second note being federated.") + testFederatedNote2.SetActivityStreamsContent(content) + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testNoteId2)) + testFederatedNote2.SetJSONLDId(id) + }() // testMyNote func() { testMyNote = streams.NewActivityStreamsNote() From c994dc39f033db6f73a7fa57c23af3d623db88ca Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Thu, 2 Jul 2020 23:03:01 +0200 Subject: [PATCH 10/28] Add tests and fix shadowing bug in Accept handling --- pub/federating_wrapped_callbacks.go | 12 +- pub/federating_wrapped_callbacks_test.go | 177 +++++++++++++++++++++-- pub/pub_test.go | 15 ++ 3 files changed, 189 insertions(+), 15 deletions(-) diff --git a/pub/federating_wrapped_callbacks.go b/pub/federating_wrapped_callbacks.go index 36afe15..fa79724 100644 --- a/pub/federating_wrapped_callbacks.go +++ b/pub/federating_wrapped_callbacks.go @@ -552,8 +552,8 @@ func (w FederatingWrappedCallbacks) accept(c context.Context, a vocab.ActivitySt if maybeMyFollowIRI != nil { // Verify our Follow request exists and the peer didn't // fabricate it. - actors := a.GetActivityStreamsActor() - if actors == nil || actors.Len() == 0 { + activityActors := a.GetActivityStreamsActor() + if activityActors == nil || activityActors.Len() == 0 { return fmt.Errorf("an Accept with a Follow has no actors") } // This may be a duplicate check if we dereferenced the @@ -596,7 +596,7 @@ func (w FederatingWrappedCallbacks) accept(c context.Context, a vocab.ActivitySt } // Build map of original Accept actors acceptActors := make(map[string]bool) - for iter := actors.Begin(); iter != actors.End(); iter = iter.Next() { + for iter := activityActors.Begin(); iter != activityActors.End(); iter = iter.Next() { id, err := ToId(iter) if err != nil { return err @@ -635,7 +635,11 @@ func (w FederatingWrappedCallbacks) accept(c context.Context, a vocab.ActivitySt return err } items := following.GetActivityStreamsItems() - for iter := actors.Begin(); iter != actors.End(); iter = iter.Next() { + if items == nil { + items = streams.NewActivityStreamsItemsProperty() + following.SetActivityStreamsItems(items) + } + for iter := activityActors.Begin(); iter != activityActors.End(); iter = iter.Next() { id, err := ToId(iter) if err != nil { w.db.Unlock(c, actorIRI) diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index b6471a7..7093a70 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -5,8 +5,8 @@ import ( "net/url" "testing" - "github.com/go-fed/activity/streams/vocab" "github.com/go-fed/activity/streams" + "github.com/go-fed/activity/streams/vocab" "github.com/golang/mock/gomock" ) @@ -323,7 +323,7 @@ func TestFederatedCreate(t *testing.T) { c := newCreateFn() var gotc context.Context var got vocab.ActivityStreamsCreate - w.Create =func(ctx context.Context, v vocab.ActivityStreamsCreate) error { + w.Create = func(ctx context.Context, v vocab.ActivityStreamsCreate) error { gotc = ctx got = v return nil @@ -413,32 +413,187 @@ func TestFederatedFollow(t *testing.T) { } func TestFederatedAccept(t *testing.T) { + newAcceptFn := func() vocab.ActivityStreamsAccept { + c := streams.NewActivityStreamsAccept() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI2)) + c.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + c.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsFollow(testFollow) + c.SetActivityStreamsObject(op) + return c + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockDB *MockDatabase, mockTp *MockTransport) { + mockDB = NewMockDatabase(ctl) + mockTp = NewMockTransport(ctl) + w.inboxIRI = mustParse(testMyInboxIRI) + w.db = mockDB + w.newTransport = func(c context.Context, a *url.URL, s string) (Transport, error) { + return mockTp, nil + } + return + } t.Run("DoesNothingIfNoObjects", func(t *testing.T) { - t.Errorf("Not yet implemented.") + a := newAcceptFn() + a.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.accept(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("DereferencesObjectIRI", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB, mockTp := setupFn(ctl) + followers := streams.NewActivityStreamsCollection() + expectFollowers := streams.NewActivityStreamsCollection() + expectItems := streams.NewActivityStreamsItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActorIRI)) + expectFollowers.SetActivityStreamsItems(expectItems) + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI2), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActivityIRI)).Return( + mustSerializeToBytes(testFollow), nil) + mockDB.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)) + mockDB.EXPECT().Get(ctx, mustParse(testFederatedActivityIRI)).Return( + testFollow, nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)) + mockDB.EXPECT().Lock(ctx, mustParse(testFederatedActorIRI2)) + mockDB.EXPECT().Following(ctx, mustParse(testFederatedActorIRI2)).Return( + followers, nil) + mockDB.EXPECT().Update(ctx, expectFollowers) + mockDB.EXPECT().Unlock(ctx, mustParse(testFederatedActorIRI2)) + a := newAcceptFn() + op := streams.NewActivityStreamsObjectProperty() + op.AppendIRI(mustParse(testFederatedActivityIRI)) + a.SetActivityStreamsObject(op) + err := w.accept(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("IgnoresNonFollowObjects", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB, _ := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI2), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + a := newAcceptFn() + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsListen(testListen) + a.SetActivityStreamsObject(op) + err := w.accept(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("IgnoresFollowObjectsNotContainingMe", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB, _ := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI3), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + a := newAcceptFn() + err := w.accept(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) - t.Run("VerifiesFollowExistsAndIsWellFormatted", func(t *testing.T) { - t.Errorf("Not yet implemented.") + t.Run("ErrorIfPeerLiedAboutOurFollowId", func(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB, _ := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI2), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)) + mockDB.EXPECT().Get(ctx, mustParse(testFederatedActivityIRI)).Return( + testListen, nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)) + a := newAcceptFn() + err := w.accept(ctx, a) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("UpdatesFollowingCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB, _ := setupFn(ctl) + followers := streams.NewActivityStreamsCollection() + expectFollowers := streams.NewActivityStreamsCollection() + expectItems := streams.NewActivityStreamsItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActorIRI)) + expectFollowers.SetActivityStreamsItems(expectItems) + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI2), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().Lock(ctx, mustParse(testFederatedActivityIRI)) + mockDB.EXPECT().Get(ctx, mustParse(testFederatedActivityIRI)).Return( + testFollow, nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testFederatedActivityIRI)) + mockDB.EXPECT().Lock(ctx, mustParse(testFederatedActorIRI2)) + mockDB.EXPECT().Following(ctx, mustParse(testFederatedActorIRI2)).Return( + followers, nil) + mockDB.EXPECT().Update(ctx, expectFollowers) + mockDB.EXPECT().Unlock(ctx, mustParse(testFederatedActorIRI2)) + a := newAcceptFn() + err := w.accept(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + a := newAcceptFn() + a.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + var gotc context.Context + var got vocab.ActivityStreamsAccept + w.Accept = func(ctx context.Context, v vocab.ActivityStreamsAccept) error { + gotc = ctx + got = v + return nil + } + err := w.accept(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, a, got) }) } func TestFederatedReject(t *testing.T) { + ctx := context.Background() t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + r := streams.NewActivityStreamsReject() + var w FederatingWrappedCallbacks + var gotc context.Context + var got vocab.ActivityStreamsReject + w.Reject = func(ctx context.Context, v vocab.ActivityStreamsReject) error { + gotc = ctx + got = v + return nil + } + err := w.reject(ctx, r) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, r, got) }) } diff --git a/pub/pub_test.go b/pub/pub_test.go index 8a9fbbc..66d6160 100644 --- a/pub/pub_test.go +++ b/pub/pub_test.go @@ -134,6 +134,8 @@ var ( testOrderedCollectionOfActors vocab.ActivityStreamsOrderedCollectionPage // testNestedInReplyTo is an Activity with an 'object' with an 'inReplyTo' testNestedInReplyTo vocab.ActivityStreamsListen + // testFollow is a test Follow Activity. + testFollow vocab.ActivityStreamsFollow ) // The test data cannot be created at init time since that is when the hooks of @@ -393,6 +395,19 @@ func setupData() { op.AppendActivityStreamsNote(note) testNestedInReplyTo.SetActivityStreamsObject(op) }() + // testFollow + func() { + testFollow = streams.NewActivityStreamsFollow() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + testFollow.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI2)) + testFollow.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendIRI(mustParse(testFederatedActorIRI)) + testFollow.SetActivityStreamsObject(op) + }() } // wrappedInCreate returns a Create activity wrapping the given type. From a1ac83aee879590af7cbea11ba238dfec7d6d16a Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Fri, 3 Jul 2020 17:50:08 +0200 Subject: [PATCH 11/28] Add unit tests for federated updates --- pub/federating_wrapped_callbacks_test.go | 104 +++++++++++++++++++++-- 1 file changed, 97 insertions(+), 7 deletions(-) diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index 7093a70..4eff975 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -338,26 +338,116 @@ func TestFederatedCreate(t *testing.T) { } func TestFederatedUpdate(t *testing.T) { + newUpdateFn := func() vocab.ActivityStreamsUpdate { + u := streams.NewActivityStreamsUpdate() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testNewActivityIRI)) + u.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + u.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsNote(testFederatedNote) + u.SetActivityStreamsObject(op) + return u + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockDB *MockDatabase) { + mockDB = NewMockDatabase(ctl) + w.db = mockDB + return + } t.Run("ErrorIfNoObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + u := newUpdateFn() + u.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.update(ctx, u) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfObjectLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + u := newUpdateFn() + u.GetActivityStreamsObject().Remove(0) + var w FederatingWrappedCallbacks + err := w.update(ctx, u) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfOriginMismatchesObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + u := newUpdateFn() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + u.SetJSONLDId(id) + var w FederatingWrappedCallbacks + err := w.update(ctx, u) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("UpdatesFederatedObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Update(ctx, testFederatedNote) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + u := newUpdateFn() + err := w.update(ctx, u) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("UpdatesAllFederatedObjects", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Update(ctx, testFederatedNote) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId2)) + mockDB.EXPECT().Update(ctx, testFederatedNote2) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId2)) + u := newUpdateFn() + u.GetActivityStreamsObject().AppendActivityStreamsNote(testFederatedNote2) + err := w.update(ctx, u) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("ErrorIfObjectIsIRI", func(t *testing.T) { - t.Errorf("Not yet implemented.") + u := newUpdateFn() + op := streams.NewActivityStreamsObjectProperty() + op.AppendIRI(mustParse(testNoteId1)) + u.SetActivityStreamsObject(op) + var w FederatingWrappedCallbacks + err := w.update(ctx, u) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Update(ctx, testFederatedNote) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + u := newUpdateFn() + var gotc context.Context + var got vocab.ActivityStreamsUpdate + w.Update = func(ctx context.Context, v vocab.ActivityStreamsUpdate) error { + gotc = ctx + got = v + return nil + } + err := w.update(ctx, u) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, u, got) }) } From 8af6ed9d4f680bc2183be2a840e6b6f60a155289 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Fri, 3 Jul 2020 18:06:52 +0200 Subject: [PATCH 12/28] Add unit tests for federated deletes --- pub/federating_wrapped_callbacks_test.go | 94 ++++++++++++++++++++++-- 1 file changed, 88 insertions(+), 6 deletions(-) diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index 4eff975..b8456fc 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -452,23 +452,105 @@ func TestFederatedUpdate(t *testing.T) { } func TestFederatedDelete(t *testing.T) { + newDeleteFn := func() vocab.ActivityStreamsDelete { + d := streams.NewActivityStreamsDelete() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testNewActivityIRI)) + d.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + d.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendIRI(mustParse(testNoteId1)) + d.SetActivityStreamsObject(op) + return d + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockDB *MockDatabase) { + mockDB = NewMockDatabase(ctl) + w.db = mockDB + return + } t.Run("ErrorIfNoObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + d := newDeleteFn() + d.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.deleteFn(ctx, d) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfObjectLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + d := newDeleteFn() + d.GetActivityStreamsObject().Remove(0) + var w FederatingWrappedCallbacks + err := w.deleteFn(ctx, d) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfOriginMismatchesObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + d := newDeleteFn() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + d.SetJSONLDId(id) + var w FederatingWrappedCallbacks + err := w.deleteFn(ctx, d) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("DeletesFederatedObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Delete(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + d := newDeleteFn() + err := w.deleteFn(ctx, d) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("DeletesAllFederatedObjects", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Delete(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId2)) + mockDB.EXPECT().Delete(ctx, mustParse(testNoteId2)) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId2)) + d := newDeleteFn() + d.GetActivityStreamsObject().AppendIRI(mustParse(testNoteId2)) + err := w.deleteFn(ctx, d) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Delete(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + d := newDeleteFn() + var gotc context.Context + var got vocab.ActivityStreamsDelete + w.Delete = func(ctx context.Context, v vocab.ActivityStreamsDelete) error { + gotc = ctx + got = v + return nil + } + err := w.deleteFn(ctx, d) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, d, got) }) } From 110d8bd3e51d6047cb24882ce2e0bff037703121 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Fri, 3 Jul 2020 18:44:52 +0200 Subject: [PATCH 13/28] Add unit tests for federated follows --- pub/federating_wrapped_callbacks.go | 4 + pub/federating_wrapped_callbacks_test.go | 175 +++++++++++++++++++++-- 2 files changed, 165 insertions(+), 14 deletions(-) diff --git a/pub/federating_wrapped_callbacks.go b/pub/federating_wrapped_callbacks.go index fa79724..8822fcc 100644 --- a/pub/federating_wrapped_callbacks.go +++ b/pub/federating_wrapped_callbacks.go @@ -443,6 +443,10 @@ func (w FederatingWrappedCallbacks) follow(c context.Context, a vocab.ActivitySt return err } items := followers.GetActivityStreamsItems() + if items == nil { + items = streams.NewActivityStreamsItemsProperty() + followers.SetActivityStreamsItems(items) + } for _, elem := range recipients { items.PrependIRI(elem) } diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index b8456fc..b443f6f 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -555,32 +555,179 @@ func TestFederatedDelete(t *testing.T) { } func TestFederatedFollow(t *testing.T) { + newFollowFn := func() vocab.ActivityStreamsFollow { + f := streams.NewActivityStreamsFollow() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testNewActivityIRI)) + f.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + f.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendIRI(mustParse(testFederatedActorIRI2)) + f.SetActivityStreamsObject(op) + return f + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockDB *MockDatabase) { + mockDB = NewMockDatabase(ctl) + w.db = mockDB + w.inboxIRI = mustParse(testMyInboxIRI) + return + } t.Run("ErrorIfNoObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + f := newFollowFn() + f.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.follow(ctx, f) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfObjectLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + f := newFollowFn() + f.GetActivityStreamsObject().Remove(0) + var w FederatingWrappedCallbacks + err := w.follow(ctx, f) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("OnFollowNothingDoesNothing", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + w.OnFollow = OnFollowDoNothing + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI2), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + f := newFollowFn() + err := w.follow(ctx, f) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("OnFollowAutomaticallyAcceptUpdatesFollowers", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + w.OnFollow = OnFollowAutomaticallyAccept + w.addNewIds = func(c context.Context, activity Activity) error { + return nil + } + w.deliver = func(c context.Context, outboxIRI *url.URL, activity Activity) error { + return nil + } + followers := streams.NewActivityStreamsCollection() + expectFollowers := streams.NewActivityStreamsCollection() + expectItems := streams.NewActivityStreamsItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActorIRI)) + expectFollowers.SetActivityStreamsItems(expectItems) + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI2), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().Lock(ctx, mustParse(testFederatedActorIRI2)) + mockDB.EXPECT().Followers(ctx, mustParse(testFederatedActorIRI2)).Return( + followers, nil) + mockDB.EXPECT().Update(ctx, expectFollowers) + mockDB.EXPECT().Unlock(ctx, mustParse(testFederatedActorIRI2)) + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().OutboxForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testMyOutboxIRI), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + f := newFollowFn() + err := w.follow(ctx, f) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("OnFollowAutomaticallyAcceptDelivers", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + w.OnFollow = OnFollowAutomaticallyAccept + w.addNewIds = func(c context.Context, activity Activity) error { + return nil + } + w.deliver = func(c context.Context, outboxIRI *url.URL, activity Activity) error { + if !streams.IsOrExtendsActivityStreamsAccept(activity) { + t.Fatalf("expected Accept, got %T", activity) + } + return nil + } + followers := streams.NewActivityStreamsCollection() + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI2), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().Lock(ctx, mustParse(testFederatedActorIRI2)) + mockDB.EXPECT().Followers(ctx, mustParse(testFederatedActorIRI2)).Return( + followers, nil) + mockDB.EXPECT().Update(ctx, gomock.Any()) + mockDB.EXPECT().Unlock(ctx, mustParse(testFederatedActorIRI2)) + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().OutboxForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testMyOutboxIRI), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + f := newFollowFn() + err := w.follow(ctx, f) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("OnFollowAutomaticallyRejectDelivers", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + w.OnFollow = OnFollowAutomaticallyReject + w.addNewIds = func(c context.Context, activity Activity) error { + return nil + } + w.deliver = func(c context.Context, outboxIRI *url.URL, activity Activity) error { + if !streams.IsOrExtendsActivityStreamsReject(activity) { + t.Fatalf("expected Reject, got %T", activity) + } + return nil + } + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI2), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().OutboxForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testMyOutboxIRI), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + f := newFollowFn() + err := w.follow(ctx, f) + if err != nil { + t.Fatalf("got error %s", err) + } }) - t.Run("OnFollowNothingCallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") - }) - t.Run("OnFollowAutomaticallyAcceptCallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") - }) - t.Run("OnFollowAutomaticallyRejectCallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + t.Run("CallsCustomCallback", func(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + w.OnFollow = OnFollowDoNothing + mockDB.EXPECT().Lock(ctx, mustParse(testMyInboxIRI)) + mockDB.EXPECT().ActorForInbox(ctx, mustParse(testMyInboxIRI)).Return( + mustParse(testFederatedActorIRI2), nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testMyInboxIRI)) + f := newFollowFn() + var gotc context.Context + var got vocab.ActivityStreamsFollow + w.Follow = func(ctx context.Context, v vocab.ActivityStreamsFollow) error { + gotc = ctx + got = v + return nil + } + err := w.follow(ctx, f) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, f, got) }) } From 4c60792b09fb619095639ae2d64f804caec21b1d Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sat, 4 Jul 2020 09:42:25 +0200 Subject: [PATCH 14/28] Add unit tests for federated add --- pub/federating_wrapped_callbacks_test.go | 177 ++++++++++++++++++++++- 1 file changed, 169 insertions(+), 8 deletions(-) diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index b443f6f..d3c5d0e 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -917,29 +917,190 @@ func TestFederatedReject(t *testing.T) { } func TestFederatedAdd(t *testing.T) { + newAddFn := func() vocab.ActivityStreamsAdd { + a := streams.NewActivityStreamsAdd() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + a.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + a.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsNote(testFederatedNote) + a.SetActivityStreamsObject(op) + tp := streams.NewActivityStreamsTargetProperty() + tp.AppendIRI(mustParse(testAudienceIRI)) + a.SetActivityStreamsTarget(tp) + return a + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockDB *MockDatabase) { + mockDB = NewMockDatabase(ctl) + w.db = mockDB + return + } t.Run("ErrorIfNoObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + a := newAddFn() + a.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.add(ctx, a) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfObjectLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + a := newAddFn() + a.GetActivityStreamsObject().Remove(0) + var w FederatingWrappedCallbacks + err := w.add(ctx, a) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfNoTarget", func(t *testing.T) { - t.Errorf("Not yet implemented.") + a := newAddFn() + a.SetActivityStreamsTarget(nil) + var w FederatingWrappedCallbacks + err := w.add(ctx, a) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfTargetLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + a := newAddFn() + a.GetActivityStreamsTarget().Remove(0) + var w FederatingWrappedCallbacks + err := w.add(ctx, a) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("AddsAllObjectIdsToCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + col1 := streams.NewActivityStreamsCollection() + expectCol1 := streams.NewActivityStreamsCollection() + items1 := streams.NewActivityStreamsItemsProperty() + items1.AppendIRI(mustParse(testNoteId1)) + items1.AppendIRI(mustParse(testNoteId2)) + expectCol1.SetActivityStreamsItems(items1) + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + col1, nil) + mockDB.EXPECT().Update(ctx, expectCol1).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + a := newAddFn() + a.GetActivityStreamsObject().AppendActivityStreamsNote(testFederatedNote2) + err := w.add(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("AddsAllObjectIdsToOrderedCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + col1 := streams.NewActivityStreamsOrderedCollection() + expectCol1 := streams.NewActivityStreamsOrderedCollection() + items1 := streams.NewActivityStreamsOrderedItemsProperty() + items1.AppendIRI(mustParse(testNoteId1)) + items1.AppendIRI(mustParse(testNoteId2)) + expectCol1.SetActivityStreamsOrderedItems(items1) + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + col1, nil) + mockDB.EXPECT().Update(ctx, expectCol1).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + a := newAddFn() + a.GetActivityStreamsObject().AppendActivityStreamsNote(testFederatedNote2) + err := w.add(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } + }) + t.Run("AddsAllObjectIdsToEachTarget", func(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + col1 := streams.NewActivityStreamsCollection() + expectCol1 := streams.NewActivityStreamsCollection() + items1 := streams.NewActivityStreamsItemsProperty() + items1.AppendIRI(mustParse(testNoteId1)) + expectCol1.SetActivityStreamsItems(items1) + col2 := streams.NewActivityStreamsCollection() + expectCol2 := streams.NewActivityStreamsCollection() + items2 := streams.NewActivityStreamsItemsProperty() + items2.AppendIRI(mustParse(testNoteId1)) + expectCol2.SetActivityStreamsItems(items2) + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + col1, nil) + mockDB.EXPECT().Update(ctx, expectCol1).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI2)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI2)).Return( + col2, nil) + mockDB.EXPECT().Update(ctx, expectCol2).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)) + a := newAddFn() + a.GetActivityStreamsTarget().AppendIRI(mustParse(testAudienceIRI2)) + err := w.add(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("ReturnsErrorIfTargetIsNotCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + notCol := streams.NewActivityStreamsNote() + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + notCol, nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + a := newAddFn() + err := w.add(ctx, a) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + col1 := streams.NewActivityStreamsCollection() + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + col1, nil) + mockDB.EXPECT().Update(ctx, gomock.Any()).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + var gotc context.Context + var got vocab.ActivityStreamsAdd + w.Add = func(ctx context.Context, v vocab.ActivityStreamsAdd) error { + gotc = ctx + got = v + return nil + } + a := newAddFn() + err := w.add(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, a, got) }) } From 72022bfe14f1ba00da003e005e025e39f72d5da4 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sat, 4 Jul 2020 10:00:48 +0200 Subject: [PATCH 15/28] Add unit tests for federated remove --- pub/federating_wrapped_callbacks_test.go | 201 ++++++++++++++++++++++- 1 file changed, 193 insertions(+), 8 deletions(-) diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index d3c5d0e..b67492c 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -1105,29 +1105,214 @@ func TestFederatedAdd(t *testing.T) { } func TestFederatedRemove(t *testing.T) { + newRemoveFn := func() vocab.ActivityStreamsRemove { + r := streams.NewActivityStreamsRemove() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + r.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + r.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsNote(testFederatedNote) + r.SetActivityStreamsObject(op) + tp := streams.NewActivityStreamsTargetProperty() + tp.AppendIRI(mustParse(testAudienceIRI)) + r.SetActivityStreamsTarget(tp) + return r + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockDB *MockDatabase) { + mockDB = NewMockDatabase(ctl) + w.db = mockDB + return + } t.Run("ErrorIfNoObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + r := newRemoveFn() + r.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.remove(ctx, r) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfObjectLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + r := newRemoveFn() + r.GetActivityStreamsObject().Remove(0) + var w FederatingWrappedCallbacks + err := w.remove(ctx, r) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfNoTarget", func(t *testing.T) { - t.Errorf("Not yet implemented.") + r := newRemoveFn() + r.SetActivityStreamsTarget(nil) + var w FederatingWrappedCallbacks + err := w.remove(ctx, r) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfTargetLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + r := newRemoveFn() + r.GetActivityStreamsTarget().Remove(0) + var w FederatingWrappedCallbacks + err := w.remove(ctx, r) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("RemovesAllObjectIdsFromCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + col1 := streams.NewActivityStreamsCollection() + items := streams.NewActivityStreamsItemsProperty() + items.AppendIRI(mustParse(testAudienceIRI)) + items.AppendIRI(mustParse(testAudienceIRI2)) + items.AppendIRI(mustParse(testNoteId1)) + items.AppendIRI(mustParse(testNoteId2)) + col1.SetActivityStreamsItems(items) + expectCol1 := streams.NewActivityStreamsCollection() + items1 := streams.NewActivityStreamsItemsProperty() + items1.AppendIRI(mustParse(testAudienceIRI)) + items1.AppendIRI(mustParse(testAudienceIRI2)) + expectCol1.SetActivityStreamsItems(items1) + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + col1, nil) + mockDB.EXPECT().Update(ctx, expectCol1).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + r := newRemoveFn() + r.GetActivityStreamsObject().AppendActivityStreamsNote(testFederatedNote2) + err := w.remove(ctx, r) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("RemovesAllObjectIdsFromOrderedCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + col1 := streams.NewActivityStreamsOrderedCollection() + items := streams.NewActivityStreamsOrderedItemsProperty() + items.AppendIRI(mustParse(testAudienceIRI)) + items.AppendIRI(mustParse(testAudienceIRI2)) + items.AppendIRI(mustParse(testNoteId1)) + items.AppendIRI(mustParse(testNoteId2)) + col1.SetActivityStreamsOrderedItems(items) + expectCol1 := streams.NewActivityStreamsOrderedCollection() + items1 := streams.NewActivityStreamsOrderedItemsProperty() + items1.AppendIRI(mustParse(testAudienceIRI)) + items1.AppendIRI(mustParse(testAudienceIRI2)) + expectCol1.SetActivityStreamsOrderedItems(items1) + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + col1, nil) + mockDB.EXPECT().Update(ctx, expectCol1).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + r := newRemoveFn() + r.GetActivityStreamsObject().AppendActivityStreamsNote(testFederatedNote2) + err := w.remove(ctx, r) + if err != nil { + t.Fatalf("got error %s", err) + } + }) + t.Run("RemovesAllObjectIdsFromEachTarget", func(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + col1 := streams.NewActivityStreamsCollection() + items := streams.NewActivityStreamsItemsProperty() + items.AppendIRI(mustParse(testFederatedActorIRI3)) + items.AppendIRI(mustParse(testFederatedActorIRI4)) + items.AppendIRI(mustParse(testNoteId1)) + col1.SetActivityStreamsItems(items) + expectCol1 := streams.NewActivityStreamsCollection() + items1 := streams.NewActivityStreamsItemsProperty() + items1.AppendIRI(mustParse(testFederatedActorIRI3)) + items1.AppendIRI(mustParse(testFederatedActorIRI4)) + expectCol1.SetActivityStreamsItems(items1) + col2 := streams.NewActivityStreamsCollection() + items0 := streams.NewActivityStreamsItemsProperty() + items0.AppendIRI(mustParse(testFederatedActorIRI)) + items0.AppendIRI(mustParse(testNoteId1)) + items0.AppendIRI(mustParse(testFederatedActorIRI2)) + col2.SetActivityStreamsItems(items0) + expectCol2 := streams.NewActivityStreamsCollection() + items2 := streams.NewActivityStreamsItemsProperty() + items2.AppendIRI(mustParse(testFederatedActorIRI)) + items2.AppendIRI(mustParse(testFederatedActorIRI2)) + expectCol2.SetActivityStreamsItems(items2) + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + col1, nil) + mockDB.EXPECT().Update(ctx, expectCol1).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI2)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI2)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI2)).Return( + col2, nil) + mockDB.EXPECT().Update(ctx, expectCol2).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI2)) + r := newRemoveFn() + r.GetActivityStreamsTarget().AppendIRI(mustParse(testAudienceIRI2)) + err := w.remove(ctx, r) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("ReturnsErrorIfTargetIsNotCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + notCol := streams.NewActivityStreamsNote() + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + notCol, nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + r := newRemoveFn() + err := w.remove(ctx, r) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + col1 := streams.NewActivityStreamsCollection() + mockDB.EXPECT().Lock(ctx, mustParse(testAudienceIRI)) + mockDB.EXPECT().Owns(ctx, mustParse(testAudienceIRI)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testAudienceIRI)).Return( + col1, nil) + mockDB.EXPECT().Update(ctx, gomock.Any()).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testAudienceIRI)) + var gotc context.Context + var got vocab.ActivityStreamsRemove + w.Remove = func(ctx context.Context, v vocab.ActivityStreamsRemove) error { + gotc = ctx + got = v + return nil + } + r := newRemoveFn() + err := w.remove(ctx, r) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, r, got) }) } From c58f23bd17959c18c8f9675c0149121ea37dc166 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sat, 4 Jul 2020 10:41:42 +0200 Subject: [PATCH 16/28] Add unit tests for federated like --- pub/federating_wrapped_callbacks_test.go | 168 ++++++++++++++++++++++- 1 file changed, 161 insertions(+), 7 deletions(-) diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index b67492c..73710ae 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -1317,26 +1317,180 @@ func TestFederatedRemove(t *testing.T) { } func TestFederatedLike(t *testing.T) { + newLikeFn := func() vocab.ActivityStreamsLike { + l := streams.NewActivityStreamsLike() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + l.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + l.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsNote(testFederatedNote) + l.SetActivityStreamsObject(op) + return l + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockDB *MockDatabase) { + mockDB = NewMockDatabase(ctl) + w.db = mockDB + return + } t.Run("ErrorIfNoObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + l := newLikeFn() + l.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.like(ctx, l) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfObjectLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + l := newLikeFn() + l.GetActivityStreamsObject().Remove(0) + var w FederatingWrappedCallbacks + err := w.like(ctx, l) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("SkipsUnownedObjects", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return(false, nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + l := newLikeFn() + err := w.like(ctx, l) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("AddsToNewLikesCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + note := streams.NewActivityStreamsNote() + expectNote := streams.NewActivityStreamsNote() + expectLikes := streams.NewActivityStreamsLikesProperty() + expectCol := streams.NewActivityStreamsCollection() + expectItems := streams.NewActivityStreamsItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActivityIRI)) + expectCol.SetActivityStreamsItems(expectItems) + expectLikes.SetActivityStreamsCollection(expectCol) + expectNote.SetActivityStreamsLikes(expectLikes) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return(true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testNoteId1)).Return( + note, nil) + mockDB.EXPECT().Update(ctx, expectNote).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + l := newLikeFn() + err := w.like(ctx, l) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("AddsToExistingLikesCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + note := streams.NewActivityStreamsNote() + likes := streams.NewActivityStreamsLikesProperty() + col := streams.NewActivityStreamsCollection() + items := streams.NewActivityStreamsItemsProperty() + items.AppendIRI(mustParse(testFederatedActivityIRI2)) + col.SetActivityStreamsItems(items) + likes.SetActivityStreamsCollection(col) + note.SetActivityStreamsLikes(likes) + expectNote := streams.NewActivityStreamsNote() + expectLikes := streams.NewActivityStreamsLikesProperty() + expectCol := streams.NewActivityStreamsCollection() + expectItems := streams.NewActivityStreamsItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActivityIRI)) + expectItems.AppendIRI(mustParse(testFederatedActivityIRI2)) + expectCol.SetActivityStreamsItems(expectItems) + expectLikes.SetActivityStreamsCollection(expectCol) + expectNote.SetActivityStreamsLikes(expectLikes) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return(true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testNoteId1)).Return( + note, nil) + mockDB.EXPECT().Update(ctx, expectNote).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + l := newLikeFn() + err := w.like(ctx, l) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("AddsToExistingLikesOrderedCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + note := streams.NewActivityStreamsNote() + likes := streams.NewActivityStreamsLikesProperty() + col := streams.NewActivityStreamsOrderedCollection() + items := streams.NewActivityStreamsOrderedItemsProperty() + items.AppendIRI(mustParse(testFederatedActivityIRI2)) + col.SetActivityStreamsOrderedItems(items) + likes.SetActivityStreamsOrderedCollection(col) + note.SetActivityStreamsLikes(likes) + expectNote := streams.NewActivityStreamsNote() + expectLikes := streams.NewActivityStreamsLikesProperty() + expectCol := streams.NewActivityStreamsOrderedCollection() + expectItems := streams.NewActivityStreamsOrderedItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActivityIRI)) + expectItems.AppendIRI(mustParse(testFederatedActivityIRI2)) + expectCol.SetActivityStreamsOrderedItems(expectItems) + expectLikes.SetActivityStreamsOrderedCollection(expectCol) + expectNote.SetActivityStreamsLikes(expectLikes) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return(true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testNoteId1)).Return( + note, nil) + mockDB.EXPECT().Update(ctx, expectNote).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + l := newLikeFn() + err := w.like(ctx, l) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + note := streams.NewActivityStreamsNote() + expectNote := streams.NewActivityStreamsNote() + expectLikes := streams.NewActivityStreamsLikesProperty() + expectCol := streams.NewActivityStreamsCollection() + expectItems := streams.NewActivityStreamsItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActivityIRI)) + expectCol.SetActivityStreamsItems(expectItems) + expectLikes.SetActivityStreamsCollection(expectCol) + expectNote.SetActivityStreamsLikes(expectLikes) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return(true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testNoteId1)).Return( + note, nil) + mockDB.EXPECT().Update(ctx, expectNote).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + var gotc context.Context + var got vocab.ActivityStreamsLike + w.Like = func(ctx context.Context, v vocab.ActivityStreamsLike) error { + gotc = ctx + got = v + return nil + } + l := newLikeFn() + err := w.like(ctx, l) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, l, got) }) } From d00364181063c1d411f8059ef4957a2eded241fd Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sat, 4 Jul 2020 17:47:17 +0200 Subject: [PATCH 17/28] Add unit tests for federated announce --- pub/federating_wrapped_callbacks.go | 8 +- pub/federating_wrapped_callbacks_test.go | 158 ++++++++++++++++++++++- 2 files changed, 158 insertions(+), 8 deletions(-) diff --git a/pub/federating_wrapped_callbacks.go b/pub/federating_wrapped_callbacks.go index 8822fcc..a406acb 100644 --- a/pub/federating_wrapped_callbacks.go +++ b/pub/federating_wrapped_callbacks.go @@ -865,9 +865,11 @@ func (w FederatingWrappedCallbacks) announce(c context.Context, a vocab.Activity } return nil } - for iter := op.Begin(); iter != op.End(); iter = iter.Next() { - if err := loopFn(iter); err != nil { - return err + if op != nil { + for iter := op.Begin(); iter != op.End(); iter = iter.Next() { + if err := loopFn(iter); err != nil { + return err + } } } if w.Announce != nil { diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index 73710ae..728cbee 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -1495,20 +1495,168 @@ func TestFederatedLike(t *testing.T) { } func TestFederatedAnnounce(t *testing.T) { + newAnnounceFn := func() vocab.ActivityStreamsAnnounce { + a := streams.NewActivityStreamsAnnounce() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + a.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + a.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsNote(testFederatedNote) + a.SetActivityStreamsObject(op) + return a + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockDB *MockDatabase) { + mockDB = NewMockDatabase(ctl) + w.db = mockDB + return + } + t.Run("DoesNothingWhenNoObjects", func(t *testing.T) { + a := newAnnounceFn() + a.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.announce(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } + }) t.Run("SkipsUnownedObjects", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return( + false, nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + a := newAnnounceFn() + err := w.announce(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("AddsToNewSharesCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + note := streams.NewActivityStreamsNote() + expectNote := streams.NewActivityStreamsNote() + expectShares := streams.NewActivityStreamsSharesProperty() + expectCol := streams.NewActivityStreamsCollection() + expectItems := streams.NewActivityStreamsItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActivityIRI)) + expectCol.SetActivityStreamsItems(expectItems) + expectShares.SetActivityStreamsCollection(expectCol) + expectNote.SetActivityStreamsShares(expectShares) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testNoteId1)).Return( + note, nil) + mockDB.EXPECT().Update(ctx, expectNote).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + a := newAnnounceFn() + err := w.announce(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("AddsToExistingSharesCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + note := streams.NewActivityStreamsNote() + shares := streams.NewActivityStreamsSharesProperty() + col := streams.NewActivityStreamsCollection() + items := streams.NewActivityStreamsItemsProperty() + items.AppendIRI(mustParse(testFederatedActivityIRI2)) + col.SetActivityStreamsItems(items) + shares.SetActivityStreamsCollection(col) + note.SetActivityStreamsShares(shares) + expectNote := streams.NewActivityStreamsNote() + expectShares := streams.NewActivityStreamsSharesProperty() + expectCol := streams.NewActivityStreamsCollection() + expectItems := streams.NewActivityStreamsItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActivityIRI)) + expectItems.AppendIRI(mustParse(testFederatedActivityIRI2)) + expectCol.SetActivityStreamsItems(expectItems) + expectShares.SetActivityStreamsCollection(expectCol) + expectNote.SetActivityStreamsShares(expectShares) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testNoteId1)).Return( + note, nil) + mockDB.EXPECT().Update(ctx, expectNote).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + a := newAnnounceFn() + err := w.announce(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("AddsToExistingSharesOrderedCollection", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + note := streams.NewActivityStreamsNote() + shares := streams.NewActivityStreamsSharesProperty() + col := streams.NewActivityStreamsOrderedCollection() + items := streams.NewActivityStreamsOrderedItemsProperty() + items.AppendIRI(mustParse(testFederatedActivityIRI2)) + col.SetActivityStreamsOrderedItems(items) + shares.SetActivityStreamsOrderedCollection(col) + note.SetActivityStreamsShares(shares) + expectNote := streams.NewActivityStreamsNote() + expectShares := streams.NewActivityStreamsSharesProperty() + expectCol := streams.NewActivityStreamsOrderedCollection() + expectItems := streams.NewActivityStreamsOrderedItemsProperty() + expectItems.AppendIRI(mustParse(testFederatedActivityIRI)) + expectItems.AppendIRI(mustParse(testFederatedActivityIRI2)) + expectCol.SetActivityStreamsOrderedItems(expectItems) + expectShares.SetActivityStreamsOrderedCollection(expectCol) + expectNote.SetActivityStreamsShares(expectShares) + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testNoteId1)).Return( + note, nil) + mockDB.EXPECT().Update(ctx, expectNote).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + a := newAnnounceFn() + err := w.announce(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockDB := setupFn(ctl) + note := streams.NewActivityStreamsNote() + mockDB.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDB.EXPECT().Owns(ctx, mustParse(testNoteId1)).Return( + true, nil) + mockDB.EXPECT().Get(ctx, mustParse(testNoteId1)).Return( + note, nil) + mockDB.EXPECT().Update(ctx, gomock.Any()).Return(nil) + mockDB.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + var gotc context.Context + var got vocab.ActivityStreamsAnnounce + w.Announce = func(ctx context.Context, v vocab.ActivityStreamsAnnounce) error { + gotc = ctx + got = v + return nil + } + a := newAnnounceFn() + err := w.announce(ctx, a) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, a, got) }) } From a8662e547a68c4f919e389f1397384159449d413 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sat, 4 Jul 2020 18:25:35 +0200 Subject: [PATCH 18/28] Add unit tests for federated undo --- pub/federating_wrapped_callbacks_test.go | 114 ++++++++++++++++++++++- pub/util.go | 42 ++++----- 2 files changed, 131 insertions(+), 25 deletions(-) diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index 728cbee..1630353 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -1661,17 +1661,123 @@ func TestFederatedAnnounce(t *testing.T) { } func TestFederatedUndo(t *testing.T) { + newUndoFn := func() vocab.ActivityStreamsUndo { + u := streams.NewActivityStreamsUndo() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI2)) + u.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + u.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsListen(testListen) + u.SetActivityStreamsObject(op) + return u + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (w FederatingWrappedCallbacks, mockTp *MockTransport) { + mockTp = NewMockTransport(ctl) + w.inboxIRI = mustParse(testMyInboxIRI) + w.newTransport = func(c context.Context, a *url.URL, s string) (Transport, error) { + return mockTp, nil + } + return + } t.Run("ErrorIfNoObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + u := newUndoFn() + u.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.undo(ctx, u) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfObjectLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + u := newUndoFn() + u.GetActivityStreamsObject().Remove(0) + var w FederatingWrappedCallbacks + err := w.undo(ctx, u) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfActorMismatch", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockTp := setupFn(ctl) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActivityIRI)).Return( + mustSerializeToBytes(testListen), nil) + u := newUndoFn() + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI2)) + u.SetActivityStreamsActor(actor) + err := w.undo(ctx, u) + if err == nil { + t.Fatalf("expected error, got none") + } + }) + t.Run("ErrorIfActorMismatchWhenDereferencingIRI", func(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockTp := setupFn(ctl) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActivityIRI)).Return( + mustSerializeToBytes(testFollow), nil) + u := newUndoFn() + op := streams.NewActivityStreamsObjectProperty() + op.AppendIRI(mustParse(testFederatedActivityIRI)) + u.SetActivityStreamsObject(op) + err := w.undo(ctx, u) + if err == nil { + t.Fatalf("expected error, got none") + } + }) + t.Run("DereferencesWhenUndoValue", func(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockTp := setupFn(ctl) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActivityIRI)).Return( + mustSerializeToBytes(testListen), nil) + u := newUndoFn() + err := w.undo(ctx, u) + if err != nil { + t.Fatalf("got error %s", err) + } + }) + t.Run("DereferencesWhenUndoIRI", func(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockTp := setupFn(ctl) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActivityIRI)).Return( + mustSerializeToBytes(testListen), nil) + u := newUndoFn() + op := streams.NewActivityStreamsObjectProperty() + op.AppendIRI(mustParse(testFederatedActivityIRI)) + u.SetActivityStreamsObject(op) + err := w.undo(ctx, u) + if err != nil { + t.Fatalf("got error %s", err) + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + ctl := gomock.NewController(t) + defer ctl.Finish() + w, mockTp := setupFn(ctl) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActivityIRI)).Return( + mustSerializeToBytes(testListen), nil) + var gotc context.Context + var got vocab.ActivityStreamsUndo + w.Undo = func(ctx context.Context, v vocab.ActivityStreamsUndo) error { + gotc = ctx + got = v + return nil + } + u := newUndoFn() + err := w.undo(ctx, u) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, u, got) }) } diff --git a/pub/util.go b/pub/util.go index ddf0f01..3f2e671 100644 --- a/pub/util.go +++ b/pub/util.go @@ -759,27 +759,27 @@ func mustHaveActivityActorsMatchObjectActors(c context.Context, activityActorMap[id.String()] = true } for iter := op.Begin(); iter != op.End(); iter = iter.Next() { - t := iter.GetType() - if t == nil && iter.IsIRI() { - // Attempt to dereference the IRI instead - tport, err := newTransport(c, boxIRI, goFedUserAgent()) - if err != nil { - return err - } - b, err := tport.Dereference(c, iter.GetIRI()) - if err != nil { - return err - } - var m map[string]interface{} - if err = json.Unmarshal(b, &m); err != nil { - return err - } - t, err = streams.ToType(c, m) - if err != nil { - return err - } - } else { - return fmt.Errorf("cannot verify actors: object is neither a value nor IRI") + iri, err := ToId(iter) + if err != nil { + return err + } + // Attempt to dereference the IRI, regardless whether it is a + // type or IRI + tport, err := newTransport(c, boxIRI, goFedUserAgent()) + if err != nil { + return err + } + b, err := tport.Dereference(c, iri) + if err != nil { + return err + } + var m map[string]interface{} + if err = json.Unmarshal(b, &m); err != nil { + return err + } + t, err := streams.ToType(c, m) + if err != nil { + return err } ac, ok := t.(actorer) if !ok { From 5ad09ded3ef596e2e27619cb56a0b4581ce670e5 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sat, 4 Jul 2020 18:30:17 +0200 Subject: [PATCH 19/28] Add unit tests for federated block --- pub/federating_wrapped_callbacks_test.go | 46 ++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/pub/federating_wrapped_callbacks_test.go b/pub/federating_wrapped_callbacks_test.go index 1630353..f0f5803 100644 --- a/pub/federating_wrapped_callbacks_test.go +++ b/pub/federating_wrapped_callbacks_test.go @@ -1782,13 +1782,53 @@ func TestFederatedUndo(t *testing.T) { } func TestFederatedBlock(t *testing.T) { + newBlockFn := func() vocab.ActivityStreamsBlock { + b := streams.NewActivityStreamsBlock() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + b.SetJSONLDId(id) + actor := streams.NewActivityStreamsActorProperty() + actor.AppendIRI(mustParse(testFederatedActorIRI)) + b.SetActivityStreamsActor(actor) + op := streams.NewActivityStreamsObjectProperty() + op.AppendIRI(mustParse(testFederatedActorIRI2)) + b.SetActivityStreamsObject(op) + return b + } + ctx := context.Background() t.Run("ErrorIfNoObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + b := newBlockFn() + b.SetActivityStreamsObject(nil) + var w FederatingWrappedCallbacks + err := w.block(ctx, b) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("ErrorIfObjectLengthZero", func(t *testing.T) { - t.Errorf("Not yet implemented.") + b := newBlockFn() + b.GetActivityStreamsObject().Remove(0) + var w FederatingWrappedCallbacks + err := w.block(ctx, b) + if err == nil { + t.Fatalf("expected error, got none") + } }) t.Run("CallsCustomCallback", func(t *testing.T) { - t.Errorf("Not yet implemented.") + var w FederatingWrappedCallbacks + var gotc context.Context + var got vocab.ActivityStreamsBlock + w.Block = func(ctx context.Context, v vocab.ActivityStreamsBlock) error { + gotc = ctx + got = v + return nil + } + b := newBlockFn() + err := w.block(ctx, b) + if err != nil { + t.Fatalf("got error %s", err) + } + assertEqual(t, ctx, gotc) + assertEqual(t, b, got) }) } From fa448c7559b7c19d9adf658db83cc5dcbe8c61fd Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sun, 5 Jul 2020 14:10:33 +0200 Subject: [PATCH 20/28] Improve bto & bcc stripping before delivery. Added unit tests covering the delivery call. --- pub/activity.go | 4 + pub/pub_test.go | 41 +++ pub/side_effect_actor_test.go | 584 ++++++++++++++++++++++++++++++++-- pub/util.go | 21 +- 4 files changed, 616 insertions(+), 34 deletions(-) diff --git a/pub/activity.go b/pub/activity.go index c1de39f..6a1d445 100644 --- a/pub/activity.go +++ b/pub/activity.go @@ -40,6 +40,10 @@ type Activity interface { SetActivityStreamsObject(i vocab.ActivityStreamsObjectProperty) // SetActivityStreamsTo sets the "to" property. SetActivityStreamsTo(i vocab.ActivityStreamsToProperty) + // SetActivityStreamsBto sets the "bto" property. + SetActivityStreamsBto(i vocab.ActivityStreamsBtoProperty) + // SetActivityStreamsBcc sets the "bcc" property. + SetActivityStreamsBcc(i vocab.ActivityStreamsBccProperty) // SetActivityStreamsAttributedTo sets the "attributedTo" property. SetActivityStreamsAttributedTo(i vocab.ActivityStreamsAttributedToProperty) } diff --git a/pub/pub_test.go b/pub/pub_test.go index 66d6160..5621c7e 100644 --- a/pub/pub_test.go +++ b/pub/pub_test.go @@ -24,6 +24,8 @@ const ( testFederatedActorIRI2 = "https://other.example.com/addison" testFederatedActorIRI3 = "https://other.example.com/sam" testFederatedActorIRI4 = "https://other.example.com/jessie" + testFederatedInboxIRI = "https://other.example.com/dakota/inbox" + testFederatedInboxIRI2 = "https://other.example.com/addison/inbox" testNoteId1 = "https://example.com/note/1" testNoteId2 = "https://example.com/note/2" testNewActivityIRI = "https://example.com/new/1" @@ -126,6 +128,12 @@ var ( testOrderedCollectionWithBothFederatedIds vocab.ActivityStreamsOrderedCollectionPage // testPerson is a Person. testPerson vocab.ActivityStreamsPerson + // testMyPerson is my Person. + testMyPerson vocab.ActivityStreamsPerson + // testFederatedPerson1 is a federated Person. + testFederatedPerson1 vocab.ActivityStreamsPerson + // testFederatedPerson2 is a federated Person. + testFederatedPerson2 vocab.ActivityStreamsPerson // testService is a Service. testService vocab.ActivityStreamsService // testCollectionOfActors is a collection of actors. @@ -343,6 +351,39 @@ func setupData() { id.Set(mustParse(testPersonIRI)) testPerson.SetJSONLDId(id) }() + // testMyPerson + func() { + testMyPerson = streams.NewActivityStreamsPerson() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testPersonIRI)) + testMyPerson.SetJSONLDId(id) + inbox := streams.NewActivityStreamsInboxProperty() + inbox.SetIRI(mustParse(testMyInboxIRI)) + testMyPerson.SetActivityStreamsInbox(inbox) + outbox := streams.NewActivityStreamsOutboxProperty() + outbox.SetIRI(mustParse(testMyOutboxIRI)) + testMyPerson.SetActivityStreamsOutbox(outbox) + }() + // testFederatedPerson1 + func() { + testFederatedPerson1 = streams.NewActivityStreamsPerson() + id := streams.NewJSONLDIdProperty() + id.SetIRI(mustParse(testFederatedActorIRI)) + testFederatedPerson1.SetJSONLDId(id) + inbox := streams.NewActivityStreamsInboxProperty() + inbox.SetIRI(mustParse(testFederatedInboxIRI)) + testFederatedPerson1.SetActivityStreamsInbox(inbox) + }() + // testFederatedPerson2 + func() { + testFederatedPerson2 = streams.NewActivityStreamsPerson() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActorIRI2)) + testFederatedPerson2.SetJSONLDId(id) + inbox := streams.NewActivityStreamsInboxProperty() + inbox.SetIRI(mustParse(testFederatedInboxIRI2)) + testFederatedPerson2.SetActivityStreamsInbox(inbox) + }() // testService func() { testService = streams.NewActivityStreamsService() diff --git a/pub/side_effect_actor_test.go b/pub/side_effect_actor_test.go index bc7de35..35c8c39 100644 --- a/pub/side_effect_actor_test.go +++ b/pub/side_effect_actor_test.go @@ -2,11 +2,14 @@ package pub import ( "context" - "github.com/go-fed/activity/streams/vocab" - "github.com/golang/mock/gomock" + "fmt" "net/http/httptest" "net/url" "testing" + + "github.com/go-fed/activity/streams" + "github.com/go-fed/activity/streams/vocab" + "github.com/golang/mock/gomock" ) // TestPassThroughMethods tests the methods that pass-through to other @@ -1068,50 +1071,583 @@ func TestAddNewIds(t *testing.T) { // TestDeliver ensures federated delivery of an activity happens correctly to // the ActivityPub specification. func TestDeliver(t *testing.T) { + baseActivityFn := func() vocab.ActivityStreamsCreate { + act := streams.NewActivityStreamsCreate() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testNewActivityIRI)) + act.SetJSONLDId(id) + op := streams.NewActivityStreamsObjectProperty() + note := streams.NewActivityStreamsNote() + op.AppendActivityStreamsNote(note) + act.SetActivityStreamsObject(op) + return act + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (c *MockCommonBehavior, fp *MockFederatingProtocol, sp *MockSocialProtocol, db *MockDatabase, cl *MockClock, a DelegateActor) { + setupData() + c = NewMockCommonBehavior(ctl) + fp = NewMockFederatingProtocol(ctl) + sp = NewMockSocialProtocol(ctl) + db = NewMockDatabase(ctl) + cl = NewMockClock(ctl) + a = &sideEffectActor{ + common: c, + s2s: fp, + c2s: sp, + db: db, + clock: cl, + } + return + } t.Run("SendToRecipientsInTo", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + to := streams.NewActivityStreamsToProperty() + to.AppendIRI(mustParse(testFederatedActorIRI)) + to.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsTo(to) + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(act), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) t.Run("SendToRecipientsInBto", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + bto := streams.NewActivityStreamsBtoProperty() + bto.AppendIRI(mustParse(testFederatedActorIRI)) + bto.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsBto(bto) + expectAct := baseActivityFn() // Ensure Bto is stripped + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(expectAct), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) t.Run("SendToRecipientsInCc", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + cc := streams.NewActivityStreamsCcProperty() + cc.AppendIRI(mustParse(testFederatedActorIRI)) + cc.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsCc(cc) + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(act), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) t.Run("SendToRecipientsInBcc", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + bcc := streams.NewActivityStreamsBccProperty() + bcc.AppendIRI(mustParse(testFederatedActorIRI)) + bcc.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsBcc(bcc) + expectAct := baseActivityFn() // Ensure Bcc is stripped + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(expectAct), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) t.Run("SendToRecipientsInAudience", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + aud := streams.NewActivityStreamsAudienceProperty() + aud.AppendIRI(mustParse(testFederatedActorIRI)) + aud.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsAudience(aud) + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(act), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) t.Run("DoesNotSendToPublicIRI", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + to := streams.NewActivityStreamsToProperty() + to.AppendIRI(mustParse(testFederatedActorIRI)) + to.AppendIRI(mustParse(testFederatedActorIRI2)) + to.AppendIRI(mustParse(PublicActivityPubIRI)) + act.SetActivityStreamsTo(to) + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(act), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) t.Run("RecursivelyResolveCollectionActors", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + to := streams.NewActivityStreamsToProperty() + to.AppendIRI(mustParse(testAudienceIRI)) + act.SetActivityStreamsTo(to) + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(2) + mockTp.EXPECT().Dereference(ctx, mustParse(testAudienceIRI)).Return( + mustSerializeToBytes(testCollectionOfActors), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(act), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) t.Run("RecursivelyResolveOrderedCollectionActors", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + to := streams.NewActivityStreamsToProperty() + to.AppendIRI(mustParse(testAudienceIRI)) + act.SetActivityStreamsTo(to) + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(2) + mockTp.EXPECT().Dereference(ctx, mustParse(testAudienceIRI)).Return( + mustSerializeToBytes(testOrderedCollectionOfActors), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI3)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI4)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(act), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) t.Run("DoesNotRecursivelyResolveCollectionActorsIfExceedingMaxDepth", func(t *testing.T) { - t.Errorf("Not yet implemented.") - }) - t.Run("DoesNotSendIfMoreThanOneAttributedTo", func(t *testing.T) { - t.Errorf("Not yet implemented.") - }) - t.Run("DoesNotSendIfThisActorIsNotInAttributedTo", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + to := streams.NewActivityStreamsToProperty() + to.AppendIRI(mustParse(testAudienceIRI)) + act.SetActivityStreamsTo(to) + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testAudienceIRI)).Return( + mustSerializeToBytes(testCollectionOfActors), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(act), nil) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) t.Run("DedupesRecipients", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + to := streams.NewActivityStreamsToProperty() + to.AppendIRI(mustParse(testFederatedActorIRI)) + to.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsTo(to) + bto := streams.NewActivityStreamsBtoProperty() + bto.AppendIRI(mustParse(testFederatedActorIRI)) + bto.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsBto(bto) + cc := streams.NewActivityStreamsCcProperty() + cc.AppendIRI(mustParse(testFederatedActorIRI)) + cc.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsCc(cc) + bcc := streams.NewActivityStreamsBccProperty() + bcc.AppendIRI(mustParse(testFederatedActorIRI)) + bcc.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsBcc(bcc) + expectAct := baseActivityFn() // Ensure Bcc & Bto are stripped + expectAct.SetActivityStreamsTo(to) + expectAct.SetActivityStreamsCc(cc) + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil).Times(4) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil).Times(4) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(expectAct), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) - t.Run("StripsBto", func(t *testing.T) { - t.Errorf("Not yet implemented.") + t.Run("StripsBtoOnObject", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + bto := streams.NewActivityStreamsBtoProperty() + bto.AppendIRI(mustParse(testFederatedActorIRI)) + bto.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsBto(bto) + act.GetActivityStreamsObject().At(0).GetActivityStreamsNote().SetActivityStreamsBto(bto) + expectAct := baseActivityFn() // Ensure Bto is stripped + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(expectAct), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) - t.Run("StripsBcc", func(t *testing.T) { - t.Errorf("Not yet implemented.") + t.Run("StripsBccOnObject", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + bcc := streams.NewActivityStreamsBccProperty() + bcc.AppendIRI(mustParse(testFederatedActorIRI)) + bcc.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsBcc(bcc) + act.GetActivityStreamsObject().At(0).GetActivityStreamsNote().SetActivityStreamsBcc(bcc) + expectAct := baseActivityFn() // Ensure Bto is stripped + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(expectAct), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) }) - t.Run("ReturnsErrorIfAnyTransportRequestsFail", func(t *testing.T) { - t.Errorf("Not yet implemented.") + t.Run("DoesNotReturnErrorIfDereferenceRecipientFails", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + to := streams.NewActivityStreamsToProperty() + to.AppendIRI(mustParse(testFederatedActorIRI)) + to.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsTo(to) + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI2), + } + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + []byte{}, fmt.Errorf("test error")) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(act), expectRecip) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, nil) + }) + t.Run("ReturnsErrorIfBatchDeliverFails", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + c, mockFp, _, mockDb, _, a := setupFn(ctl) + mockTp := NewMockTransport(ctl) + act := baseActivityFn() + to := streams.NewActivityStreamsToProperty() + to.AppendIRI(mustParse(testFederatedActorIRI)) + to.AppendIRI(mustParse(testFederatedActorIRI2)) + act.SetActivityStreamsTo(to) + expectRecip := []*url.URL{ + mustParse(testFederatedInboxIRI), + mustParse(testFederatedInboxIRI2), + } + expectErr := fmt.Errorf("test error") + // Mock + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockFp.EXPECT().MaxDeliveryRecursionDepth(ctx).Return(1) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI)).Return( + mustSerializeToBytes(testFederatedPerson1), nil) + mockTp.EXPECT().Dereference(ctx, mustParse(testFederatedActorIRI2)).Return( + mustSerializeToBytes(testFederatedPerson2), nil) + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().Lock(ctx, mustParse(testPersonIRI)) + mockDb.EXPECT().Get(ctx, mustParse(testPersonIRI)).Return( + testMyPerson, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testPersonIRI)) + c.EXPECT().NewTransport(ctx, mustParse(testMyOutboxIRI), goFedUserAgent()).Return( + mockTp, nil) + mockTp.EXPECT().BatchDeliver(ctx, mustSerializeToBytes(act), expectRecip).Return( + expectErr) + // Run & Verify + err := a.Deliver(ctx, mustParse(testMyOutboxIRI), act) + assertEqual(t, err, expectErr) }) } diff --git a/pub/util.go b/pub/util.go index 3f2e671..ec3e2e8 100644 --- a/pub/util.go +++ b/pub/util.go @@ -412,16 +412,17 @@ func dedupeIRIs(recipients, ignored []*url.URL) (out []*url.URL) { // Note that this requirement of the specification is under "Section 6: Client // to Server Interactions", the Social API, and not the Federative API. func stripHiddenRecipients(activity Activity) { - bto := activity.GetActivityStreamsBto() - if bto != nil { - for i := bto.Len() - 1; i >= 0; i-- { - bto.Remove(i) - } - } - bcc := activity.GetActivityStreamsBcc() - if bcc != nil { - for i := bcc.Len() - 1; i >= 0; i-- { - bcc.Remove(i) + activity.SetActivityStreamsBto(nil) + activity.SetActivityStreamsBcc(nil) + op := activity.GetActivityStreamsObject() + if op != nil { + for iter := op.Begin(); iter != op.End(); iter = iter.Next() { + if v, ok := iter.GetType().(btoer); ok { + v.SetActivityStreamsBto(nil) + } + if v, ok := iter.GetType().(bccer); ok { + v.SetActivityStreamsBcc(nil) + } } } } From 78c96972b2d668e8bee37d19cf1037f90d6e93ec Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sun, 5 Jul 2020 15:22:00 +0200 Subject: [PATCH 21/28] Clear sensitive fields by setting nil instead of removing --- pub/util.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pub/util.go b/pub/util.go index ec3e2e8..5b0a511 100644 --- a/pub/util.go +++ b/pub/util.go @@ -978,20 +978,10 @@ func remove(c context.Context, // and recursively on every 'object' property value. func clearSensitiveFields(obj vocab.Type) { if t, ok := obj.(btoer); ok { - bto := t.GetActivityStreamsBto() - if bto != nil { - for bto.Len() > 0 { - bto.Remove(0) - } - } + t.SetActivityStreamsBto(nil) } if t, ok := obj.(bccer); ok { - bcc := t.GetActivityStreamsBcc() - if bcc != nil { - for bcc.Len() > 0 { - bcc.Remove(0) - } - } + t.SetActivityStreamsBcc(nil) } if t, ok := obj.(objecter); ok { op := t.GetActivityStreamsObject() From 18fcfcf812ebba910c774abbe5592557745b5599 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sun, 5 Jul 2020 15:22:18 +0200 Subject: [PATCH 22/28] Add tests for wrapping in create. --- pub/side_effect_actor_test.go | 173 +++++++++++++++++++++++++++++++--- 1 file changed, 161 insertions(+), 12 deletions(-) diff --git a/pub/side_effect_actor_test.go b/pub/side_effect_actor_test.go index 35c8c39..b9ba2e0 100644 --- a/pub/side_effect_actor_test.go +++ b/pub/side_effect_actor_test.go @@ -6,6 +6,7 @@ import ( "net/http/httptest" "net/url" "testing" + "time" "github.com/go-fed/activity/streams" "github.com/go-fed/activity/streams/vocab" @@ -1654,28 +1655,176 @@ func TestDeliver(t *testing.T) { // TestWrapInCreate ensures an object received by the Social Protocol is // properly wrapped in a Create Activity. func TestWrapInCreate(t *testing.T) { + baseNoteFn := func() (vocab.ActivityStreamsNote, vocab.ActivityStreamsCreate) { + n := streams.NewActivityStreamsNote() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testNoteId1)) + n.SetJSONLDId(id) + cr := streams.NewActivityStreamsCreate() + op := streams.NewActivityStreamsObjectProperty() + op.AppendActivityStreamsNote(n) + cr.SetActivityStreamsObject(op) + actorProp := streams.NewActivityStreamsActorProperty() + actorProp.AppendIRI(mustParse(testPersonIRI)) + cr.SetActivityStreamsActor(actorProp) + return n, cr + } + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (c *MockCommonBehavior, fp *MockFederatingProtocol, sp *MockSocialProtocol, db *MockDatabase, cl *MockClock, a DelegateActor) { + setupData() + c = NewMockCommonBehavior(ctl) + fp = NewMockFederatingProtocol(ctl) + sp = NewMockSocialProtocol(ctl) + db = NewMockDatabase(ctl) + cl = NewMockClock(ctl) + a = &sideEffectActor{ + common: c, + s2s: fp, + c2s: sp, + db: db, + clock: cl, + } + return + } + t.Run("CreateHasObjectAndActor", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + _, _, _, mockDb, _, a := setupFn(ctl) + n, expect := baseNoteFn() + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + // Run & Verify + got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) + assertEqual(t, err, nil) + assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) + }) t.Run("CreateHasTo", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + _, _, _, mockDb, _, a := setupFn(ctl) + n, expect := baseNoteFn() + to := streams.NewActivityStreamsToProperty() + to.AppendIRI(mustParse(testFederatedActorIRI)) + to.AppendIRI(mustParse(testFederatedActorIRI2)) + n.SetActivityStreamsTo(to) + expect.SetActivityStreamsTo(to) + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + // Run & Verify + got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) + assertEqual(t, err, nil) + assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) }) t.Run("CreateHasCc", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + _, _, _, mockDb, _, a := setupFn(ctl) + n, expect := baseNoteFn() + cc := streams.NewActivityStreamsCcProperty() + cc.AppendIRI(mustParse(testFederatedActorIRI)) + cc.AppendIRI(mustParse(testFederatedActorIRI2)) + n.SetActivityStreamsCc(cc) + expect.SetActivityStreamsCc(cc) + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + // Run & Verify + got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) + assertEqual(t, err, nil) + assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) }) t.Run("CreateHasBto", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + _, _, _, mockDb, _, a := setupFn(ctl) + n, expect := baseNoteFn() + bto := streams.NewActivityStreamsBtoProperty() + bto.AppendIRI(mustParse(testFederatedActorIRI)) + bto.AppendIRI(mustParse(testFederatedActorIRI2)) + n.SetActivityStreamsBto(bto) + expect.SetActivityStreamsBto(bto) + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + // Run & Verify + got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) + assertEqual(t, err, nil) + assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) }) t.Run("CreateHasBcc", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + _, _, _, mockDb, _, a := setupFn(ctl) + n, expect := baseNoteFn() + bcc := streams.NewActivityStreamsBccProperty() + bcc.AppendIRI(mustParse(testFederatedActorIRI)) + bcc.AppendIRI(mustParse(testFederatedActorIRI2)) + n.SetActivityStreamsBcc(bcc) + expect.SetActivityStreamsBcc(bcc) + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + // Run & Verify + got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) + assertEqual(t, err, nil) + assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) }) t.Run("CreateHasAudience", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + _, _, _, mockDb, _, a := setupFn(ctl) + n, expect := baseNoteFn() + aud := streams.NewActivityStreamsAudienceProperty() + aud.AppendIRI(mustParse(testFederatedActorIRI)) + aud.AppendIRI(mustParse(testFederatedActorIRI2)) + n.SetActivityStreamsAudience(aud) + expect.SetActivityStreamsAudience(aud) + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + // Run & Verify + got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) + assertEqual(t, err, nil) + assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) }) t.Run("CreateHasPublished", func(t *testing.T) { - t.Errorf("Not yet implemented.") - }) - t.Run("CreateHasActor", func(t *testing.T) { - t.Errorf("Not yet implemented.") - }) - t.Run("CreateHasObject", func(t *testing.T) { - t.Errorf("Not yet implemented.") + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + _, _, _, mockDb, _, a := setupFn(ctl) + n, expect := baseNoteFn() + pub := streams.NewActivityStreamsPublishedProperty() + pub.Set(time.Now()) + n.SetActivityStreamsPublished(pub) + expect.SetActivityStreamsPublished(pub) + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testMyOutboxIRI)) + mockDb.EXPECT().ActorForOutbox(ctx, mustParse(testMyOutboxIRI)).Return( + mustParse(testPersonIRI), nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testMyOutboxIRI)) + // Run & Verify + got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) + assertEqual(t, err, nil) + assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) }) } From 311ab07a5c73ec908a6ecb474c642d729489096c Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sun, 5 Jul 2020 15:53:42 +0200 Subject: [PATCH 23/28] Use equal bytes function in tests when asserting --- pub/side_effect_actor_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pub/side_effect_actor_test.go b/pub/side_effect_actor_test.go index b9ba2e0..930e27a 100644 --- a/pub/side_effect_actor_test.go +++ b/pub/side_effect_actor_test.go @@ -1700,7 +1700,7 @@ func TestWrapInCreate(t *testing.T) { // Run & Verify got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) assertEqual(t, err, nil) - assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) + assertByteEqual(t, mustSerializeToBytes(got), mustSerializeToBytes(expect)) }) t.Run("CreateHasTo", func(t *testing.T) { // Setup @@ -1721,7 +1721,7 @@ func TestWrapInCreate(t *testing.T) { // Run & Verify got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) assertEqual(t, err, nil) - assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) + assertByteEqual(t, mustSerializeToBytes(got), mustSerializeToBytes(expect)) }) t.Run("CreateHasCc", func(t *testing.T) { // Setup @@ -1742,7 +1742,7 @@ func TestWrapInCreate(t *testing.T) { // Run & Verify got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) assertEqual(t, err, nil) - assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) + assertByteEqual(t, mustSerializeToBytes(got), mustSerializeToBytes(expect)) }) t.Run("CreateHasBto", func(t *testing.T) { // Setup @@ -1763,7 +1763,7 @@ func TestWrapInCreate(t *testing.T) { // Run & Verify got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) assertEqual(t, err, nil) - assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) + assertByteEqual(t, mustSerializeToBytes(got), mustSerializeToBytes(expect)) }) t.Run("CreateHasBcc", func(t *testing.T) { // Setup @@ -1784,7 +1784,7 @@ func TestWrapInCreate(t *testing.T) { // Run & Verify got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) assertEqual(t, err, nil) - assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) + assertByteEqual(t, mustSerializeToBytes(got), mustSerializeToBytes(expect)) }) t.Run("CreateHasAudience", func(t *testing.T) { // Setup @@ -1805,7 +1805,7 @@ func TestWrapInCreate(t *testing.T) { // Run & Verify got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) assertEqual(t, err, nil) - assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) + assertByteEqual(t, mustSerializeToBytes(got), mustSerializeToBytes(expect)) }) t.Run("CreateHasPublished", func(t *testing.T) { // Setup @@ -1825,6 +1825,6 @@ func TestWrapInCreate(t *testing.T) { // Run & Verify got, err := a.WrapInCreate(ctx, n, mustParse(testMyOutboxIRI)) assertEqual(t, err, nil) - assertEqual(t, string(mustSerializeToBytes(got)), string(mustSerializeToBytes(expect))) + assertByteEqual(t, mustSerializeToBytes(got), mustSerializeToBytes(expect)) }) } From c3b24964d414f8d305487e0df1ca40a63feec566 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sun, 5 Jul 2020 15:54:31 +0200 Subject: [PATCH 24/28] Add unit tests for the AS handler --- pub/handlers_test.go | 105 +++++++++++++++++++++++++++++++++++++++++++ pub/pub_test.go | 9 ++++ 2 files changed, 114 insertions(+) create mode 100644 pub/handlers_test.go diff --git a/pub/handlers_test.go b/pub/handlers_test.go new file mode 100644 index 0000000..f31e477 --- /dev/null +++ b/pub/handlers_test.go @@ -0,0 +1,105 @@ +package pub + +import ( + "context" + "fmt" + "io/ioutil" + "net/http" + "net/http/httptest" + "testing" + + "github.com/golang/mock/gomock" +) + +// TestActivityStreamsHandler tests the handler for serving ActivityPub +// requests. +func TestActivityStreamsHandler(t *testing.T) { + ctx := context.Background() + setupFn := func(ctl *gomock.Controller) (db *MockDatabase, clock *MockClock, hf HandlerFunc) { + db = NewMockDatabase(ctl) + clock = NewMockClock(ctl) + hf = NewActivityStreamsHandler(db, clock) + return + } + t.Run("IgnoresIfNotActivityPubGetRequest", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + _, _, hf := setupFn(ctl) + resp := httptest.NewRecorder() + req := httptest.NewRequest("GET", testNoteId1, nil) + // Run & Verify + isAPReq, err := hf(ctx, resp, req) + assertEqual(t, isAPReq, false) + assertEqual(t, err, nil) + assertEqual(t, len(resp.Result().Header), 0) + }) + t.Run("ReturnsErrorWhenDatabaseFetchReturnsError", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + mockDb, _, hf := setupFn(ctl) + resp := httptest.NewRecorder() + req := toAPRequest(httptest.NewRequest("GET", testNoteId1, nil)) + testErr := fmt.Errorf("test error") + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDb.EXPECT().Get(ctx, mustParse(testNoteId1)).Return(nil, testErr) + mockDb.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + // Run & Verify + isAPReq, err := hf(ctx, resp, req) + assertEqual(t, isAPReq, true) + assertEqual(t, err, testErr) + assertEqual(t, len(resp.Result().Header), 0) + }) + t.Run("ServesTombstoneWithStatusGone", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + mockDb, mockClock, hf := setupFn(ctl) + resp := httptest.NewRecorder() + req := toAPRequest(httptest.NewRequest("GET", testNoteId1, nil)) + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDb.EXPECT().Get(ctx, mustParse(testNoteId1)).Return(testTombstone, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + mockClock.EXPECT().Now().Return(now()) + // Run & Verify + isAPReq, err := hf(ctx, resp, req) + assertEqual(t, isAPReq, true) + assertEqual(t, err, nil) + assertEqual(t, resp.Code, http.StatusGone) + respV := resp.Result() + assertEqual(t, respV.Header.Get(contentTypeHeader), "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") + assertEqual(t, respV.Header.Get(dateHeader), nowDateHeader()) + assertNotEqual(t, len(respV.Header.Get(digestHeader)), 0) + b, err := ioutil.ReadAll(respV.Body) + assertEqual(t, err, nil) + assertByteEqual(t, b, mustSerializeToBytes(testTombstone)) + }) + t.Run("ServesContentWithStatusOk", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + mockDb, mockClock, hf := setupFn(ctl) + resp := httptest.NewRecorder() + req := toAPRequest(httptest.NewRequest("GET", testNoteId1, nil)) + // Mock + mockDb.EXPECT().Lock(ctx, mustParse(testNoteId1)) + mockDb.EXPECT().Get(ctx, mustParse(testNoteId1)).Return(testMyNote, nil) + mockDb.EXPECT().Unlock(ctx, mustParse(testNoteId1)) + mockClock.EXPECT().Now().Return(now()) + // Run & Verify + isAPReq, err := hf(ctx, resp, req) + assertEqual(t, isAPReq, true) + assertEqual(t, err, nil) + assertEqual(t, resp.Code, http.StatusOK) + respV := resp.Result() + assertEqual(t, respV.Header.Get(contentTypeHeader), "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") + assertEqual(t, respV.Header.Get(dateHeader), nowDateHeader()) + assertNotEqual(t, len(respV.Header.Get(digestHeader)), 0) + b, err := ioutil.ReadAll(respV.Body) + assertEqual(t, err, nil) + assertByteEqual(t, b, mustSerializeToBytes(testMyNote)) + }) +} diff --git a/pub/pub_test.go b/pub/pub_test.go index 5621c7e..3a15d14 100644 --- a/pub/pub_test.go +++ b/pub/pub_test.go @@ -144,6 +144,8 @@ var ( testNestedInReplyTo vocab.ActivityStreamsListen // testFollow is a test Follow Activity. testFollow vocab.ActivityStreamsFollow + // testTombstone is a test Tombsone. + testTombstone vocab.ActivityStreamsTombstone ) // The test data cannot be created at init time since that is when the hooks of @@ -449,6 +451,13 @@ func setupData() { op.AppendIRI(mustParse(testFederatedActorIRI)) testFollow.SetActivityStreamsObject(op) }() + // testTombstone + func() { + testTombstone = streams.NewActivityStreamsTombstone() + id := streams.NewJSONLDIdProperty() + id.Set(mustParse(testFederatedActivityIRI)) + testTombstone.SetJSONLDId(id) + }() } // wrappedInCreate returns a Create activity wrapping the given type. From 107afb6f17c51d5c16efce0cd7b1af0304b667fd Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sun, 5 Jul 2020 17:06:52 +0200 Subject: [PATCH 25/28] Avoid a byte copy when delivering a HTTP request Added tests for the HTTP sig transport. --- pub/mock_httpsig_test.go | 166 +++++++++++++++++++++++++++++++++++++++ pub/transport.go | 5 +- pub/transport_test.go | 159 +++++++++++++++++++++++++++++++++++++ 3 files changed, 326 insertions(+), 4 deletions(-) create mode 100644 pub/mock_httpsig_test.go create mode 100644 pub/transport_test.go diff --git a/pub/mock_httpsig_test.go b/pub/mock_httpsig_test.go new file mode 100644 index 0000000..03e03eb --- /dev/null +++ b/pub/mock_httpsig_test.go @@ -0,0 +1,166 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ../../httpsig/httpsig.go + +// Package pub is a generated GoMock package. +package pub + +import ( + crypto "crypto" + httpsig "github.com/go-fed/httpsig" + gomock "github.com/golang/mock/gomock" + http "net/http" + reflect "reflect" +) + +// MockSigner is a mock of Signer interface +type MockSigner struct { + ctrl *gomock.Controller + recorder *MockSignerMockRecorder +} + +// MockSignerMockRecorder is the mock recorder for MockSigner +type MockSignerMockRecorder struct { + mock *MockSigner +} + +// NewMockSigner creates a new mock instance +func NewMockSigner(ctrl *gomock.Controller) *MockSigner { + mock := &MockSigner{ctrl: ctrl} + mock.recorder = &MockSignerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockSigner) EXPECT() *MockSignerMockRecorder { + return m.recorder +} + +// SignRequest mocks base method +func (m *MockSigner) SignRequest(pKey crypto.PrivateKey, pubKeyId string, r *http.Request, body []byte) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SignRequest", pKey, pubKeyId, r, body) + ret0, _ := ret[0].(error) + return ret0 +} + +// SignRequest indicates an expected call of SignRequest +func (mr *MockSignerMockRecorder) SignRequest(pKey, pubKeyId, r, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignRequest", reflect.TypeOf((*MockSigner)(nil).SignRequest), pKey, pubKeyId, r, body) +} + +// SignResponse mocks base method +func (m *MockSigner) SignResponse(pKey crypto.PrivateKey, pubKeyId string, r http.ResponseWriter, body []byte) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SignResponse", pKey, pubKeyId, r, body) + ret0, _ := ret[0].(error) + return ret0 +} + +// SignResponse indicates an expected call of SignResponse +func (mr *MockSignerMockRecorder) SignResponse(pKey, pubKeyId, r, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignResponse", reflect.TypeOf((*MockSigner)(nil).SignResponse), pKey, pubKeyId, r, body) +} + +// MockSSHSigner is a mock of SSHSigner interface +type MockSSHSigner struct { + ctrl *gomock.Controller + recorder *MockSSHSignerMockRecorder +} + +// MockSSHSignerMockRecorder is the mock recorder for MockSSHSigner +type MockSSHSignerMockRecorder struct { + mock *MockSSHSigner +} + +// NewMockSSHSigner creates a new mock instance +func NewMockSSHSigner(ctrl *gomock.Controller) *MockSSHSigner { + mock := &MockSSHSigner{ctrl: ctrl} + mock.recorder = &MockSSHSignerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockSSHSigner) EXPECT() *MockSSHSignerMockRecorder { + return m.recorder +} + +// SignRequest mocks base method +func (m *MockSSHSigner) SignRequest(pubKeyId string, r *http.Request, body []byte) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SignRequest", pubKeyId, r, body) + ret0, _ := ret[0].(error) + return ret0 +} + +// SignRequest indicates an expected call of SignRequest +func (mr *MockSSHSignerMockRecorder) SignRequest(pubKeyId, r, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignRequest", reflect.TypeOf((*MockSSHSigner)(nil).SignRequest), pubKeyId, r, body) +} + +// SignResponse mocks base method +func (m *MockSSHSigner) SignResponse(pubKeyId string, r http.ResponseWriter, body []byte) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SignResponse", pubKeyId, r, body) + ret0, _ := ret[0].(error) + return ret0 +} + +// SignResponse indicates an expected call of SignResponse +func (mr *MockSSHSignerMockRecorder) SignResponse(pubKeyId, r, body interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignResponse", reflect.TypeOf((*MockSSHSigner)(nil).SignResponse), pubKeyId, r, body) +} + +// MockVerifier is a mock of Verifier interface +type MockVerifier struct { + ctrl *gomock.Controller + recorder *MockVerifierMockRecorder +} + +// MockVerifierMockRecorder is the mock recorder for MockVerifier +type MockVerifierMockRecorder struct { + mock *MockVerifier +} + +// NewMockVerifier creates a new mock instance +func NewMockVerifier(ctrl *gomock.Controller) *MockVerifier { + mock := &MockVerifier{ctrl: ctrl} + mock.recorder = &MockVerifierMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockVerifier) EXPECT() *MockVerifierMockRecorder { + return m.recorder +} + +// KeyId mocks base method +func (m *MockVerifier) KeyId() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "KeyId") + ret0, _ := ret[0].(string) + return ret0 +} + +// KeyId indicates an expected call of KeyId +func (mr *MockVerifierMockRecorder) KeyId() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KeyId", reflect.TypeOf((*MockVerifier)(nil).KeyId)) +} + +// Verify mocks base method +func (m *MockVerifier) Verify(pKey crypto.PublicKey, algo httpsig.Algorithm) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Verify", pKey, algo) + ret0, _ := ret[0].(error) + return ret0 +} + +// Verify indicates an expected call of Verify +func (mr *MockVerifierMockRecorder) Verify(pKey, algo interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Verify", reflect.TypeOf((*MockVerifier)(nil).Verify), pKey, algo) +} diff --git a/pub/transport.go b/pub/transport.go index 8c4d3a1..1d55a75 100644 --- a/pub/transport.go +++ b/pub/transport.go @@ -137,10 +137,7 @@ func (h HttpSigTransport) Dereference(c context.Context, iri *url.URL) ([]byte, // Deliver sends a POST request with an HTTP Signature. func (h HttpSigTransport) Deliver(c context.Context, b []byte, to *url.URL) error { - byteCopy := make([]byte, len(b)) - copy(byteCopy, b) - buf := bytes.NewBuffer(byteCopy) - req, err := http.NewRequest("POST", to.String(), buf) + req, err := http.NewRequest("POST", to.String(), bytes.NewReader(b)) if err != nil { return err } diff --git a/pub/transport_test.go b/pub/transport_test.go new file mode 100644 index 0000000..a349c7f --- /dev/null +++ b/pub/transport_test.go @@ -0,0 +1,159 @@ +package pub + +import ( + "context" + "fmt" + "net/http" + "net/http/httptest" + "net/url" + "testing" + + "github.com/golang/mock/gomock" +) + +const ( + testAppAgent = "testApp" + testPubKeyId = "myPubKeyId" +) + +var ( + testPrivKey = []byte("some private key") + testRespBody = []byte("test resp body") + httpSigSetupFn = func(ctl *gomock.Controller) (t *HttpSigTransport, c *MockClock, hc *MockHttpClient, gs, ps *MockSigner) { + c = NewMockClock(ctl) + hc = NewMockHttpClient(ctl) + gs = NewMockSigner(ctl) + ps = NewMockSigner(ctl) + t = NewHttpSigTransport( + hc, + testAppAgent, + c, + gs, + ps, + testPubKeyId, + testPrivKey) + return + } +) + +func TestHttpSigTransportDereference(t *testing.T) { + ctx := context.Background() + t.Run("ReturnsErrorWhenHTTPStatusError", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + tp, c, hc, gs, _ := httpSigSetupFn(ctl) + resp := &http.Response{} + testErr := fmt.Errorf("test error") + // Mock + c.EXPECT().Now().Return(now()) + gs.EXPECT().SignRequest(testPrivKey, testPubKeyId, gomock.Any(), nil) + hc.EXPECT().Do(gomock.Any()).Return(resp, testErr) + // Run & Verify + b, err := tp.Dereference(ctx, mustParse(testNoteId1)) + assertEqual(t, len(b), 0) + assertEqual(t, err, testErr) + }) + t.Run("Dereferences", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + tp, c, hc, gs, _ := httpSigSetupFn(ctl) + expectReq, err := http.NewRequest("GET", testNoteId1, nil) + assertEqual(t, err, nil) + expectReq = expectReq.WithContext(ctx) + expectReq.Header.Add(acceptHeader, acceptHeaderValue) + expectReq.Header.Add("Accept-Charset", "utf-8") + expectReq.Header.Add("Date", nowDateHeader()) + expectReq.Header.Add("User-Agent", fmt.Sprintf("%s %s", testAppAgent, goFedUserAgent())) + respR := httptest.NewRecorder() + respR.Write(testRespBody) + resp := respR.Result() + // Mock + c.EXPECT().Now().Return(now()) + gs.EXPECT().SignRequest(testPrivKey, testPubKeyId, expectReq, nil) + hc.EXPECT().Do(expectReq).Return(resp, nil) + // Run & Verify + b, err := tp.Dereference(ctx, mustParse(testNoteId1)) + assertByteEqual(t, b, testRespBody) + assertEqual(t, err, nil) + }) +} + +func TestHttpSigTransportDeliver(t *testing.T) { + ctx := context.Background() + t.Run("ReturnsErrorWhenHTTPStatusError", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + tp, c, hc, _, ps := httpSigSetupFn(ctl) + resp := &http.Response{} + testErr := fmt.Errorf("test error") + // Mock + c.EXPECT().Now().Return(now()) + ps.EXPECT().SignRequest(testPrivKey, testPubKeyId, gomock.Any(), gomock.Any()) + hc.EXPECT().Do(gomock.Any()).Return(resp, testErr) + // Run & Verify + err := tp.Deliver(ctx, testRespBody, mustParse(testNoteId1)) + assertEqual(t, err, testErr) + }) + t.Run("Delivers", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + tp, c, hc, _, ps := httpSigSetupFn(ctl) + // gomock cannot handle http.NewRequest w/ Body differences. + respR := httptest.NewRecorder() + respR.WriteHeader(http.StatusOK) + resp := respR.Result() + // Mock + c.EXPECT().Now().Return(now()) + ps.EXPECT().SignRequest(testPrivKey, testPubKeyId, gomock.Any(), testRespBody) + hc.EXPECT().Do(gomock.Any()).Return(resp, nil) + // Run & Verify + err := tp.Deliver(ctx, testRespBody, mustParse(testFederatedActorIRI)) + assertEqual(t, err, nil) + }) +} + +func TestHttpSigTransportBatchDeliver(t *testing.T) { + ctx := context.Background() + t.Run("BatchDelivers", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + tp, c, hc, _, ps := httpSigSetupFn(ctl) + // gomock cannot handle http.NewRequest w/ Body differences. + respR := httptest.NewRecorder() + respR.WriteHeader(http.StatusOK) + resp := respR.Result() + // Mock + c.EXPECT().Now().Return(now()).Times(2) + ps.EXPECT().SignRequest(testPrivKey, testPubKeyId, gomock.Any(), testRespBody).Times(2) + hc.EXPECT().Do(gomock.Any()).Return(resp, nil).Times(2) + // Run & Verify + err := tp.BatchDeliver(ctx, testRespBody, []*url.URL{mustParse(testFederatedActorIRI), mustParse(testFederatedActorIRI2)}) + assertEqual(t, err, nil) + }) + t.Run("ReturnsErrorWhenOneErrors", func(t *testing.T) { + // Setup + ctl := gomock.NewController(t) + defer ctl.Finish() + tp, c, hc, _, ps := httpSigSetupFn(ctl) + // gomock cannot handle http.NewRequest w/ Body differences. + respR := httptest.NewRecorder() + respR.WriteHeader(http.StatusOK) + resp := respR.Result() + errResp := &http.Response{} + testErr := fmt.Errorf("test error") + // Mock + c.EXPECT().Now().Return(now()).Times(2) + ps.EXPECT().SignRequest(testPrivKey, testPubKeyId, gomock.Any(), testRespBody).Times(2) + first := hc.EXPECT().Do(gomock.Any()).Return(resp, nil) + hc.EXPECT().Do(gomock.Any()).Return(errResp, testErr).After(first) + // Run & Verify + err := tp.BatchDeliver(ctx, testRespBody, []*url.URL{mustParse(testFederatedActorIRI), mustParse(testFederatedActorIRI2)}) + assertNotEqual(t, err, nil) + + }) +} From f4f19b61b3b02cf4c302c64164692e98217d8848 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sun, 5 Jul 2020 20:37:26 +0200 Subject: [PATCH 26/28] Update astool's README --- astool/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/astool/README.md b/astool/README.md index 3abe083..dca1ca8 100644 --- a/astool/README.md +++ b/astool/README.md @@ -104,3 +104,31 @@ This tool relies on built-in knowledge of several ontologies: It does not have complete knowledge of these schemas, so if an error is encountered during the code generation process with a new extension, please [file an issue](https://github.com/go-fed/activity/issues). + +## Non-Standard Behaviors + +ActivityPub has a requirement where properties in a base type are not inherited +by deriving types. This concept is one reason why the ActivityStreams vocabulary +cannot be mapped into a traditional object-oriented programming language. It +also means that we need an RDF/OWL/JSON-LD concept to encapsulate this detail. +Unfortunately, no standards body provides an RDF definition of this meaning, so +the `astool` uses the JSON-LD reserved notation `@wtf_without_property` to +trigger code generation that results in this behavior. + +It is the hope of this author that the prefix `@wtf` would never be used by the +JSON-LD authors and would never have a chance to become a de-facto standard due +to the implied profanity. Furthermore, its use should be extremely limited. +Therefore, the use of this non-standard keyworld only for the `astool` and in +limited applications should never collide with anything else. + +This notation is used in two places: + +* [Intransitive Activity](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-intransitiveactivity) +does not have the `object` property, so this is a spec-compliant use. +* `OrderedCollection` so that it does not have both `items` and `orderedItems` +properties. This is an opinion: `items` for `Collection` and `orderedItems` for +`OrderedCollection`. + +## References + +* [JSON-LD Specification](https://json-ld.org/spec/latest/json-ld/) From e17e28bddbcaf372ac27b1a9365f324ae974ef4a Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sun, 5 Jul 2020 20:56:10 +0200 Subject: [PATCH 27/28] Remove unused jsonLDContext constant --- pub/util.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pub/util.go b/pub/util.go index 5b0a511..af078c5 100644 --- a/pub/util.go +++ b/pub/util.go @@ -116,14 +116,6 @@ func dedupeOrderedItems(oc orderedItemser) error { return nil } -const ( - // jsonLDContext is the key for the JSON-LD specification's context - // value. It contains the definitions of the types contained within the - // rest of the payload. Important for linked-data representations, but - // only applicable to go-fed at code-generation time. - jsonLDContext = "@context" -) - const ( // The Location header locationHeader = "Location" From acc84125fa8deb3cd308e78247542615ee86aa68 Mon Sep 17 00:00:00 2001 From: Cory Slep Date: Sun, 5 Jul 2020 20:59:37 +0200 Subject: [PATCH 28/28] Run go mod tidy --- go.sum | 5 ----- 1 file changed, 5 deletions(-) diff --git a/go.sum b/go.sum index 9a2b509..42fb870 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,5 @@ github.com/dave/jennifer v1.3.0 h1:p3tl41zjjCZTNBytMwrUuiAnherNUZktlhPTKoF/sEk= github.com/dave/jennifer v1.3.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/go-fed/activity v0.4.0 h1:1YOYLMT+x2hx+AtQZNQHOGBXWnn2CF/10jGxTjaOEsw= -github.com/go-fed/activity v0.4.0/go.mod h1:QeFu271luhA2o47U3/DR6iWtxiB9Fw2dKGbvL8edM9E= -github.com/go-fed/httpsig v0.1.0 h1:6F2OxRVnNTN4OPN+Mc2jxs2WEay9/qiHT/jphlvAwIY= -github.com/go-fed/httpsig v0.1.0/go.mod h1:T56HUNYZUQ1AGUzhAYPugZfp36sKApVnGBgKlIY+aIE= github.com/go-fed/httpsig v0.1.1-0.20190914113940-c2de3672e5b5 h1:WLvFZqoXnuVTBKA6U/1FnEHNQ0Rq0QM0rGhY8Tx6R1g= github.com/go-fed/httpsig v0.1.1-0.20190914113940-c2de3672e5b5/go.mod h1:T56HUNYZUQ1AGUzhAYPugZfp36sKApVnGBgKlIY+aIE= github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg= @@ -14,4 +10,3 @@ golang.org/x/crypto v0.0.0-20180527072434-ab813273cd59 h1:hk3yo72LXLapY9EXVttc3Z golang.org/x/crypto v0.0.0-20180527072434-ab813273cd59/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/sys v0.0.0-20180525142821-c11f84a56e43 h1:PvnWIWTbA7gsEBkKjt0HV9hckYfcqYv8s/ju7ArZ0do= golang.org/x/sys v0.0.0-20180525142821-c11f84a56e43/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=