2019-02-08 08:59:10 +09:00
package streams
import (
"github.com/go-fed/activity/streams/vocab"
"net/url"
"time"
)
func MustParseURL ( s string ) * url . URL {
u , err := url . Parse ( s )
if err != nil {
panic ( err )
}
return u
}
const example1 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Object" ,
"id" : "http://www.test.example/object/1" ,
"name" : "A Simple, non-specific object"
} `
2019-02-10 05:56:00 +09:00
func example1Type ( ) vocab . ActivityStreamsObject {
2019-02-08 08:59:10 +09:00
example1Type := NewActivityStreamsObject ( )
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://www.test.example/object/1" ) )
2019-02-10 05:56:00 +09:00
example1Type . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A Simple, non-specific object" )
example1Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example1Type
}
const example2 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Link" ,
"href" : "http://example.org/abc" ,
"hreflang" : "en" ,
"mediaType" : "text/html" ,
"name" : "An example link"
} `
2019-02-10 05:56:00 +09:00
func example2Type ( ) vocab . ActivityStreamsLink {
2019-02-08 08:59:10 +09:00
example2Type := NewActivityStreamsLink ( )
hrefUrl := MustParseURL ( "http://example.org/abc" )
href := NewActivityStreamsHrefProperty ( )
href . Set ( hrefUrl )
2019-02-10 05:56:00 +09:00
example2Type . SetActivityStreamsHref ( href )
2019-02-08 08:59:10 +09:00
hrefLang := NewActivityStreamsHreflangProperty ( )
hrefLang . Set ( "en" )
2019-02-10 05:56:00 +09:00
example2Type . SetActivityStreamsHreflang ( hrefLang )
2019-02-08 08:59:10 +09:00
mediaType := NewActivityStreamsMediaTypeProperty ( )
mediaType . Set ( "text/html" )
2019-02-10 05:56:00 +09:00
example2Type . SetActivityStreamsMediaType ( mediaType )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "An example link" )
example2Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example2Type
}
const example3 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Activity" ,
"summary" : "Sally did something to a note" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Note" ,
"name" : "A Note"
}
} `
2019-02-10 05:56:00 +09:00
func example3Type ( ) vocab . ActivityStreamsActivity {
2019-02-08 08:59:10 +09:00
example3Type := NewActivityStreamsActivity ( )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
note := NewActivityStreamsNote ( )
aNote := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
aNote . AppendXMLSchemaString ( "A Note" )
note . SetActivityStreamsName ( aNote )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally did something to a note" )
example3Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
actor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
actor . AppendActivityStreamsPerson ( person )
example3Type . SetActivityStreamsActor ( actor )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
object . AppendActivityStreamsNote ( note )
example3Type . SetActivityStreamsObject ( object )
2019-02-08 08:59:10 +09:00
return example3Type
}
const example4 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Travel" ,
"summary" : "Sally went to work" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"target" : {
"type" : "Place" ,
"name" : "Work"
}
} `
2019-02-10 05:56:00 +09:00
func example4Type ( ) vocab . ActivityStreamsTravel {
2019-02-08 08:59:10 +09:00
example4Type := NewActivityStreamsTravel ( )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
place := NewActivityStreamsPlace ( )
work := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
work . AppendXMLSchemaString ( "Work" )
place . SetActivityStreamsName ( work )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally went to work" )
example4Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
actor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
actor . AppendActivityStreamsPerson ( person )
example4Type . SetActivityStreamsActor ( actor )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
target . AppendActivityStreamsPlace ( place )
example4Type . SetActivityStreamsTarget ( target )
2019-02-08 08:59:10 +09:00
return example4Type
}
const example5 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's notes" ,
"type" : "Collection" ,
"totalItems" : 2 ,
"items" : [
{
"type" : "Note" ,
"name" : "A Simple Note"
} ,
{
"type" : "Note" ,
"name" : "Another Simple Note"
}
]
} `
2019-02-10 05:56:00 +09:00
func example5Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example5Type := NewActivityStreamsCollection ( )
note1 := NewActivityStreamsNote ( )
name1 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name1 . AppendXMLSchemaString ( "A Simple Note" )
note1 . SetActivityStreamsName ( name1 )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
name2 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name2 . AppendXMLSchemaString ( "Another Simple Note" )
note2 . SetActivityStreamsName ( name2 )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's notes" )
example5Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 2 )
2019-02-10 05:56:00 +09:00
example5Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsNote ( note1 )
items . AppendActivityStreamsNote ( note2 )
example5Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example5Type
}
const example6 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's notes" ,
"type" : "OrderedCollection" ,
"totalItems" : 2 ,
"orderedItems" : [
{
"type" : "Note" ,
"name" : "A Simple Note"
} ,
{
"type" : "Note" ,
"name" : "Another Simple Note"
}
]
} `
2019-02-10 05:56:00 +09:00
func example6Type ( ) vocab . ActivityStreamsOrderedCollection {
2019-02-08 08:59:10 +09:00
example6Type := NewActivityStreamsOrderedCollection ( )
note1 := NewActivityStreamsNote ( )
name1 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name1 . AppendXMLSchemaString ( "A Simple Note" )
note1 . SetActivityStreamsName ( name1 )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
name2 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name2 . AppendXMLSchemaString ( "Another Simple Note" )
note2 . SetActivityStreamsName ( name2 )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's notes" )
example6Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 2 )
2019-02-10 05:56:00 +09:00
example6Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
orderedItems := NewActivityStreamsOrderedItemsProperty ( )
2019-02-10 05:56:00 +09:00
orderedItems . AppendActivityStreamsNote ( note1 )
orderedItems . AppendActivityStreamsNote ( note2 )
example6Type . SetActivityStreamsOrderedItems ( orderedItems )
2019-02-08 08:59:10 +09:00
return example6Type
}
const example7 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Page 1 of Sally's notes" ,
"type" : "CollectionPage" ,
"id" : "http://example.org/foo?page=1" ,
"partOf" : "http://example.org/foo" ,
"items" : [
{
"type" : "Note" ,
"name" : "A Simple Note"
} ,
{
"type" : "Note" ,
"name" : "Another Simple Note"
}
]
} `
2019-02-10 05:56:00 +09:00
func example7Type ( ) vocab . ActivityStreamsCollectionPage {
2019-02-08 08:59:10 +09:00
example7Type := NewActivityStreamsCollectionPage ( )
note1 := NewActivityStreamsNote ( )
name1 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name1 . AppendXMLSchemaString ( "A Simple Note" )
note1 . SetActivityStreamsName ( name1 )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
name2 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name2 . AppendXMLSchemaString ( "Another Simple Note" )
note2 . SetActivityStreamsName ( name2 )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Page 1 of Sally's notes" )
example7Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://example.org/foo?page=1" ) )
2019-02-10 05:56:00 +09:00
example7Type . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
partOf := NewActivityStreamsPartOfProperty ( )
partOf . SetIRI ( MustParseURL ( "http://example.org/foo" ) )
2019-02-10 05:56:00 +09:00
example7Type . SetActivityStreamsPartOf ( partOf )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsNote ( note1 )
items . AppendActivityStreamsNote ( note2 )
example7Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example7Type
}
const example8 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Page 1 of Sally's notes" ,
"type" : "OrderedCollectionPage" ,
"id" : "http://example.org/foo?page=1" ,
"partOf" : "http://example.org/foo" ,
"orderedItems" : [
{
"type" : "Note" ,
"name" : "A Simple Note"
} ,
{
"type" : "Note" ,
"name" : "Another Simple Note"
}
]
} `
2019-02-10 05:56:00 +09:00
func example8Type ( ) vocab . ActivityStreamsOrderedCollectionPage {
2019-02-08 08:59:10 +09:00
example8Type := NewActivityStreamsOrderedCollectionPage ( )
note1 := NewActivityStreamsNote ( )
name1 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name1 . AppendXMLSchemaString ( "A Simple Note" )
note1 . SetActivityStreamsName ( name1 )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
name2 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name2 . AppendXMLSchemaString ( "Another Simple Note" )
note2 . SetActivityStreamsName ( name2 )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Page 1 of Sally's notes" )
example8Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://example.org/foo?page=1" ) )
2019-02-10 05:56:00 +09:00
example8Type . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
partOf := NewActivityStreamsPartOfProperty ( )
partOf . SetIRI ( MustParseURL ( "http://example.org/foo" ) )
2019-02-10 05:56:00 +09:00
example8Type . SetActivityStreamsPartOf ( partOf )
2019-02-08 08:59:10 +09:00
orderedItems := NewActivityStreamsOrderedItemsProperty ( )
2019-02-10 05:56:00 +09:00
orderedItems . AppendActivityStreamsNote ( note1 )
orderedItems . AppendActivityStreamsNote ( note2 )
example8Type . SetActivityStreamsOrderedItems ( orderedItems )
2019-02-08 08:59:10 +09:00
return example8Type
}
const example9 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally accepted an invitation to a party" ,
"type" : "Accept" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Invite" ,
"actor" : "http://john.example.org" ,
"object" : {
"type" : "Event" ,
"name" : "Going-Away Party for Jim"
}
}
} `
2019-02-10 05:56:00 +09:00
func example9Type ( ) vocab . ActivityStreamsAccept {
2019-02-08 08:59:10 +09:00
example9Type := NewActivityStreamsAccept ( )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
event := NewActivityStreamsEvent ( )
goingAway := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
goingAway . AppendXMLSchemaString ( "Going-Away Party for Jim" )
event . SetActivityStreamsName ( goingAway )
2019-02-08 08:59:10 +09:00
invite := NewActivityStreamsInvite ( )
actor := NewActivityStreamsActorProperty ( )
actor . AppendIRI ( MustParseURL ( "http://john.example.org" ) )
2019-02-10 05:56:00 +09:00
invite . SetActivityStreamsActor ( actor )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
object . AppendActivityStreamsEvent ( event )
invite . SetActivityStreamsObject ( object )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally accepted an invitation to a party" )
example9Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( person )
example9Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
inviteObject := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
inviteObject . AppendActivityStreamsInvite ( invite )
example9Type . SetActivityStreamsObject ( inviteObject )
2019-02-08 08:59:10 +09:00
return example9Type
}
const example10 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally accepted Joe into the club" ,
"type" : "Accept" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Person" ,
"name" : "Joe"
} ,
"target" : {
"type" : "Group" ,
"name" : "The Club"
}
} `
2019-02-10 05:56:00 +09:00
func example10Type ( ) vocab . ActivityStreamsAccept {
2019-02-08 08:59:10 +09:00
example10Type := NewActivityStreamsAccept ( )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsPerson ( )
joe := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
joe . AppendXMLSchemaString ( "Joe" )
object . SetActivityStreamsName ( joe )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsGroup ( )
club := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
club . AppendXMLSchemaString ( "The Club" )
target . SetActivityStreamsName ( club )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally accepted Joe into the club" )
example10Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( person )
example10Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsPerson ( object )
example10Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsGroup ( target )
example10Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
return example10Type
}
const example11 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally tentatively accepted an invitation to a party" ,
"type" : "TentativeAccept" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Invite" ,
"actor" : "http://john.example.org" ,
"object" : {
"type" : "Event" ,
"name" : "Going-Away Party for Jim"
}
}
} `
2019-02-10 05:56:00 +09:00
func example11Type ( ) vocab . ActivityStreamsTentativeAccept {
2019-02-08 08:59:10 +09:00
example11Type := NewActivityStreamsTentativeAccept ( )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
event := NewActivityStreamsEvent ( )
goingAway := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
goingAway . AppendXMLSchemaString ( "Going-Away Party for Jim" )
event . SetActivityStreamsName ( goingAway )
2019-02-08 08:59:10 +09:00
invite := NewActivityStreamsInvite ( )
inviteActor := NewActivityStreamsActorProperty ( )
inviteActor . AppendIRI ( MustParseURL ( "http://john.example.org" ) )
2019-02-10 05:56:00 +09:00
invite . SetActivityStreamsActor ( inviteActor )
2019-02-08 08:59:10 +09:00
objInvite := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objInvite . AppendActivityStreamsEvent ( event )
invite . SetActivityStreamsObject ( objInvite )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally tentatively accepted an invitation to a party" )
example11Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( person )
example11Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsInvite ( invite )
example11Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example11Type
}
const example12 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally added an object" ,
"type" : "Add" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/abc"
} `
2019-02-10 05:56:00 +09:00
func example12Type ( ) vocab . ActivityStreamsAdd {
2019-02-08 08:59:10 +09:00
example12Type := NewActivityStreamsAdd ( )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/abc" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally added an object" )
example12Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( person )
example12Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example12Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example12Type
}
const example13 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally added a picture of her cat to her cat picture collection" ,
"type" : "Add" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Image" ,
"name" : "A picture of my cat" ,
"url" : "http://example.org/img/cat.png"
} ,
"origin" : {
"type" : "Collection" ,
"name" : "Camera Roll"
} ,
"target" : {
"type" : "Collection" ,
"name" : "My Cat Pictures"
}
} `
2019-02-10 05:56:00 +09:00
func example13Type ( ) vocab . ActivityStreamsAdd {
2019-02-08 08:59:10 +09:00
example13Type := NewActivityStreamsAdd ( )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/img/cat.png" )
object := NewActivityStreamsImage ( )
objectName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
objectName . AppendXMLSchemaString ( "A picture of my cat" )
object . SetActivityStreamsName ( objectName )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
object . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
origin := NewActivityStreamsCollection ( )
originName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
originName . AppendXMLSchemaString ( "Camera Roll" )
origin . SetActivityStreamsName ( originName )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsCollection ( )
targetName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
targetName . AppendXMLSchemaString ( "My Cat Pictures" )
target . SetActivityStreamsName ( targetName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally added a picture of her cat to her cat picture collection" )
example13Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( person )
example13Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsImage ( object )
example13Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
originProp := NewActivityStreamsOriginProperty ( )
2019-02-10 05:56:00 +09:00
originProp . AppendActivityStreamsCollection ( origin )
example13Type . SetActivityStreamsOrigin ( originProp )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsCollection ( target )
example13Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
return example13Type
}
const example14 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally arrived at work" ,
"type" : "Arrive" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"location" : {
"type" : "Place" ,
"name" : "Work"
} ,
"origin" : {
"type" : "Place" ,
"name" : "Home"
}
} `
2019-02-10 05:56:00 +09:00
func example14Type ( ) vocab . ActivityStreamsArrive {
2019-02-08 08:59:10 +09:00
example14Type := NewActivityStreamsArrive ( )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
location := NewActivityStreamsPlace ( )
locationName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
locationName . AppendXMLSchemaString ( "Work" )
location . SetActivityStreamsName ( locationName )
2019-02-08 08:59:10 +09:00
origin := NewActivityStreamsPlace ( )
originName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
originName . AppendXMLSchemaString ( "Home" )
origin . SetActivityStreamsName ( originName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally arrived at work" )
example14Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( person )
example14Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
loc := NewActivityStreamsLocationProperty ( )
2019-02-10 05:56:00 +09:00
loc . AppendActivityStreamsPlace ( location )
example14Type . SetActivityStreamsLocation ( loc )
2019-02-08 08:59:10 +09:00
originProp := NewActivityStreamsOriginProperty ( )
2019-02-10 05:56:00 +09:00
originProp . AppendActivityStreamsPlace ( origin )
example14Type . SetActivityStreamsOrigin ( originProp )
2019-02-08 08:59:10 +09:00
return example14Type
}
const example15 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally created a note" ,
"type" : "Create" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Note" ,
"name" : "A Simple Note" ,
"content" : "This is a simple note"
}
} `
2019-02-10 05:56:00 +09:00
func example15Type ( ) vocab . ActivityStreamsCreate {
2019-02-08 08:59:10 +09:00
example15Type := NewActivityStreamsCreate ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsNote ( )
objectName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
objectName . AppendXMLSchemaString ( "A Simple Note" )
object . SetActivityStreamsName ( objectName )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "This is a simple note" )
object . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally created a note" )
example15Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example15Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsNote ( object )
example15Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example15Type
}
const example16 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally deleted a note" ,
"type" : "Delete" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/notes/1" ,
"origin" : {
"type" : "Collection" ,
"name" : "Sally's Notes"
}
} `
2019-02-10 05:56:00 +09:00
func example16Type ( ) vocab . ActivityStreamsDelete {
2019-02-08 08:59:10 +09:00
example16Type := NewActivityStreamsDelete ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
origin := NewActivityStreamsCollection ( )
originName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
originName . AppendXMLSchemaString ( "Sally's Notes" )
origin . SetActivityStreamsName ( originName )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/notes/1" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally deleted a note" )
example16Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example16Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example16Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
originProp := NewActivityStreamsOriginProperty ( )
2019-02-10 05:56:00 +09:00
originProp . AppendActivityStreamsCollection ( origin )
example16Type . SetActivityStreamsOrigin ( originProp )
2019-02-08 08:59:10 +09:00
return example16Type
}
const example17 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally followed John" ,
"type" : "Follow" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Person" ,
"name" : "John"
}
} `
2019-02-10 05:56:00 +09:00
func example17Type ( ) vocab . ActivityStreamsFollow {
2019-02-08 08:59:10 +09:00
example17Type := NewActivityStreamsFollow ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsPerson ( )
objectName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
objectName . AppendXMLSchemaString ( "John" )
object . SetActivityStreamsName ( objectName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally followed John" )
example17Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example17Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsPerson ( object )
example17Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example17Type
}
const example18 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally ignored a note" ,
"type" : "Ignore" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/notes/1"
} `
2019-02-10 05:56:00 +09:00
func example18Type ( ) vocab . ActivityStreamsIgnore {
2019-02-08 08:59:10 +09:00
example18Type := NewActivityStreamsIgnore ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/notes/1" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally ignored a note" )
example18Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example18Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example18Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example18Type
}
const example19 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally joined a group" ,
"type" : "Join" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Group" ,
"name" : "A Simple Group"
}
} `
2019-02-10 05:56:00 +09:00
func example19Type ( ) vocab . ActivityStreamsJoin {
2019-02-08 08:59:10 +09:00
example19Type := NewActivityStreamsJoin ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsGroup ( )
objectName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
objectName . AppendXMLSchemaString ( "A Simple Group" )
object . SetActivityStreamsName ( objectName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally joined a group" )
example19Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example19Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsGroup ( object )
example19Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example19Type
}
const example20 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally left work" ,
"type" : "Leave" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Place" ,
"name" : "Work"
}
} `
2019-02-10 05:56:00 +09:00
func example20Type ( ) vocab . ActivityStreamsLeave {
2019-02-08 08:59:10 +09:00
example20Type := NewActivityStreamsLeave ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsPlace ( )
objectName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
objectName . AppendXMLSchemaString ( "Work" )
object . SetActivityStreamsName ( objectName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally left work" )
example20Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example20Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsPlace ( object )
example20Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example20Type
}
const example21 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally left a group" ,
"type" : "Leave" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Group" ,
"name" : "A Simple Group"
}
} `
2019-02-10 05:56:00 +09:00
func example21Type ( ) vocab . ActivityStreamsLeave {
2019-02-08 08:59:10 +09:00
example21Type := NewActivityStreamsLeave ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsGroup ( )
objectName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
objectName . AppendXMLSchemaString ( "A Simple Group" )
object . SetActivityStreamsName ( objectName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally left a group" )
example21Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example21Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsGroup ( object )
example21Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example21Type
}
const example22 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally liked a note" ,
"type" : "Like" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/notes/1"
} `
2019-02-10 05:56:00 +09:00
func example22Type ( ) vocab . ActivityStreamsLike {
2019-02-08 08:59:10 +09:00
example22Type := NewActivityStreamsLike ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/notes/1" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally liked a note" )
example22Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example22Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example22Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example22Type
}
const example23 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally offered 50% off to Lewis" ,
"type" : "Offer" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "http://www.types.example/ProductOffer" ,
"name" : "50% Off!"
} ,
"target" : {
"type" : "Person" ,
"name" : "Lewis"
}
} `
var example23Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
m [ "object" ] = map [ string ] interface { } {
"type" : "http://www.types.example/ProductOffer" ,
"name" : "50% Off!" ,
}
return m
}
2019-02-10 05:56:00 +09:00
func example23Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example23Type := NewActivityStreamsOffer ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsPerson ( )
targetName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
targetName . AppendXMLSchemaString ( "Lewis" )
target . SetActivityStreamsName ( targetName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally offered 50% off to Lewis" )
example23Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example23Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsPerson ( target )
example23Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
return example23Type
}
const example24 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally invited John and Lisa to a party" ,
"type" : "Invite" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Event" ,
"name" : "A Party"
} ,
"target" : [
{
"type" : "Person" ,
"name" : "John"
} ,
{
"type" : "Person" ,
"name" : "Lisa"
}
]
} `
2019-02-10 05:56:00 +09:00
func example24Type ( ) vocab . ActivityStreamsInvite {
2019-02-08 08:59:10 +09:00
example24Type := NewActivityStreamsInvite ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsEvent ( )
objectName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
objectName . AppendXMLSchemaString ( "A Party" )
object . SetActivityStreamsName ( objectName )
2019-02-08 08:59:10 +09:00
target1 := NewActivityStreamsPerson ( )
target1Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
target1Name . AppendXMLSchemaString ( "John" )
target1 . SetActivityStreamsName ( target1Name )
2019-02-08 08:59:10 +09:00
target2 := NewActivityStreamsPerson ( )
target2Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
target2Name . AppendXMLSchemaString ( "Lisa" )
target2 . SetActivityStreamsName ( target2Name )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally invited John and Lisa to a party" )
example24Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example24Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsEvent ( object )
example24Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsPerson ( target1 )
tobj . AppendActivityStreamsPerson ( target2 )
example24Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
return example24Type
}
const example25 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally rejected an invitation to a party" ,
"type" : "Reject" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Invite" ,
"actor" : "http://john.example.org" ,
"object" : {
"type" : "Event" ,
"name" : "Going-Away Party for Jim"
}
}
} `
2019-02-10 05:56:00 +09:00
func example25Type ( ) vocab . ActivityStreamsReject {
2019-02-08 08:59:10 +09:00
example25Type := NewActivityStreamsReject ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
inviteObject := NewActivityStreamsEvent ( )
goingAway := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
goingAway . AppendXMLSchemaString ( "Going-Away Party for Jim" )
inviteObject . SetActivityStreamsName ( goingAway )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsInvite ( )
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( MustParseURL ( "http://john.example.org" ) )
2019-02-10 05:56:00 +09:00
object . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsEvent ( inviteObject )
object . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally rejected an invitation to a party" )
example25Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example25Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
objRoot := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objRoot . AppendActivityStreamsInvite ( object )
example25Type . SetActivityStreamsObject ( objRoot )
2019-02-08 08:59:10 +09:00
return example25Type
}
const example26 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally tentatively rejected an invitation to a party" ,
"type" : "TentativeReject" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Invite" ,
"actor" : "http://john.example.org" ,
"object" : {
"type" : "Event" ,
"name" : "Going-Away Party for Jim"
}
}
} `
2019-02-10 05:56:00 +09:00
func example26Type ( ) vocab . ActivityStreamsTentativeReject {
2019-02-08 08:59:10 +09:00
example26Type := NewActivityStreamsTentativeReject ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
inviteObject := NewActivityStreamsEvent ( )
goingAway := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
goingAway . AppendXMLSchemaString ( "Going-Away Party for Jim" )
inviteObject . SetActivityStreamsName ( goingAway )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsInvite ( )
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( MustParseURL ( "http://john.example.org" ) )
2019-02-10 05:56:00 +09:00
object . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsEvent ( inviteObject )
object . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally tentatively rejected an invitation to a party" )
example26Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example26Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
objRoot := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objRoot . AppendActivityStreamsInvite ( object )
example26Type . SetActivityStreamsObject ( objRoot )
2019-02-08 08:59:10 +09:00
return example26Type
}
const example27 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally removed a note from her notes folder" ,
"type" : "Remove" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/notes/1" ,
"target" : {
"type" : "Collection" ,
"name" : "Notes Folder"
}
} `
2019-02-10 05:56:00 +09:00
func example27Type ( ) vocab . ActivityStreamsRemove {
2019-02-08 08:59:10 +09:00
example27Type := NewActivityStreamsRemove ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/notes/1" )
target := NewActivityStreamsCollection ( )
targetName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
targetName . AppendXMLSchemaString ( "Notes Folder" )
target . SetActivityStreamsName ( targetName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally removed a note from her notes folder" )
example27Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example27Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example27Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsCollection ( target )
example27Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
return example27Type
}
const example28 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "The moderator removed Sally from a group" ,
"type" : "Remove" ,
"actor" : {
"type" : "http://example.org/Role" ,
"name" : "The Moderator"
} ,
"object" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"origin" : {
"type" : "Group" ,
"name" : "A Simple Group"
}
} `
var example28Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
m [ "actor" ] = map [ string ] interface { } {
"type" : "http://example.org/Role" ,
"name" : "The Moderator" ,
}
return m
}
2019-02-10 05:56:00 +09:00
func example28Type ( ) vocab . ActivityStreamsRemove {
2019-02-08 08:59:10 +09:00
example28Type := NewActivityStreamsRemove ( )
object := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
object . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
origin := NewActivityStreamsGroup ( )
originName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
originName . AppendXMLSchemaString ( "A Simple Group" )
origin . SetActivityStreamsName ( originName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "The moderator removed Sally from a group" )
example28Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsPerson ( object )
example28Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
originProp := NewActivityStreamsOriginProperty ( )
2019-02-10 05:56:00 +09:00
originProp . AppendActivityStreamsGroup ( origin )
example28Type . SetActivityStreamsOrigin ( originProp )
2019-02-08 08:59:10 +09:00
return example28Type
}
const example29 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally retracted her offer to John" ,
"type" : "Undo" ,
"actor" : "http://sally.example.org" ,
"object" : {
"type" : "Offer" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1" ,
"target" : "http://john.example.org"
}
} `
2019-02-10 05:56:00 +09:00
func example29Type ( ) vocab . ActivityStreamsUndo {
2019-02-08 08:59:10 +09:00
example29Type := NewActivityStreamsUndo ( )
link := MustParseURL ( "http://sally.example.org" )
objectLink := MustParseURL ( "http://example.org/posts/1" )
targetLink := MustParseURL ( "http://john.example.org" )
object := NewActivityStreamsOffer ( )
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
object . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( objectLink )
2019-02-10 05:56:00 +09:00
object . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsTargetProperty ( )
target . AppendIRI ( targetLink )
2019-02-10 05:56:00 +09:00
object . SetActivityStreamsTarget ( target )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally retracted her offer to John" )
example29Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
actor := NewActivityStreamsActorProperty ( )
actor . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example29Type . SetActivityStreamsActor ( actor )
2019-02-08 08:59:10 +09:00
objRoot := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objRoot . AppendActivityStreamsOffer ( object )
example29Type . SetActivityStreamsObject ( objRoot )
2019-02-08 08:59:10 +09:00
return example29Type
}
const example30 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally updated her note" ,
"type" : "Update" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/notes/1"
} `
2019-02-10 05:56:00 +09:00
func example30Type ( ) vocab . ActivityStreamsUpdate {
2019-02-08 08:59:10 +09:00
example30Type := NewActivityStreamsUpdate ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/notes/1" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally updated her note" )
example30Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example30Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example30Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example30Type
}
const example31 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally read an article" ,
"type" : "View" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Article" ,
"name" : "What You Should Know About Activity Streams"
}
} `
2019-02-10 05:56:00 +09:00
func example31Type ( ) vocab . ActivityStreamsView {
2019-02-08 08:59:10 +09:00
example31Type := NewActivityStreamsView ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsArticle ( )
objectName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
objectName . AppendXMLSchemaString ( "What You Should Know About Activity Streams" )
object . SetActivityStreamsName ( objectName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally read an article" )
example31Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example31Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsArticle ( object )
example31Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example31Type
}
const example32 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally listened to a piece of music" ,
"type" : "Listen" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/music.mp3"
} `
2019-02-10 05:56:00 +09:00
func example32Type ( ) vocab . ActivityStreamsListen {
2019-02-08 08:59:10 +09:00
example32Type := NewActivityStreamsListen ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/music.mp3" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally listened to a piece of music" )
example32Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example32Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example32Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example32Type
}
const example33 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally read a blog post" ,
"type" : "Read" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/posts/1"
} `
2019-02-10 05:56:00 +09:00
func example33Type ( ) vocab . ActivityStreamsRead {
2019-02-08 08:59:10 +09:00
example33Type := NewActivityStreamsRead ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/posts/1" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally read a blog post" )
example33Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example33Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example33Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example33Type
}
const example34 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally moved a post from List A to List B" ,
"type" : "Move" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/posts/1" ,
"target" : {
"type" : "Collection" ,
"name" : "List B"
} ,
"origin" : {
"type" : "Collection" ,
"name" : "List A"
}
} `
2019-02-10 05:56:00 +09:00
func example34Type ( ) vocab . ActivityStreamsMove {
2019-02-08 08:59:10 +09:00
example34Type := NewActivityStreamsMove ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
link := MustParseURL ( "http://example.org/posts/1" )
target := NewActivityStreamsCollection ( )
targetName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
targetName . AppendXMLSchemaString ( "List B" )
target . SetActivityStreamsName ( targetName )
2019-02-08 08:59:10 +09:00
origin := NewActivityStreamsCollection ( )
originName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
originName . AppendXMLSchemaString ( "List A" )
origin . SetActivityStreamsName ( originName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally moved a post from List A to List B" )
example34Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example34Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example34Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsCollection ( target )
example34Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
originProp := NewActivityStreamsOriginProperty ( )
2019-02-10 05:56:00 +09:00
originProp . AppendActivityStreamsCollection ( origin )
example34Type . SetActivityStreamsOrigin ( originProp )
2019-02-08 08:59:10 +09:00
return example34Type
}
const example35 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally went home from work" ,
"type" : "Travel" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"target" : {
"type" : "Place" ,
"name" : "Home"
} ,
"origin" : {
"type" : "Place" ,
"name" : "Work"
}
} `
2019-02-10 05:56:00 +09:00
func example35Type ( ) vocab . ActivityStreamsTravel {
2019-02-08 08:59:10 +09:00
example35Type := NewActivityStreamsTravel ( )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsPlace ( )
targetName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
targetName . AppendXMLSchemaString ( "Home" )
target . SetActivityStreamsName ( targetName )
2019-02-08 08:59:10 +09:00
origin := NewActivityStreamsPlace ( )
originName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
originName . AppendXMLSchemaString ( "Work" )
origin . SetActivityStreamsName ( originName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally went home from work" )
example35Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example35Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsPlace ( target )
example35Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
originProp := NewActivityStreamsOriginProperty ( )
2019-02-10 05:56:00 +09:00
originProp . AppendActivityStreamsPlace ( origin )
example35Type . SetActivityStreamsOrigin ( originProp )
2019-02-08 08:59:10 +09:00
return example35Type
}
const example36 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally announced that she had arrived at work" ,
"type" : "Announce" ,
"actor" : {
"type" : "Person" ,
"id" : "http://sally.example.org" ,
"name" : "Sally"
} ,
"object" : {
"type" : "Arrive" ,
"actor" : "http://sally.example.org" ,
"location" : {
"type" : "Place" ,
"name" : "Work"
}
}
} `
2019-02-10 05:56:00 +09:00
func example36Type ( ) vocab . ActivityStreamsAnnounce {
2019-02-08 08:59:10 +09:00
example36Type := NewActivityStreamsAnnounce ( )
link := MustParseURL ( "http://sally.example.org" )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( link )
2019-02-10 05:56:00 +09:00
actor . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
loc := NewActivityStreamsPlace ( )
locName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
locName . AppendXMLSchemaString ( "Work" )
loc . SetActivityStreamsName ( locName )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsArrive ( )
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
object . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
location := NewActivityStreamsLocationProperty ( )
2019-02-10 05:56:00 +09:00
location . AppendActivityStreamsPlace ( loc )
object . SetActivityStreamsLocation ( location )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally announced that she had arrived at work" )
example36Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example36Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsArrive ( object )
example36Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example36Type
}
const example37 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally blocked Joe" ,
"type" : "Block" ,
"actor" : "http://sally.example.org" ,
"object" : "http://joe.example.org"
} `
2019-02-10 05:56:00 +09:00
func example37Type ( ) vocab . ActivityStreamsBlock {
2019-02-08 08:59:10 +09:00
example37Type := NewActivityStreamsBlock ( )
link := MustParseURL ( "http://sally.example.org" )
objLink := MustParseURL ( "http://joe.example.org" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally blocked Joe" )
example37Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example37Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( objLink )
2019-02-10 05:56:00 +09:00
example37Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example37Type
}
const example38 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally flagged an inappropriate note" ,
"type" : "Flag" ,
"actor" : "http://sally.example.org" ,
"object" : {
"type" : "Note" ,
"content" : "An inappropriate note"
}
} `
2019-02-10 05:56:00 +09:00
func example38Type ( ) vocab . ActivityStreamsFlag {
2019-02-08 08:59:10 +09:00
example38Type := NewActivityStreamsFlag ( )
link := MustParseURL ( "http://sally.example.org" )
object := NewActivityStreamsNote ( )
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "An inappropriate note" )
object . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally flagged an inappropriate note" )
example38Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example38Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsNote ( object )
example38Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example38Type
}
const example39 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally disliked a post" ,
"type" : "Dislike" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1"
} `
2019-02-10 05:56:00 +09:00
func example39Type ( ) vocab . ActivityStreamsDislike {
2019-02-08 08:59:10 +09:00
example39Type := NewActivityStreamsDislike ( )
link := MustParseURL ( "http://sally.example.org" )
objLink := MustParseURL ( "http://example.org/posts/1" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally disliked a post" )
example39Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( link )
2019-02-10 05:56:00 +09:00
example39Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( objLink )
2019-02-10 05:56:00 +09:00
example39Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example39Type
}
const example40 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Question" ,
"name" : "What is the answer?" ,
"oneOf" : [
{
"type" : "Note" ,
"name" : "Option A"
} ,
{
"type" : "Note" ,
"name" : "Option B"
}
]
} `
2019-02-10 05:56:00 +09:00
func example40Type ( ) vocab . ActivityStreamsQuestion {
2019-02-08 08:59:10 +09:00
example40Type := NewActivityStreamsQuestion ( )
note1 := NewActivityStreamsNote ( )
note1Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note1Name . AppendXMLSchemaString ( "Option A" )
note1 . SetActivityStreamsName ( note1Name )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
note2Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note2Name . AppendXMLSchemaString ( "Option B" )
note2 . SetActivityStreamsName ( note2Name )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "What is the answer?" )
example40Type . SetActivityStreamsName ( name )
2019-02-09 21:27:04 +09:00
oneOf := NewActivityStreamsOneOfProperty ( )
2019-02-10 05:56:00 +09:00
oneOf . AppendActivityStreamsNote ( note1 )
oneOf . AppendActivityStreamsNote ( note2 )
example40Type . SetActivityStreamsOneOf ( oneOf )
2019-02-08 08:59:10 +09:00
return example40Type
}
const example41 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Question" ,
"name" : "What is the answer?" ,
"closed" : "2016-05-10T00:00:00Z"
} `
2019-02-10 05:56:00 +09:00
func example41Type ( ) vocab . ActivityStreamsQuestion {
2019-02-08 08:59:10 +09:00
example41Type := NewActivityStreamsQuestion ( )
t , err := time . Parse ( time . RFC3339 , "2016-05-10T00:00:00Z" )
if err != nil {
panic ( err )
}
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "What is the answer?" )
example41Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
closed := NewActivityStreamsClosedProperty ( )
2019-02-10 05:56:00 +09:00
closed . AppendXMLSchemaDateTime ( t )
example41Type . SetActivityStreamsClosed ( closed )
2019-02-08 08:59:10 +09:00
return example41Type
}
const example42 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Application" ,
"name" : "Exampletron 3000"
} `
2019-02-10 05:56:00 +09:00
func example42Type ( ) vocab . ActivityStreamsApplication {
2019-02-08 08:59:10 +09:00
example42Type := NewActivityStreamsApplication ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Exampletron 3000" )
example42Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example42Type
}
const example43 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Group" ,
"name" : "Big Beards of Austin"
} `
2019-02-10 05:56:00 +09:00
func example43Type ( ) vocab . ActivityStreamsGroup {
2019-02-08 08:59:10 +09:00
example43Type := NewActivityStreamsGroup ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Big Beards of Austin" )
example43Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example43Type
}
const example44 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Organization" ,
"name" : "Example Co."
} `
2019-02-10 05:56:00 +09:00
func example44Type ( ) vocab . ActivityStreamsOrganization {
2019-02-08 08:59:10 +09:00
example44Type := NewActivityStreamsOrganization ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Example Co." )
example44Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example44Type
}
const example45 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Person" ,
"name" : "Sally Smith"
} `
2019-02-10 05:56:00 +09:00
func example45Type ( ) vocab . ActivityStreamsPerson {
2019-02-08 08:59:10 +09:00
example45Type := NewActivityStreamsPerson ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Sally Smith" )
example45Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example45Type
}
const example46 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Service" ,
"name" : "Acme Web Service"
} `
2019-02-10 05:56:00 +09:00
func example46Type ( ) vocab . ActivityStreamsService {
2019-02-08 08:59:10 +09:00
example46Type := NewActivityStreamsService ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Acme Web Service" )
example46Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example46Type
}
const example47 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally is an acquaintance of John" ,
"type" : "Relationship" ,
"subject" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"relationship" : "http://purl.org/vocab/relationship/acquaintanceOf" ,
"object" : {
"type" : "Person" ,
"name" : "John"
}
} `
2019-02-10 05:56:00 +09:00
func example47Type ( ) vocab . ActivityStreamsRelationship {
2019-02-08 08:59:10 +09:00
example47Type := NewActivityStreamsRelationship ( )
subject := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
subject . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsPerson ( )
objectName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
objectName . AppendXMLSchemaString ( "John" )
object . SetActivityStreamsName ( objectName )
2019-02-08 08:59:10 +09:00
rel := MustParseURL ( "http://purl.org/vocab/relationship/acquaintanceOf" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally is an acquaintance of John" )
example47Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
subj := NewActivityStreamsSubjectProperty ( )
2019-02-10 05:56:00 +09:00
subj . SetActivityStreamsPerson ( subject )
example47Type . SetActivityStreamsSubject ( subj )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsPerson ( object )
example47Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
relationship := NewActivityStreamsRelationshipProperty ( )
relationship . AppendIRI ( rel )
2019-02-10 05:56:00 +09:00
example47Type . SetActivityStreamsRelationship ( relationship )
2019-02-08 08:59:10 +09:00
return example47Type
}
const example48 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Article" ,
"name" : "What a Crazy Day I Had" ,
"content" : "<div>... you will never believe ...</div>" ,
"attributedTo" : "http://sally.example.org"
} `
2019-02-10 05:56:00 +09:00
func example48Type ( ) vocab . ActivityStreamsArticle {
2019-02-08 08:59:10 +09:00
example48Type := NewActivityStreamsArticle ( )
att := MustParseURL ( "http://sally.example.org" )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "What a Crazy Day I Had" )
example48Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
attr := NewActivityStreamsAttributedToProperty ( )
attr . AppendIRI ( att )
2019-02-10 05:56:00 +09:00
example48Type . SetActivityStreamsAttributedTo ( attr )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "<div>... you will never believe ...</div>" )
example48Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
return example48Type
}
const example49 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Document" ,
"name" : "4Q Sales Forecast" ,
"url" : "http://example.org/4q-sales-forecast.pdf"
} `
2019-02-10 05:56:00 +09:00
func example49Type ( ) vocab . ActivityStreamsDocument {
2019-02-08 08:59:10 +09:00
example49Type := NewActivityStreamsDocument ( )
l := MustParseURL ( "http://example.org/4q-sales-forecast.pdf" )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "4Q Sales Forecast" )
example49Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( l )
2019-02-10 05:56:00 +09:00
example49Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
return example49Type
}
const example50 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Audio" ,
"name" : "Interview With A Famous Technologist" ,
"url" : {
"type" : "Link" ,
"href" : "http://example.org/podcast.mp3" ,
"mediaType" : "audio/mp3"
}
} `
2019-02-10 05:56:00 +09:00
func example50Type ( ) vocab . ActivityStreamsAudio {
2019-02-08 08:59:10 +09:00
example50Type := NewActivityStreamsAudio ( )
l := MustParseURL ( "http://example.org/podcast.mp3" )
link := NewActivityStreamsLink ( )
href := NewActivityStreamsHrefProperty ( )
href . Set ( l )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsHref ( href )
2019-02-08 08:59:10 +09:00
mediaType := NewActivityStreamsMediaTypeProperty ( )
mediaType . Set ( "audio/mp3" )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsMediaType ( mediaType )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Interview With A Famous Technologist" )
example50Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
urlProperty := NewActivityStreamsUrlProperty ( )
2019-02-10 05:56:00 +09:00
urlProperty . AppendActivityStreamsLink ( link )
example50Type . SetActivityStreamsUrl ( urlProperty )
2019-02-08 08:59:10 +09:00
return example50Type
}
const example51 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Image" ,
"name" : "Cat Jumping on Wagon" ,
"url" : [
{
"type" : "Link" ,
"href" : "http://example.org/image.jpeg" ,
"mediaType" : "image/jpeg"
} ,
{
"type" : "Link" ,
"href" : "http://example.org/image.png" ,
"mediaType" : "image/png"
}
]
} `
2019-02-10 05:56:00 +09:00
func example51Type ( ) vocab . ActivityStreamsImage {
2019-02-08 08:59:10 +09:00
example51Type := NewActivityStreamsImage ( )
l1 := MustParseURL ( "http://example.org/image.jpeg" )
l2 := MustParseURL ( "http://example.org/image.png" )
link1 := NewActivityStreamsLink ( )
href1 := NewActivityStreamsHrefProperty ( )
href1 . Set ( l1 )
2019-02-10 05:56:00 +09:00
link1 . SetActivityStreamsHref ( href1 )
2019-02-08 08:59:10 +09:00
mediaType1 := NewActivityStreamsMediaTypeProperty ( )
mediaType1 . Set ( "image/jpeg" )
2019-02-10 05:56:00 +09:00
link1 . SetActivityStreamsMediaType ( mediaType1 )
2019-02-08 08:59:10 +09:00
link2 := NewActivityStreamsLink ( )
href2 := NewActivityStreamsHrefProperty ( )
href2 . Set ( l2 )
2019-02-10 05:56:00 +09:00
link2 . SetActivityStreamsHref ( href2 )
2019-02-08 08:59:10 +09:00
mediaType2 := NewActivityStreamsMediaTypeProperty ( )
mediaType2 . Set ( "image/png" )
2019-02-10 05:56:00 +09:00
link2 . SetActivityStreamsMediaType ( mediaType2 )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Cat Jumping on Wagon" )
example51Type . SetActivityStreamsName ( name )
2019-02-09 21:27:04 +09:00
urlProperty := NewActivityStreamsUrlProperty ( )
2019-02-10 05:56:00 +09:00
urlProperty . AppendActivityStreamsLink ( link1 )
urlProperty . AppendActivityStreamsLink ( link2 )
example51Type . SetActivityStreamsUrl ( urlProperty )
2019-02-08 08:59:10 +09:00
return example51Type
}
const example52 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Video" ,
"name" : "Puppy Plays With Ball" ,
"url" : "http://example.org/video.mkv" ,
"duration" : "PT2H"
} `
2019-02-10 05:56:00 +09:00
func example52Type ( ) vocab . ActivityStreamsVideo {
2019-02-08 08:59:10 +09:00
example52Type := NewActivityStreamsVideo ( )
l := MustParseURL ( "http://example.org/video.mkv" )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Puppy Plays With Ball" )
example52Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( l )
2019-02-10 05:56:00 +09:00
example52Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
dur := NewActivityStreamsDurationProperty ( )
dur . Set ( time . Hour * 2 )
2019-02-10 05:56:00 +09:00
example52Type . SetActivityStreamsDuration ( dur )
2019-02-08 08:59:10 +09:00
return example52Type
}
const example53 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Note" ,
"name" : "A Word of Warning" ,
"content" : "Looks like it is going to rain today. Bring an umbrella!"
} `
2019-02-10 05:56:00 +09:00
func example53Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example53Type := NewActivityStreamsNote ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A Word of Warning" )
example53Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "Looks like it is going to rain today. Bring an umbrella!" )
example53Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
return example53Type
}
const example54 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Page" ,
"name" : "Omaha Weather Report" ,
"url" : "http://example.org/weather-in-omaha.html"
} `
2019-02-10 05:56:00 +09:00
func example54Type ( ) vocab . ActivityStreamsPage {
2019-02-08 08:59:10 +09:00
example54Type := NewActivityStreamsPage ( )
l := MustParseURL ( "http://example.org/weather-in-omaha.html" )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Omaha Weather Report" )
example54Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( l )
2019-02-10 05:56:00 +09:00
example54Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
return example54Type
}
const example55 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Event" ,
"name" : "Going-Away Party for Jim" ,
"startTime" : "2014-12-31T23:00:00-08:00" ,
"endTime" : "2015-01-01T06:00:00-08:00"
} `
2019-02-10 05:56:00 +09:00
func example55Type ( ) vocab . ActivityStreamsEvent {
2019-02-08 08:59:10 +09:00
example55Type := NewActivityStreamsEvent ( )
t1 , err := time . Parse ( time . RFC3339 , "2014-12-31T23:00:00-08:00" )
if err != nil {
panic ( err )
}
t2 , err := time . Parse ( time . RFC3339 , "2015-01-01T06:00:00-08:00" )
if err != nil {
panic ( err )
}
goingAway := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
goingAway . AppendXMLSchemaString ( "Going-Away Party for Jim" )
example55Type . SetActivityStreamsName ( goingAway )
2019-02-08 08:59:10 +09:00
startTime := NewActivityStreamsStartTimeProperty ( )
startTime . Set ( t1 )
2019-02-10 05:56:00 +09:00
example55Type . SetActivityStreamsStartTime ( startTime )
2019-02-08 08:59:10 +09:00
endTime := NewActivityStreamsEndTimeProperty ( )
endTime . Set ( t2 )
2019-02-10 05:56:00 +09:00
example55Type . SetActivityStreamsEndTime ( endTime )
2019-02-08 08:59:10 +09:00
return example55Type
}
const example56 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Place" ,
"name" : "Work"
} `
2019-02-10 05:56:00 +09:00
func example56Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example56Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Work" )
example56Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example56Type
}
const example57 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Place" ,
"name" : "Fresno Area" ,
"latitude" : 36.75 ,
"longitude" : 119.7667 ,
"radius" : 15 ,
"units" : "miles"
} `
2019-02-10 05:56:00 +09:00
func example57Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example57Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Fresno Area" )
example57Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
lat := NewActivityStreamsLatitudeProperty ( )
lat . Set ( 36.75 )
2019-02-10 05:56:00 +09:00
example57Type . SetActivityStreamsLatitude ( lat )
2019-02-08 08:59:10 +09:00
lon := NewActivityStreamsLongitudeProperty ( )
lon . Set ( 119.7667 )
2019-02-10 05:56:00 +09:00
example57Type . SetActivityStreamsLongitude ( lon )
2019-02-08 08:59:10 +09:00
rad := NewActivityStreamsRadiusProperty ( )
rad . Set ( 15 )
2019-02-10 05:56:00 +09:00
example57Type . SetActivityStreamsRadius ( rad )
2019-02-08 08:59:10 +09:00
units := NewActivityStreamsUnitsProperty ( )
2019-02-10 05:56:00 +09:00
units . SetXMLSchemaString ( "miles" )
example57Type . SetActivityStreamsUnits ( units )
2019-02-08 08:59:10 +09:00
return example57Type
}
const example58 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Mention" ,
"summary" : "Mention of Joe by Carrie in her note" ,
"href" : "http://example.org/joe" ,
"name" : "Joe"
} `
2019-02-10 05:56:00 +09:00
func example58Type ( ) vocab . ActivityStreamsMention {
2019-02-08 08:59:10 +09:00
example58Type := NewActivityStreamsMention ( )
l := MustParseURL ( "http://example.org/joe" )
href := NewActivityStreamsHrefProperty ( )
href . Set ( l )
2019-02-10 05:56:00 +09:00
example58Type . SetActivityStreamsHref ( href )
2019-02-08 08:59:10 +09:00
joe := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
joe . AppendXMLSchemaString ( "Joe" )
example58Type . SetActivityStreamsName ( joe )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Mention of Joe by Carrie in her note" )
example58Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
return example58Type
}
const example59 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Profile" ,
"summary" : "Sally's Profile" ,
"describes" : {
"type" : "Person" ,
"name" : "Sally Smith"
}
} `
2019-02-10 05:56:00 +09:00
func example59Type ( ) vocab . ActivityStreamsProfile {
2019-02-08 08:59:10 +09:00
example59Type := NewActivityStreamsProfile ( )
person := NewActivityStreamsPerson ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Sally Smith" )
person . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's Profile" )
example59Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
describes := NewActivityStreamsDescribesProperty ( )
2019-02-10 05:56:00 +09:00
describes . SetActivityStreamsPerson ( person )
example59Type . SetActivityStreamsDescribes ( describes )
2019-02-08 08:59:10 +09:00
return example59Type
}
// Note that the @context is missing from the spec!
const example60 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "OrderedCollection" ,
"totalItems" : 3 ,
"name" : "Vacation photos 2016" ,
"orderedItems" : [
{
"type" : "Image" ,
"id" : "http://image.example/1"
} ,
{
"type" : "Tombstone" ,
"formerType" : "Image" ,
"id" : "http://image.example/2" ,
"deleted" : "2016-03-17T00:00:00Z"
} ,
{
"type" : "Image" ,
"id" : "http://image.example/3"
}
]
} `
2019-02-10 05:56:00 +09:00
func example60Type ( ) vocab . ActivityStreamsOrderedCollection {
2019-02-08 08:59:10 +09:00
example60Type := NewActivityStreamsOrderedCollection ( )
t , err := time . Parse ( time . RFC3339 , "2016-03-17T00:00:00Z" )
if err != nil {
panic ( err )
}
image1 := NewActivityStreamsImage ( )
imgId1 := NewActivityStreamsIdProperty ( )
imgId1 . Set ( MustParseURL ( "http://image.example/1" ) )
2019-02-10 05:56:00 +09:00
image1 . SetActivityStreamsId ( imgId1 )
2019-02-08 08:59:10 +09:00
tombstone := NewActivityStreamsTombstone ( )
ft := NewActivityStreamsFormerTypeProperty ( )
2019-02-10 05:56:00 +09:00
ft . AppendXMLSchemaString ( "Image" )
tombstone . SetActivityStreamsFormerType ( ft )
2019-02-08 08:59:10 +09:00
tombId := NewActivityStreamsIdProperty ( )
tombId . Set ( MustParseURL ( "http://image.example/2" ) )
2019-02-10 05:56:00 +09:00
tombstone . SetActivityStreamsId ( tombId )
2019-02-08 08:59:10 +09:00
deleted := NewActivityStreamsDeletedProperty ( )
deleted . Set ( t )
2019-02-10 05:56:00 +09:00
tombstone . SetActivityStreamsDeleted ( deleted )
2019-02-08 08:59:10 +09:00
image2 := NewActivityStreamsImage ( )
imgId2 := NewActivityStreamsIdProperty ( )
imgId2 . Set ( MustParseURL ( "http://image.example/3" ) )
2019-02-10 05:56:00 +09:00
image2 . SetActivityStreamsId ( imgId2 )
2019-02-08 08:59:10 +09:00
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 3 )
2019-02-10 05:56:00 +09:00
example60Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Vacation photos 2016" )
example60Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
orderedItems := NewActivityStreamsOrderedItemsProperty ( )
2019-02-10 05:56:00 +09:00
orderedItems . AppendActivityStreamsImage ( image1 )
orderedItems . AppendActivityStreamsTombstone ( tombstone )
orderedItems . AppendActivityStreamsImage ( image2 )
example60Type . SetActivityStreamsOrderedItems ( orderedItems )
2019-02-08 08:59:10 +09:00
return example60Type
}
const example61 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "Foo" ,
"id" : "http://example.org/foo"
} `
var example61Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
m [ "id" ] = "http://example.org/foo"
m [ "name" ] = "Foo"
return m
}
const example62 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A foo" ,
"type" : "http://example.org/Foo"
} `
var example62Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
m [ "type" ] = "http://example.org/Foo"
m [ "summary" ] = "A foo"
return m
}
const example63 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally offered the Foo object" ,
"type" : "Offer" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/foo"
} `
2019-02-10 05:56:00 +09:00
func example63Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example63Type := NewActivityStreamsOffer ( )
l := MustParseURL ( "http://sally.example.org" )
o := MustParseURL ( "http://example.org/foo" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally offered the Foo object" )
example63Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( l )
2019-02-10 05:56:00 +09:00
example63Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example63Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example63Type
}
const example64 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally offered the Foo object" ,
"type" : "Offer" ,
"actor" : {
"type" : "Person" ,
"id" : "http://sally.example.org" ,
"summary" : "Sally"
} ,
"object" : "http://example.org/foo"
} `
2019-02-10 05:56:00 +09:00
func example64Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example64Type := NewActivityStreamsOffer ( )
actor := NewActivityStreamsPerson ( )
actorId := NewActivityStreamsIdProperty ( )
actorId . Set ( MustParseURL ( "http://sally.example.org" ) )
2019-02-10 05:56:00 +09:00
actor . SetActivityStreamsId ( actorId )
2019-02-08 08:59:10 +09:00
summaryActor := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryActor . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsSummary ( summaryActor )
2019-02-08 08:59:10 +09:00
o := MustParseURL ( "http://example.org/foo" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally offered the Foo object" )
example64Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example64Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example64Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example64Type
}
const example65 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally and Joe offered the Foo object" ,
"type" : "Offer" ,
"actor" : [
"http://joe.example.org" ,
{
"type" : "Person" ,
"id" : "http://sally.example.org" ,
"name" : "Sally"
}
] ,
"object" : "http://example.org/foo"
} `
2019-02-10 05:56:00 +09:00
func example65Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example65Type := NewActivityStreamsOffer ( )
actor := NewActivityStreamsPerson ( )
actorId := NewActivityStreamsIdProperty ( )
actorId . Set ( MustParseURL ( "http://sally.example.org" ) )
2019-02-10 05:56:00 +09:00
actor . SetActivityStreamsId ( actorId )
2019-02-08 08:59:10 +09:00
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
o := MustParseURL ( "http://example.org/foo" )
l := MustParseURL ( "http://joe.example.org" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally and Joe offered the Foo object" )
example65Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example65Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-09 21:27:04 +09:00
rootActor . AppendIRI ( l )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example65Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
return example65Type
}
// NOTE: Changed to not be an array value for "attachment" to keep in line with other examples in spec!
const example66 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Note" ,
"name" : "Have you seen my cat?" ,
"attachment" : {
"type" : "Image" ,
"content" : "This is what he looks like." ,
"url" : "http://example.org/cat.jpeg"
}
} `
2019-02-10 05:56:00 +09:00
func example66Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example66Type := NewActivityStreamsNote ( )
l := MustParseURL ( "http://example.org/cat.jpeg" )
image := NewActivityStreamsImage ( )
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "This is what he looks like." )
image . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
imgProp := NewActivityStreamsUrlProperty ( )
imgProp . AppendIRI ( l )
2019-02-10 05:56:00 +09:00
image . SetActivityStreamsUrl ( imgProp )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Have you seen my cat?" )
example66Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
attachment := NewActivityStreamsAttachmentProperty ( )
2019-02-10 05:56:00 +09:00
attachment . AppendActivityStreamsImage ( image )
example66Type . SetActivityStreamsAttachment ( attachment )
2019-02-08 08:59:10 +09:00
return example66Type
}
// NOTE: Changed to not be an array value for "attributedTo" to keep in line with other examples in spec!
const example67 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Image" ,
"name" : "My cat taking a nap" ,
"url" : "http://example.org/cat.jpeg" ,
"attributedTo" : {
"type" : "Person" ,
"name" : "Sally"
}
} `
2019-02-10 05:56:00 +09:00
func example67Type ( ) vocab . ActivityStreamsImage {
2019-02-08 08:59:10 +09:00
example67Type := NewActivityStreamsImage ( )
l := MustParseURL ( "http://example.org/cat.jpeg" )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "My cat taking a nap" )
example67Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( l )
2019-02-10 05:56:00 +09:00
example67Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
attr := NewActivityStreamsAttributedToProperty ( )
2019-02-10 05:56:00 +09:00
attr . AppendActivityStreamsPerson ( person )
example67Type . SetActivityStreamsAttributedTo ( attr )
2019-02-08 08:59:10 +09:00
return example67Type
}
const example68 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Image" ,
"name" : "My cat taking a nap" ,
"url" : "http://example.org/cat.jpeg" ,
"attributedTo" : [
"http://joe.example.org" ,
{
"type" : "Person" ,
"name" : "Sally"
}
]
} `
2019-02-10 05:56:00 +09:00
func example68Type ( ) vocab . ActivityStreamsImage {
2019-02-08 08:59:10 +09:00
example68Type := NewActivityStreamsImage ( )
l := MustParseURL ( "http://example.org/cat.jpeg" )
a := MustParseURL ( "http://joe.example.org" )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "My cat taking a nap" )
example68Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( l )
2019-02-10 05:56:00 +09:00
example68Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
attr := NewActivityStreamsAttributedToProperty ( )
attr . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
attr . AppendActivityStreamsPerson ( person )
example68Type . SetActivityStreamsAttributedTo ( attr )
2019-02-08 08:59:10 +09:00
return example68Type
}
const example69 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "Holiday announcement" ,
"type" : "Note" ,
"content" : "Thursday will be a company-wide holiday. Enjoy your day off!" ,
"audience" : {
"type" : "http://example.org/Organization" ,
"name" : "ExampleCo LLC"
}
} `
var example69Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
m [ "audience" ] = map [ string ] interface { } {
"type" : "http://example.org/Organization" ,
"name" : "ExampleCo LLC" ,
}
return m
}
2019-02-10 05:56:00 +09:00
func example69Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example69Type := NewActivityStreamsNote ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Holiday announcement" )
example69Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "Thursday will be a company-wide holiday. Enjoy your day off!" )
example69Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
return example69Type
}
// NOTE: Changed to not be an array value for "bcc" to keep in line with other examples in spec!
const example70 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally offered a post to John" ,
"type" : "Offer" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1" ,
"target" : "http://john.example.org" ,
"bcc" : "http://joe.example.org"
} `
2019-02-10 05:56:00 +09:00
func example70Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example70Type := NewActivityStreamsOffer ( )
o := MustParseURL ( "http://example.org/posts/1" )
a := MustParseURL ( "http://sally.example.org" )
t := MustParseURL ( "http://john.example.org" )
b := MustParseURL ( "http://joe.example.org" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally offered a post to John" )
example70Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example70Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example70Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsTargetProperty ( )
target . AppendIRI ( t )
2019-02-10 05:56:00 +09:00
example70Type . SetActivityStreamsTarget ( target )
2019-02-08 08:59:10 +09:00
bcc := NewActivityStreamsBccProperty ( )
bcc . AppendIRI ( b )
2019-02-10 05:56:00 +09:00
example70Type . SetActivityStreamsBcc ( bcc )
2019-02-08 08:59:10 +09:00
return example70Type
}
// NOTE: Changed to not be an array value for "bto" to keep in line with other examples in spec!
const example71 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally offered a post to John" ,
"type" : "Offer" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1" ,
"target" : "http://john.example.org" ,
"bto" : "http://joe.example.org"
} `
2019-02-10 05:56:00 +09:00
func example71Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example71Type := NewActivityStreamsOffer ( )
o := MustParseURL ( "http://example.org/posts/1" )
a := MustParseURL ( "http://sally.example.org" )
t := MustParseURL ( "http://john.example.org" )
b := MustParseURL ( "http://joe.example.org" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally offered a post to John" )
example71Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example71Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example71Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsTargetProperty ( )
target . AppendIRI ( t )
2019-02-10 05:56:00 +09:00
example71Type . SetActivityStreamsTarget ( target )
2019-02-08 08:59:10 +09:00
bto := NewActivityStreamsBtoProperty ( )
bto . AppendIRI ( b )
2019-02-10 05:56:00 +09:00
example71Type . SetActivityStreamsBto ( bto )
2019-02-08 08:59:10 +09:00
return example71Type
}
// NOTE: Changed to not be an array value for "cc" to keep in line with other examples in spec!
const example72 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally offered a post to John" ,
"type" : "Offer" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1" ,
"target" : "http://john.example.org" ,
"cc" : "http://joe.example.org"
} `
2019-02-10 05:56:00 +09:00
func example72Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example72Type := NewActivityStreamsOffer ( )
o := MustParseURL ( "http://example.org/posts/1" )
a := MustParseURL ( "http://sally.example.org" )
t := MustParseURL ( "http://john.example.org" )
b := MustParseURL ( "http://joe.example.org" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally offered a post to John" )
example72Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example72Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example72Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsTargetProperty ( )
target . AppendIRI ( t )
2019-02-10 05:56:00 +09:00
example72Type . SetActivityStreamsTarget ( target )
2019-02-08 08:59:10 +09:00
cc := NewActivityStreamsCcProperty ( )
cc . AppendIRI ( b )
2019-02-10 05:56:00 +09:00
example72Type . SetActivityStreamsCc ( cc )
2019-02-08 08:59:10 +09:00
return example72Type
}
const example73 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Activities in context 1" ,
"type" : "Collection" ,
"items" : [
{
"type" : "Offer" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1" ,
"target" : "http://john.example.org" ,
"context" : "http://example.org/contexts/1"
} ,
{
"type" : "Like" ,
"actor" : "http://joe.example.org" ,
"object" : "http://example.org/posts/2" ,
"context" : "http://example.org/contexts/1"
}
]
} `
2019-02-10 05:56:00 +09:00
func example73Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example73Type := NewActivityStreamsCollection ( )
oa := MustParseURL ( "http://sally.example.org" )
oo := MustParseURL ( "http://example.org/posts/1" )
ot := MustParseURL ( "http://john.example.org" )
oc := MustParseURL ( "http://example.org/contexts/1" )
offer := NewActivityStreamsOffer ( )
offerActor := NewActivityStreamsActorProperty ( )
offerActor . AppendIRI ( oa )
2019-02-10 05:56:00 +09:00
offer . SetActivityStreamsActor ( offerActor )
2019-02-08 08:59:10 +09:00
objOffer := NewActivityStreamsObjectProperty ( )
objOffer . AppendIRI ( oo )
2019-02-10 05:56:00 +09:00
offer . SetActivityStreamsObject ( objOffer )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsTargetProperty ( )
target . AppendIRI ( ot )
2019-02-10 05:56:00 +09:00
offer . SetActivityStreamsTarget ( target )
2019-02-08 08:59:10 +09:00
ctx := NewActivityStreamsContextProperty ( )
ctx . AppendIRI ( oc )
2019-02-10 05:56:00 +09:00
offer . SetActivityStreamsContext ( ctx )
2019-02-08 08:59:10 +09:00
la := MustParseURL ( "http://joe.example.org" )
lo := MustParseURL ( "http://example.org/posts/2" )
lc := MustParseURL ( "http://example.org/contexts/1" )
like := NewActivityStreamsLike ( )
likeActor := NewActivityStreamsActorProperty ( )
likeActor . AppendIRI ( la )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsActor ( likeActor )
2019-02-08 08:59:10 +09:00
objLike := NewActivityStreamsObjectProperty ( )
objLike . AppendIRI ( lo )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsObject ( objLike )
2019-02-08 08:59:10 +09:00
ctxLike := NewActivityStreamsContextProperty ( )
ctxLike . AppendIRI ( lc )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsContext ( ctxLike )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Activities in context 1" )
example73Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsOffer ( offer )
items . AppendActivityStreamsLike ( like )
example73Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example73Type
}
const example74 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's blog posts" ,
"type" : "Collection" ,
"totalItems" : 3 ,
"current" : "http://example.org/collection" ,
"items" : [
"http://example.org/posts/1" ,
"http://example.org/posts/2" ,
"http://example.org/posts/3"
]
} `
2019-02-10 05:56:00 +09:00
func example74Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example74Type := NewActivityStreamsCollection ( )
c := MustParseURL ( "http://example.org/collection" )
i1 := MustParseURL ( "http://example.org/posts/1" )
i2 := MustParseURL ( "http://example.org/posts/2" )
i3 := MustParseURL ( "http://example.org/posts/3" )
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 3 )
2019-02-10 05:56:00 +09:00
example74Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's blog posts" )
example74Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
current := NewActivityStreamsCurrentProperty ( )
current . SetIRI ( c )
2019-02-10 05:56:00 +09:00
example74Type . SetActivityStreamsCurrent ( current )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
items . AppendIRI ( i1 )
items . AppendIRI ( i2 )
items . AppendIRI ( i3 )
2019-02-10 05:56:00 +09:00
example74Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example74Type
}
const example75 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's blog posts" ,
"type" : "Collection" ,
"totalItems" : 3 ,
"current" : {
"type" : "Link" ,
"summary" : "Most Recent Items" ,
"href" : "http://example.org/collection"
} ,
"items" : [
"http://example.org/posts/1" ,
"http://example.org/posts/2" ,
"http://example.org/posts/3"
]
} `
2019-02-10 05:56:00 +09:00
func example75Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example75Type := NewActivityStreamsCollection ( )
i1 := MustParseURL ( "http://example.org/posts/1" )
i2 := MustParseURL ( "http://example.org/posts/2" )
i3 := MustParseURL ( "http://example.org/posts/3" )
href := MustParseURL ( "http://example.org/collection" )
link := NewActivityStreamsLink ( )
summaryLink := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryLink . AppendXMLSchemaString ( "Most Recent Items" )
link . SetActivityStreamsSummary ( summaryLink )
2019-02-08 08:59:10 +09:00
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( href )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 3 )
2019-02-10 05:56:00 +09:00
example75Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's blog posts" )
example75Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
current := NewActivityStreamsCurrentProperty ( )
2019-02-10 05:56:00 +09:00
current . SetActivityStreamsLink ( link )
example75Type . SetActivityStreamsCurrent ( current )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
items . AppendIRI ( i1 )
items . AppendIRI ( i2 )
items . AppendIRI ( i3 )
2019-02-10 05:56:00 +09:00
example75Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example75Type
}
const example76 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's blog posts" ,
"type" : "Collection" ,
"totalItems" : 3 ,
"first" : "http://example.org/collection?page=0"
} `
2019-02-10 05:56:00 +09:00
func example76Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example76Type := NewActivityStreamsCollection ( )
f := MustParseURL ( "http://example.org/collection?page=0" )
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 3 )
2019-02-10 05:56:00 +09:00
example76Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's blog posts" )
example76Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
first := NewActivityStreamsFirstProperty ( )
first . SetIRI ( f )
2019-02-10 05:56:00 +09:00
example76Type . SetActivityStreamsFirst ( first )
2019-02-08 08:59:10 +09:00
return example76Type
}
const example77 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's blog posts" ,
"type" : "Collection" ,
"totalItems" : 3 ,
"first" : {
"type" : "Link" ,
"summary" : "First Page" ,
"href" : "http://example.org/collection?page=0"
}
} `
2019-02-10 05:56:00 +09:00
func example77Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example77Type := NewActivityStreamsCollection ( )
href := MustParseURL ( "http://example.org/collection?page=0" )
link := NewActivityStreamsLink ( )
summaryLink := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryLink . AppendXMLSchemaString ( "First Page" )
link . SetActivityStreamsSummary ( summaryLink )
2019-02-08 08:59:10 +09:00
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( href )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 3 )
2019-02-10 05:56:00 +09:00
example77Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's blog posts" )
example77Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
first := NewActivityStreamsFirstProperty ( )
2019-02-10 05:56:00 +09:00
first . SetActivityStreamsLink ( link )
example77Type . SetActivityStreamsFirst ( first )
2019-02-08 08:59:10 +09:00
return example77Type
}
const example78 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"content" : "This is all there is." ,
"generator" : {
"type" : "Application" ,
"name" : "Exampletron 3000"
}
} `
2019-02-10 05:56:00 +09:00
func example78Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example78Type := NewActivityStreamsNote ( )
app := NewActivityStreamsApplication ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Exampletron 3000" )
app . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example78Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "This is all there is." )
example78Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
gen := NewActivityStreamsGeneratorProperty ( )
2019-02-10 05:56:00 +09:00
gen . AppendActivityStreamsApplication ( app )
example78Type . SetActivityStreamsGenerator ( gen )
2019-02-08 08:59:10 +09:00
return example78Type
}
const example79 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"content" : "This is all there is." ,
"icon" : {
"type" : "Image" ,
"name" : "Note icon" ,
"url" : "http://example.org/note.png" ,
"width" : 16 ,
"height" : 16
}
} `
2019-02-10 05:56:00 +09:00
func example79Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example79Type := NewActivityStreamsNote ( )
u := MustParseURL ( "http://example.org/note.png" )
image := NewActivityStreamsImage ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Note icon" )
image . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
imgProp := NewActivityStreamsUrlProperty ( )
imgProp . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
image . SetActivityStreamsUrl ( imgProp )
2019-02-08 08:59:10 +09:00
width := NewActivityStreamsWidthProperty ( )
width . Set ( 16 )
2019-02-10 05:56:00 +09:00
image . SetActivityStreamsWidth ( width )
2019-02-08 08:59:10 +09:00
height := NewActivityStreamsHeightProperty ( )
height . Set ( 16 )
2019-02-10 05:56:00 +09:00
image . SetActivityStreamsHeight ( height )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example79Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "This is all there is." )
example79Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
icon := NewActivityStreamsIconProperty ( )
2019-02-10 05:56:00 +09:00
icon . AppendActivityStreamsImage ( image )
example79Type . SetActivityStreamsIcon ( icon )
2019-02-08 08:59:10 +09:00
return example79Type
}
const example80 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"content" : "A simple note" ,
"icon" : [
{
"type" : "Image" ,
"summary" : "Note (16x16)" ,
"url" : "http://example.org/note1.png" ,
"width" : 16 ,
"height" : 16
} ,
{
"type" : "Image" ,
"summary" : "Note (32x32)" ,
"url" : "http://example.org/note2.png" ,
"width" : 32 ,
"height" : 32
}
]
} `
2019-02-10 05:56:00 +09:00
func example80Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example80Type := NewActivityStreamsNote ( )
u1 := MustParseURL ( "http://example.org/note1.png" )
u2 := MustParseURL ( "http://example.org/note2.png" )
image1 := NewActivityStreamsImage ( )
summaryImg1 := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryImg1 . AppendXMLSchemaString ( "Note (16x16)" )
image1 . SetActivityStreamsSummary ( summaryImg1 )
2019-02-08 08:59:10 +09:00
imgProp1 := NewActivityStreamsUrlProperty ( )
imgProp1 . AppendIRI ( u1 )
2019-02-10 05:56:00 +09:00
image1 . SetActivityStreamsUrl ( imgProp1 )
2019-02-08 08:59:10 +09:00
width1 := NewActivityStreamsWidthProperty ( )
width1 . Set ( 16 )
2019-02-10 05:56:00 +09:00
image1 . SetActivityStreamsWidth ( width1 )
2019-02-08 08:59:10 +09:00
height1 := NewActivityStreamsHeightProperty ( )
height1 . Set ( 16 )
2019-02-10 05:56:00 +09:00
image1 . SetActivityStreamsHeight ( height1 )
2019-02-08 08:59:10 +09:00
image2 := NewActivityStreamsImage ( )
summaryImg2 := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryImg2 . AppendXMLSchemaString ( "Note (32x32)" )
image2 . SetActivityStreamsSummary ( summaryImg2 )
2019-02-08 08:59:10 +09:00
imgProp2 := NewActivityStreamsUrlProperty ( )
imgProp2 . AppendIRI ( u2 )
2019-02-10 05:56:00 +09:00
image2 . SetActivityStreamsUrl ( imgProp2 )
2019-02-08 08:59:10 +09:00
width2 := NewActivityStreamsWidthProperty ( )
width2 . Set ( 32 )
2019-02-10 05:56:00 +09:00
image2 . SetActivityStreamsWidth ( width2 )
2019-02-08 08:59:10 +09:00
height2 := NewActivityStreamsHeightProperty ( )
height2 . Set ( 32 )
2019-02-10 05:56:00 +09:00
image2 . SetActivityStreamsHeight ( height2 )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example80Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "A simple note" )
example80Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
icon := NewActivityStreamsIconProperty ( )
2019-02-10 05:56:00 +09:00
icon . AppendActivityStreamsImage ( image1 )
icon . AppendActivityStreamsImage ( image2 )
example80Type . SetActivityStreamsIcon ( icon )
2019-02-08 08:59:10 +09:00
return example80Type
}
const example81 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "A simple note" ,
"type" : "Note" ,
"content" : "This is all there is." ,
"image" : {
"type" : "Image" ,
"name" : "A Cat" ,
"url" : "http://example.org/cat.png"
}
} `
2019-02-10 05:56:00 +09:00
func example81Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example81Type := NewActivityStreamsNote ( )
u := MustParseURL ( "http://example.org/cat.png" )
image := NewActivityStreamsImage ( )
imageName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
imageName . AppendXMLSchemaString ( "A Cat" )
image . SetActivityStreamsName ( imageName )
2019-02-08 08:59:10 +09:00
imgProp := NewActivityStreamsUrlProperty ( )
imgProp . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
image . SetActivityStreamsUrl ( imgProp )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A simple note" )
example81Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "This is all there is." )
example81Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
imageProp := NewActivityStreamsImageProperty ( )
2019-02-10 05:56:00 +09:00
imageProp . AppendActivityStreamsImage ( image )
example81Type . SetActivityStreamsImage ( imageProp )
2019-02-08 08:59:10 +09:00
return example81Type
}
const example82 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "A simple note" ,
"type" : "Note" ,
"content" : "This is all there is." ,
"image" : [
{
"type" : "Image" ,
"name" : "Cat 1" ,
"url" : "http://example.org/cat1.png"
} ,
{
"type" : "Image" ,
"name" : "Cat 2" ,
"url" : "http://example.org/cat2.png"
}
]
} `
2019-02-10 05:56:00 +09:00
func example82Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example82Type := NewActivityStreamsNote ( )
u1 := MustParseURL ( "http://example.org/cat1.png" )
u2 := MustParseURL ( "http://example.org/cat2.png" )
image1 := NewActivityStreamsImage ( )
image1Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
image1Name . AppendXMLSchemaString ( "Cat 1" )
image1 . SetActivityStreamsName ( image1Name )
2019-02-08 08:59:10 +09:00
imgProp1 := NewActivityStreamsUrlProperty ( )
imgProp1 . AppendIRI ( u1 )
2019-02-10 05:56:00 +09:00
image1 . SetActivityStreamsUrl ( imgProp1 )
2019-02-08 08:59:10 +09:00
image2 := NewActivityStreamsImage ( )
image2Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
image2Name . AppendXMLSchemaString ( "Cat 2" )
image2 . SetActivityStreamsName ( image2Name )
2019-02-08 08:59:10 +09:00
imgProp2 := NewActivityStreamsUrlProperty ( )
imgProp2 . AppendIRI ( u2 )
2019-02-10 05:56:00 +09:00
image2 . SetActivityStreamsUrl ( imgProp2 )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A simple note" )
example82Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "This is all there is." )
example82Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
imageProp := NewActivityStreamsImageProperty ( )
2019-02-10 05:56:00 +09:00
imageProp . AppendActivityStreamsImage ( image1 )
imageProp . AppendActivityStreamsImage ( image2 )
example82Type . SetActivityStreamsImage ( imageProp )
2019-02-08 08:59:10 +09:00
return example82Type
}
const example83 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"content" : "This is all there is." ,
"inReplyTo" : {
"summary" : "Previous note" ,
"type" : "Note" ,
"content" : "What else is there?"
}
} `
2019-02-10 05:56:00 +09:00
func example83Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example83Type := NewActivityStreamsNote ( )
note := NewActivityStreamsNote ( )
summaryNote := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryNote . AppendXMLSchemaString ( "Previous note" )
note . SetActivityStreamsSummary ( summaryNote )
2019-02-08 08:59:10 +09:00
contentNote := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
contentNote . AppendXMLSchemaString ( "What else is there?" )
note . SetActivityStreamsContent ( contentNote )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example83Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "This is all there is." )
example83Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
inReplyTo := NewActivityStreamsInReplyToProperty ( )
2019-02-10 05:56:00 +09:00
inReplyTo . AppendActivityStreamsNote ( note )
example83Type . SetActivityStreamsInReplyTo ( inReplyTo )
2019-02-08 08:59:10 +09:00
return example83Type
}
const example84 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"content" : "This is all there is." ,
"inReplyTo" : "http://example.org/posts/1"
} `
2019-02-10 05:56:00 +09:00
func example84Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example84Type := NewActivityStreamsNote ( )
u := MustParseURL ( "http://example.org/posts/1" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example84Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "This is all there is." )
example84Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
inReplyTo := NewActivityStreamsInReplyToProperty ( )
inReplyTo . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
example84Type . SetActivityStreamsInReplyTo ( inReplyTo )
2019-02-08 08:59:10 +09:00
return example84Type
}
const example85 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally listened to a piece of music on the Acme Music Service" ,
"type" : "Listen" ,
"actor" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"object" : "http://example.org/foo.mp3" ,
"instrument" : {
"type" : "Service" ,
"name" : "Acme Music Service"
}
} `
2019-02-10 05:56:00 +09:00
func example85Type ( ) vocab . ActivityStreamsListen {
2019-02-08 08:59:10 +09:00
example85Type := NewActivityStreamsListen ( )
u := MustParseURL ( "http://example.org/foo.mp3" )
actor := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
actor . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
service := NewActivityStreamsService ( )
serviceName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
serviceName . AppendXMLSchemaString ( "Acme Music Service" )
service . SetActivityStreamsName ( serviceName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally listened to a piece of music on the Acme Music Service" )
example85Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
rootActor := NewActivityStreamsActorProperty ( )
2019-02-10 05:56:00 +09:00
rootActor . AppendActivityStreamsPerson ( actor )
example85Type . SetActivityStreamsActor ( rootActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
example85Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
inst := NewActivityStreamsInstrumentProperty ( )
2019-02-10 05:56:00 +09:00
inst . AppendActivityStreamsService ( service )
example85Type . SetActivityStreamsInstrument ( inst )
2019-02-08 08:59:10 +09:00
return example85Type
}
const example86 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A collection" ,
"type" : "Collection" ,
"totalItems" : 3 ,
"last" : "http://example.org/collection?page=1"
} `
2019-02-10 05:56:00 +09:00
func example86Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example86Type := NewActivityStreamsCollection ( )
u := MustParseURL ( "http://example.org/collection?page=1" )
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 3 )
2019-02-10 05:56:00 +09:00
example86Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A collection" )
example86Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
last := NewActivityStreamsLastProperty ( )
last . SetIRI ( u )
2019-02-10 05:56:00 +09:00
example86Type . SetActivityStreamsLast ( last )
2019-02-08 08:59:10 +09:00
return example86Type
}
const example87 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A collection" ,
"type" : "Collection" ,
"totalItems" : 5 ,
"last" : {
"type" : "Link" ,
"summary" : "Last Page" ,
"href" : "http://example.org/collection?page=1"
}
} `
2019-02-10 05:56:00 +09:00
func example87Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example87Type := NewActivityStreamsCollection ( )
u := MustParseURL ( "http://example.org/collection?page=1" )
link := NewActivityStreamsLink ( )
summaryLink := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryLink . AppendXMLSchemaString ( "Last Page" )
link . SetActivityStreamsSummary ( summaryLink )
2019-02-08 08:59:10 +09:00
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A collection" )
example87Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 5 )
2019-02-10 05:56:00 +09:00
example87Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
last := NewActivityStreamsLastProperty ( )
2019-02-10 05:56:00 +09:00
last . SetActivityStreamsLink ( link )
example87Type . SetActivityStreamsLast ( last )
2019-02-08 08:59:10 +09:00
return example87Type
}
const example88 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Person" ,
"name" : "Sally" ,
"location" : {
"name" : "Over the Arabian Sea, east of Socotra Island Nature Sanctuary" ,
"type" : "Place" ,
"longitude" : 12.34 ,
"latitude" : 56.78 ,
"altitude" : 90 ,
"units" : "m"
}
} `
2019-02-10 05:56:00 +09:00
func example88Type ( ) vocab . ActivityStreamsPerson {
2019-02-08 08:59:10 +09:00
example88Type := NewActivityStreamsPerson ( )
place := NewActivityStreamsPlace ( )
placeName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
placeName . AppendXMLSchemaString ( "Over the Arabian Sea, east of Socotra Island Nature Sanctuary" )
place . SetActivityStreamsName ( placeName )
2019-02-08 08:59:10 +09:00
lon := NewActivityStreamsLongitudeProperty ( )
lon . Set ( 12.34 )
2019-02-10 05:56:00 +09:00
place . SetActivityStreamsLongitude ( lon )
2019-02-08 08:59:10 +09:00
lat := NewActivityStreamsLatitudeProperty ( )
lat . Set ( 56.78 )
2019-02-10 05:56:00 +09:00
place . SetActivityStreamsLatitude ( lat )
2019-02-08 08:59:10 +09:00
alt := NewActivityStreamsAltitudeProperty ( )
alt . Set ( 90 )
2019-02-10 05:56:00 +09:00
place . SetActivityStreamsAltitude ( alt )
2019-02-08 08:59:10 +09:00
units := NewActivityStreamsUnitsProperty ( )
2019-02-10 05:56:00 +09:00
units . SetXMLSchemaString ( "m" )
place . SetActivityStreamsUnits ( units )
2019-02-08 08:59:10 +09:00
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
example88Type . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
location := NewActivityStreamsLocationProperty ( )
2019-02-10 05:56:00 +09:00
location . AppendActivityStreamsPlace ( place )
example88Type . SetActivityStreamsLocation ( location )
2019-02-08 08:59:10 +09:00
return example88Type
}
const example89 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's notes" ,
"type" : "Collection" ,
"totalItems" : 2 ,
"items" : [
{
"type" : "Note" ,
"name" : "Reminder for Going-Away Party"
} ,
{
"type" : "Note" ,
"name" : "Meeting 2016-11-17"
}
]
} `
2019-02-10 05:56:00 +09:00
func example89Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example89Type := NewActivityStreamsCollection ( )
note1 := NewActivityStreamsNote ( )
note1Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note1Name . AppendXMLSchemaString ( "Reminder for Going-Away Party" )
note1 . SetActivityStreamsName ( note1Name )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
note2Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note2Name . AppendXMLSchemaString ( "Meeting 2016-11-17" )
note2 . SetActivityStreamsName ( note2Name )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's notes" )
example89Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 2 )
2019-02-10 05:56:00 +09:00
example89Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsNote ( note1 )
items . AppendActivityStreamsNote ( note2 )
example89Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example89Type
}
const example90 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's notes" ,
"type" : "OrderedCollection" ,
"totalItems" : 2 ,
"orderedItems" : [
{
"type" : "Note" ,
"name" : "Meeting 2016-11-17"
} ,
{
"type" : "Note" ,
"name" : "Reminder for Going-Away Party"
}
]
} `
2019-02-10 05:56:00 +09:00
func example90Type ( ) vocab . ActivityStreamsOrderedCollection {
2019-02-08 08:59:10 +09:00
example90Type := NewActivityStreamsOrderedCollection ( )
note1 := NewActivityStreamsNote ( )
note1Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note1Name . AppendXMLSchemaString ( "Meeting 2016-11-17" )
note1 . SetActivityStreamsName ( note1Name )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
note2Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note2Name . AppendXMLSchemaString ( "Reminder for Going-Away Party" )
note2 . SetActivityStreamsName ( note2Name )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's notes" )
example90Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 2 )
2019-02-10 05:56:00 +09:00
example90Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
orderedItems := NewActivityStreamsOrderedItemsProperty ( )
2019-02-10 05:56:00 +09:00
orderedItems . AppendActivityStreamsNote ( note1 )
orderedItems . AppendActivityStreamsNote ( note2 )
example90Type . SetActivityStreamsOrderedItems ( orderedItems )
2019-02-08 08:59:10 +09:00
return example90Type
}
const example91 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Question" ,
"name" : "What is the answer?" ,
"oneOf" : [
{
"type" : "Note" ,
"name" : "Option A"
} ,
{
"type" : "Note" ,
"name" : "Option B"
}
]
} `
2019-02-10 05:56:00 +09:00
func example91Type ( ) vocab . ActivityStreamsQuestion {
2019-02-08 08:59:10 +09:00
example91Type := NewActivityStreamsQuestion ( )
note1 := NewActivityStreamsNote ( )
note1Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note1Name . AppendXMLSchemaString ( "Option A" )
note1 . SetActivityStreamsName ( note1Name )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
note2Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note2Name . AppendXMLSchemaString ( "Option B" )
note2 . SetActivityStreamsName ( note2Name )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "What is the answer?" )
example91Type . SetActivityStreamsName ( name )
2019-02-09 21:27:04 +09:00
oneOf := NewActivityStreamsOneOfProperty ( )
2019-02-10 05:56:00 +09:00
oneOf . AppendActivityStreamsNote ( note1 )
oneOf . AppendActivityStreamsNote ( note2 )
example91Type . SetActivityStreamsOneOf ( oneOf )
2019-02-08 08:59:10 +09:00
return example91Type
}
const example92 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Question" ,
"name" : "What is the answer?" ,
"anyOf" : [
{
"type" : "Note" ,
"name" : "Option A"
} ,
{
"type" : "Note" ,
"name" : "Option B"
}
]
} `
2019-02-10 05:56:00 +09:00
func example92Type ( ) vocab . ActivityStreamsQuestion {
2019-02-08 08:59:10 +09:00
example92Type := NewActivityStreamsQuestion ( )
note1 := NewActivityStreamsNote ( )
note1Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note1Name . AppendXMLSchemaString ( "Option A" )
note1 . SetActivityStreamsName ( note1Name )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
note2Name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
note2Name . AppendXMLSchemaString ( "Option B" )
note2 . SetActivityStreamsName ( note2Name )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "What is the answer?" )
example92Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
anyOf := NewActivityStreamsAnyOfProperty ( )
2019-02-10 05:56:00 +09:00
anyOf . AppendActivityStreamsNote ( note1 )
anyOf . AppendActivityStreamsNote ( note2 )
example92Type . SetActivityStreamsAnyOf ( anyOf )
2019-02-08 08:59:10 +09:00
return example92Type
}
const example93 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Question" ,
"name" : "What is the answer?" ,
"closed" : "2016-05-10T00:00:00Z"
} `
2019-02-10 05:56:00 +09:00
func example93Type ( ) vocab . ActivityStreamsQuestion {
2019-02-08 08:59:10 +09:00
example93Type := NewActivityStreamsQuestion ( )
t , err := time . Parse ( time . RFC3339 , "2016-05-10T00:00:00Z" )
if err != nil {
panic ( err )
}
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "What is the answer?" )
example93Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
closed := NewActivityStreamsClosedProperty ( )
2019-02-10 05:56:00 +09:00
closed . AppendXMLSchemaDateTime ( t )
example93Type . SetActivityStreamsClosed ( closed )
2019-02-08 08:59:10 +09:00
return example93Type
}
const example94 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally moved a post from List A to List B" ,
"type" : "Move" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1" ,
"target" : {
"type" : "Collection" ,
"name" : "List B"
} ,
"origin" : {
"type" : "Collection" ,
"name" : "List A"
}
} `
2019-02-10 05:56:00 +09:00
func example94Type ( ) vocab . ActivityStreamsMove {
2019-02-08 08:59:10 +09:00
example94Type := NewActivityStreamsMove ( )
a := MustParseURL ( "http://sally.example.org" )
o := MustParseURL ( "http://example.org/posts/1" )
target := NewActivityStreamsCollection ( )
targetName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
targetName . AppendXMLSchemaString ( "List B" )
target . SetActivityStreamsName ( targetName )
2019-02-08 08:59:10 +09:00
origin := NewActivityStreamsCollection ( )
originName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
originName . AppendXMLSchemaString ( "List A" )
origin . SetActivityStreamsName ( originName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally moved a post from List A to List B" )
example94Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example94Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example94Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsCollection ( target )
example94Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
originProp := NewActivityStreamsOriginProperty ( )
2019-02-10 05:56:00 +09:00
originProp . AppendActivityStreamsCollection ( origin )
example94Type . SetActivityStreamsOrigin ( originProp )
2019-02-08 08:59:10 +09:00
return example94Type
}
const example95 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Page 2 of Sally's blog posts" ,
"type" : "CollectionPage" ,
"next" : "http://example.org/collection?page=2" ,
"items" : [
"http://example.org/posts/1" ,
"http://example.org/posts/2" ,
"http://example.org/posts/3"
]
} `
2019-02-10 05:56:00 +09:00
func example95Type ( ) vocab . ActivityStreamsCollectionPage {
2019-02-08 08:59:10 +09:00
example95Type := NewActivityStreamsCollectionPage ( )
i := MustParseURL ( "http://example.org/collection?page=2" )
u1 := MustParseURL ( "http://example.org/posts/1" )
u2 := MustParseURL ( "http://example.org/posts/2" )
u3 := MustParseURL ( "http://example.org/posts/3" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Page 2 of Sally's blog posts" )
example95Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
next := NewActivityStreamsNextProperty ( )
next . SetIRI ( i )
2019-02-10 05:56:00 +09:00
example95Type . SetActivityStreamsNext ( next )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
items . AppendIRI ( u1 )
items . AppendIRI ( u2 )
items . AppendIRI ( u3 )
2019-02-10 05:56:00 +09:00
example95Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example95Type
}
const example96 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Page 2 of Sally's blog posts" ,
"type" : "CollectionPage" ,
"next" : {
"type" : "Link" ,
"name" : "Next Page" ,
"href" : "http://example.org/collection?page=2"
} ,
"items" : [
"http://example.org/posts/1" ,
"http://example.org/posts/2" ,
"http://example.org/posts/3"
]
} `
2019-02-10 05:56:00 +09:00
func example96Type ( ) vocab . ActivityStreamsCollectionPage {
2019-02-08 08:59:10 +09:00
example96Type := NewActivityStreamsCollectionPage ( )
href := MustParseURL ( "http://example.org/collection?page=2" )
u1 := MustParseURL ( "http://example.org/posts/1" )
u2 := MustParseURL ( "http://example.org/posts/2" )
u3 := MustParseURL ( "http://example.org/posts/3" )
link := NewActivityStreamsLink ( )
linkName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
linkName . AppendXMLSchemaString ( "Next Page" )
link . SetActivityStreamsName ( linkName )
2019-02-08 08:59:10 +09:00
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( href )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Page 2 of Sally's blog posts" )
example96Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
next := NewActivityStreamsNextProperty ( )
2019-02-10 05:56:00 +09:00
next . SetActivityStreamsLink ( link )
example96Type . SetActivityStreamsNext ( next )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
items . AppendIRI ( u1 )
items . AppendIRI ( u2 )
items . AppendIRI ( u3 )
2019-02-10 05:56:00 +09:00
example96Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example96Type
}
const example97 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally liked a post" ,
"type" : "Like" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1"
} `
2019-02-10 05:56:00 +09:00
func example97Type ( ) vocab . ActivityStreamsLike {
2019-02-08 08:59:10 +09:00
example97Type := NewActivityStreamsLike ( )
a := MustParseURL ( "http://sally.example.org" )
o := MustParseURL ( "http://example.org/posts/1" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally liked a post" )
example97Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example97Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example97Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example97Type
}
const example98 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Like" ,
"actor" : "http://sally.example.org" ,
"object" : {
"type" : "Note" ,
"content" : "A simple note"
}
} `
2019-02-10 05:56:00 +09:00
func example98Type ( ) vocab . ActivityStreamsLike {
2019-02-08 08:59:10 +09:00
example98Type := NewActivityStreamsLike ( )
a := MustParseURL ( "http://sally.example.org" )
note := NewActivityStreamsNote ( )
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "A simple note" )
note . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example98Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsNote ( note )
example98Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example98Type
}
const example99 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally liked a note" ,
"type" : "Like" ,
"actor" : "http://sally.example.org" ,
"object" : [
"http://example.org/posts/1" ,
{
"type" : "Note" ,
"summary" : "A simple note" ,
"content" : "That is a tree."
}
]
} `
2019-02-10 05:56:00 +09:00
func example99Type ( ) vocab . ActivityStreamsLike {
2019-02-08 08:59:10 +09:00
example99Type := NewActivityStreamsLike ( )
a := MustParseURL ( "http://sally.example.org" )
o := MustParseURL ( "http://example.org/posts/1" )
note := NewActivityStreamsNote ( )
summaryNote := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryNote . AppendXMLSchemaString ( "A simple note" )
note . SetActivityStreamsSummary ( summaryNote )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "That is a tree." )
note . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally liked a note" )
example99Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example99Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsNote ( note )
example99Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example99Type
}
const example100 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Page 1 of Sally's blog posts" ,
"type" : "CollectionPage" ,
"prev" : "http://example.org/collection?page=1" ,
"items" : [
"http://example.org/posts/1" ,
"http://example.org/posts/2" ,
"http://example.org/posts/3"
]
} `
2019-02-10 05:56:00 +09:00
func example100Type ( ) vocab . ActivityStreamsCollectionPage {
2019-02-08 08:59:10 +09:00
example100Type := NewActivityStreamsCollectionPage ( )
p := MustParseURL ( "http://example.org/collection?page=1" )
u1 := MustParseURL ( "http://example.org/posts/1" )
u2 := MustParseURL ( "http://example.org/posts/2" )
u3 := MustParseURL ( "http://example.org/posts/3" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Page 1 of Sally's blog posts" )
example100Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
prev := NewActivityStreamsPrevProperty ( )
prev . SetIRI ( p )
2019-02-10 05:56:00 +09:00
example100Type . SetActivityStreamsPrev ( prev )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
items . AppendIRI ( u1 )
items . AppendIRI ( u2 )
items . AppendIRI ( u3 )
2019-02-10 05:56:00 +09:00
example100Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example100Type
}
const example101 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Page 1 of Sally's blog posts" ,
"type" : "CollectionPage" ,
"prev" : {
"type" : "Link" ,
"name" : "Previous Page" ,
"href" : "http://example.org/collection?page=1"
} ,
"items" : [
"http://example.org/posts/1" ,
"http://example.org/posts/2" ,
"http://example.org/posts/3"
]
} `
2019-02-10 05:56:00 +09:00
func example101Type ( ) vocab . ActivityStreamsCollectionPage {
2019-02-08 08:59:10 +09:00
example101Type := NewActivityStreamsCollectionPage ( )
p := MustParseURL ( "http://example.org/collection?page=1" )
u1 := MustParseURL ( "http://example.org/posts/1" )
u2 := MustParseURL ( "http://example.org/posts/2" )
u3 := MustParseURL ( "http://example.org/posts/3" )
link := NewActivityStreamsLink ( )
linkName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
linkName . AppendXMLSchemaString ( "Previous Page" )
link . SetActivityStreamsName ( linkName )
2019-02-08 08:59:10 +09:00
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( p )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Page 1 of Sally's blog posts" )
example101Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
prev := NewActivityStreamsPrevProperty ( )
2019-02-10 05:56:00 +09:00
prev . SetActivityStreamsLink ( link )
example101Type . SetActivityStreamsPrev ( prev )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
items . AppendIRI ( u1 )
items . AppendIRI ( u2 )
items . AppendIRI ( u3 )
2019-02-10 05:56:00 +09:00
example101Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example101Type
}
// NOTE: The 'url' field has added the 'type' property
const example102 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Video" ,
"name" : "Cool New Movie" ,
"duration" : "PT2H30M" ,
"preview" : {
"type" : "Video" ,
"name" : "Trailer" ,
"duration" : "PT1M" ,
"url" : {
"type" : "Link" ,
"href" : "http://example.org/trailer.mkv" ,
"mediaType" : "video/mkv"
}
}
} `
2019-02-10 05:56:00 +09:00
func example102Type ( ) vocab . ActivityStreamsVideo {
2019-02-08 08:59:10 +09:00
example102Type := NewActivityStreamsVideo ( )
u := MustParseURL ( "http://example.org/trailer.mkv" )
link := NewActivityStreamsLink ( )
mediaType := NewActivityStreamsMediaTypeProperty ( )
mediaType . Set ( "video/mkv" )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsMediaType ( mediaType )
2019-02-08 08:59:10 +09:00
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
video := NewActivityStreamsVideo ( )
videoName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
videoName . AppendXMLSchemaString ( "Trailer" )
video . SetActivityStreamsName ( videoName )
2019-02-08 08:59:10 +09:00
durVideo := NewActivityStreamsDurationProperty ( )
durVideo . Set ( time . Minute )
2019-02-10 05:56:00 +09:00
video . SetActivityStreamsDuration ( durVideo )
2019-02-08 08:59:10 +09:00
urlProperty := NewActivityStreamsUrlProperty ( )
2019-02-10 05:56:00 +09:00
urlProperty . AppendActivityStreamsLink ( link )
video . SetActivityStreamsUrl ( urlProperty )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Cool New Movie" )
example102Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
dur := NewActivityStreamsDurationProperty ( )
dur . Set ( time . Hour * 2 + time . Minute * 30 )
2019-02-10 05:56:00 +09:00
example102Type . SetActivityStreamsDuration ( dur )
2019-02-08 08:59:10 +09:00
preview := NewActivityStreamsPreviewProperty ( )
2019-02-10 05:56:00 +09:00
preview . AppendActivityStreamsVideo ( video )
example102Type . SetActivityStreamsPreview ( preview )
2019-02-08 08:59:10 +09:00
return example102Type
}
const example103 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally checked that her flight was on time" ,
"type" : [ "Activity" , "http://www.verbs.example/Check" ] ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/flights/1" ,
"result" : {
"type" : "http://www.types.example/flightstatus" ,
"name" : "On Time"
}
} `
var example103Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
2019-02-09 21:27:04 +09:00
m [ "type" ] = [ ] interface { } {
m [ "type" ] ,
"http://www.verbs.example/Check" ,
}
2019-02-08 08:59:10 +09:00
m [ "result" ] = map [ string ] interface { } {
"type" : "http://www.types.example/flightstatus" ,
"name" : "On Time" ,
}
return m
}
2019-02-10 05:56:00 +09:00
func example103Type ( ) vocab . ActivityStreamsActivity {
2019-02-08 08:59:10 +09:00
example103Type := NewActivityStreamsActivity ( )
o := MustParseURL ( "http://example.org/flights/1" )
a := MustParseURL ( "http://sally.example.org" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally checked that her flight was on time" )
example103Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example103Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example103Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
return example103Type
}
// NOTE: Changed to not be an array value for "items" to keep in line with other examples in spec!
const example104 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"id" : "http://www.test.example/notes/1" ,
"content" : "I am fine." ,
"replies" : {
"type" : "Collection" ,
"totalItems" : 1 ,
"items" : {
"summary" : "A response to the note" ,
"type" : "Note" ,
"content" : "I am glad to hear it." ,
"inReplyTo" : "http://www.test.example/notes/1"
}
}
} `
2019-02-10 05:56:00 +09:00
func example104Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example104Type := NewActivityStreamsNote ( )
i := MustParseURL ( "http://www.test.example/notes/1" )
note := NewActivityStreamsNote ( )
summaryNote := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryNote . AppendXMLSchemaString ( "A response to the note" )
note . SetActivityStreamsSummary ( summaryNote )
2019-02-08 08:59:10 +09:00
contentNote := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
contentNote . AppendXMLSchemaString ( "I am glad to hear it." )
note . SetActivityStreamsContent ( contentNote )
2019-02-08 08:59:10 +09:00
inReplyTo := NewActivityStreamsInReplyToProperty ( )
inReplyTo . AppendIRI ( i )
2019-02-10 05:56:00 +09:00
note . SetActivityStreamsInReplyTo ( inReplyTo )
2019-02-08 08:59:10 +09:00
replies := NewActivityStreamsCollection ( )
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 1 )
2019-02-10 05:56:00 +09:00
replies . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsNote ( note )
replies . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example104Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://www.test.example/notes/1" ) )
2019-02-10 05:56:00 +09:00
example104Type . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "I am fine." )
example104Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
reply := NewActivityStreamsRepliesProperty ( )
2019-02-10 05:56:00 +09:00
reply . SetActivityStreamsCollection ( replies )
example104Type . SetActivityStreamsReplies ( reply )
2019-02-08 08:59:10 +09:00
return example104Type
}
// NOTE: Changed to not be an array value for "tag" to keep in line with other examples in spec!
const example105 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Image" ,
"summary" : "Picture of Sally" ,
"url" : "http://example.org/sally.jpg" ,
"tag" : {
"type" : "Person" ,
"id" : "http://sally.example.org" ,
"name" : "Sally"
}
} `
2019-02-10 05:56:00 +09:00
func example105Type ( ) vocab . ActivityStreamsImage {
2019-02-08 08:59:10 +09:00
example105Type := NewActivityStreamsImage ( )
u := MustParseURL ( "http://example.org/sally.jpg" )
person := NewActivityStreamsPerson ( )
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://sally.example.org" ) )
2019-02-10 05:56:00 +09:00
person . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Picture of Sally" )
example105Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
example105Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
tag := NewActivityStreamsTagProperty ( )
2019-02-10 05:56:00 +09:00
tag . AppendActivityStreamsPerson ( person )
example105Type . SetActivityStreamsTag ( tag )
2019-02-08 08:59:10 +09:00
return example105Type
}
const example106 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally offered the post to John" ,
"type" : "Offer" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1" ,
"target" : "http://john.example.org"
} `
2019-02-10 05:56:00 +09:00
func example106Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example106Type := NewActivityStreamsOffer ( )
a := MustParseURL ( "http://sally.example.org" )
o := MustParseURL ( "http://example.org/posts/1" )
t := MustParseURL ( "http://john.example.org" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally offered the post to John" )
example106Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example106Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example106Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsTargetProperty ( )
target . AppendIRI ( t )
2019-02-10 05:56:00 +09:00
example106Type . SetActivityStreamsTarget ( target )
2019-02-08 08:59:10 +09:00
return example106Type
}
const example107 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally offered the post to John" ,
"type" : "Offer" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1" ,
"target" : {
"type" : "Person" ,
"name" : "John"
}
} `
2019-02-10 05:56:00 +09:00
func example107Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example107Type := NewActivityStreamsOffer ( )
a := MustParseURL ( "http://sally.example.org" )
o := MustParseURL ( "http://example.org/posts/1" )
person := NewActivityStreamsPerson ( )
personName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
personName . AppendXMLSchemaString ( "John" )
person . SetActivityStreamsName ( personName )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally offered the post to John" )
example107Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example107Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example107Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsPerson ( person )
example107Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
return example107Type
}
// NOTE: Changed to not be an array value for "to" to keep in line with other examples in spec!
const example108 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally offered the post to John" ,
"type" : "Offer" ,
"actor" : "http://sally.example.org" ,
"object" : "http://example.org/posts/1" ,
"target" : "http://john.example.org" ,
"to" : "http://joe.example.org"
} `
2019-02-10 05:56:00 +09:00
func example108Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example108Type := NewActivityStreamsOffer ( )
a := MustParseURL ( "http://sally.example.org" )
o := MustParseURL ( "http://example.org/posts/1" )
t := MustParseURL ( "http://john.example.org" )
z := MustParseURL ( "http://joe.example.org" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally offered the post to John" )
example108Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
example108Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
example108Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsTargetProperty ( )
target . AppendIRI ( t )
2019-02-10 05:56:00 +09:00
example108Type . SetActivityStreamsTarget ( target )
2019-02-08 08:59:10 +09:00
to := NewActivityStreamsToProperty ( )
to . AppendIRI ( z )
2019-02-10 05:56:00 +09:00
example108Type . SetActivityStreamsTo ( to )
2019-02-08 08:59:10 +09:00
return example108Type
}
const example109 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Document" ,
"name" : "4Q Sales Forecast" ,
"url" : "http://example.org/4q-sales-forecast.pdf"
} `
2019-02-10 05:56:00 +09:00
func example109Type ( ) vocab . ActivityStreamsDocument {
2019-02-08 08:59:10 +09:00
example109Type := NewActivityStreamsDocument ( )
u := MustParseURL ( "http://example.org/4q-sales-forecast.pdf" )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "4Q Sales Forecast" )
example109Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
example109Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
return example109Type
}
const example110 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Document" ,
"name" : "4Q Sales Forecast" ,
"url" : {
"type" : "Link" ,
"href" : "http://example.org/4q-sales-forecast.pdf"
}
} `
2019-02-10 05:56:00 +09:00
func example110Type ( ) vocab . ActivityStreamsDocument {
2019-02-08 08:59:10 +09:00
example110Type := NewActivityStreamsDocument ( )
u := MustParseURL ( "http://example.org/4q-sales-forecast.pdf" )
link := NewActivityStreamsLink ( )
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
link . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "4Q Sales Forecast" )
example110Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
urlProperty := NewActivityStreamsUrlProperty ( )
2019-02-10 05:56:00 +09:00
urlProperty . AppendActivityStreamsLink ( link )
example110Type . SetActivityStreamsUrl ( urlProperty )
2019-02-08 08:59:10 +09:00
return example110Type
}
const example111 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Document" ,
"name" : "4Q Sales Forecast" ,
"url" : [
{
"type" : "Link" ,
"href" : "http://example.org/4q-sales-forecast.pdf" ,
"mediaType" : "application/pdf"
} ,
{
"type" : "Link" ,
"href" : "http://example.org/4q-sales-forecast.html" ,
"mediaType" : "text/html"
}
]
} `
2019-02-10 05:56:00 +09:00
func example111Type ( ) vocab . ActivityStreamsDocument {
2019-02-08 08:59:10 +09:00
example111Type := NewActivityStreamsDocument ( )
u1 := MustParseURL ( "http://example.org/4q-sales-forecast.pdf" )
u2 := MustParseURL ( "http://example.org/4q-sales-forecast.html" )
link1 := NewActivityStreamsLink ( )
hrefLink1 := NewActivityStreamsHrefProperty ( )
hrefLink1 . Set ( u1 )
2019-02-10 05:56:00 +09:00
link1 . SetActivityStreamsHref ( hrefLink1 )
2019-02-08 08:59:10 +09:00
mediaType1 := NewActivityStreamsMediaTypeProperty ( )
mediaType1 . Set ( "application/pdf" )
2019-02-10 05:56:00 +09:00
link1 . SetActivityStreamsMediaType ( mediaType1 )
2019-02-08 08:59:10 +09:00
link2 := NewActivityStreamsLink ( )
hrefLink2 := NewActivityStreamsHrefProperty ( )
hrefLink2 . Set ( u2 )
2019-02-10 05:56:00 +09:00
link2 . SetActivityStreamsHref ( hrefLink2 )
2019-02-08 08:59:10 +09:00
mediaType2 := NewActivityStreamsMediaTypeProperty ( )
mediaType2 . Set ( "text/html" )
2019-02-10 05:56:00 +09:00
link2 . SetActivityStreamsMediaType ( mediaType2 )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "4Q Sales Forecast" )
example111Type . SetActivityStreamsName ( name )
2019-02-09 21:27:04 +09:00
urlProperty := NewActivityStreamsUrlProperty ( )
2019-02-10 05:56:00 +09:00
urlProperty . AppendActivityStreamsLink ( link1 )
urlProperty . AppendActivityStreamsLink ( link2 )
example111Type . SetActivityStreamsUrl ( urlProperty )
2019-02-08 08:59:10 +09:00
return example111Type
}
const example112 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "Liu Gu Lu Cun, Pingdu, Qingdao, Shandong, China" ,
"type" : "Place" ,
"latitude" : 36.75 ,
"longitude" : 119.7667 ,
"accuracy" : 94.5
} `
2019-02-10 05:56:00 +09:00
func example112Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example112Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Liu Gu Lu Cun, Pingdu, Qingdao, Shandong, China" )
example112Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
lat := NewActivityStreamsLatitudeProperty ( )
lat . Set ( 36.75 )
2019-02-10 05:56:00 +09:00
example112Type . SetActivityStreamsLatitude ( lat )
2019-02-08 08:59:10 +09:00
lon := NewActivityStreamsLongitudeProperty ( )
lon . Set ( 119.7667 )
2019-02-10 05:56:00 +09:00
example112Type . SetActivityStreamsLongitude ( lon )
2019-02-08 08:59:10 +09:00
acc := NewActivityStreamsAccuracyProperty ( )
acc . Set ( 94.5 )
2019-02-10 05:56:00 +09:00
example112Type . SetActivityStreamsAccuracy ( acc )
2019-02-08 08:59:10 +09:00
return example112Type
}
const example113 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Place" ,
"name" : "Fresno Area" ,
"altitude" : 15.0 ,
"latitude" : 36.75 ,
"longitude" : 119.7667 ,
"units" : "miles"
} `
2019-02-10 05:56:00 +09:00
func example113Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example113Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Fresno Area" )
example113Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
alt := NewActivityStreamsAltitudeProperty ( )
alt . Set ( 15.0 )
2019-02-10 05:56:00 +09:00
example113Type . SetActivityStreamsAltitude ( alt )
2019-02-08 08:59:10 +09:00
lat := NewActivityStreamsLatitudeProperty ( )
lat . Set ( 36.75 )
2019-02-10 05:56:00 +09:00
example113Type . SetActivityStreamsLatitude ( lat )
2019-02-08 08:59:10 +09:00
lon := NewActivityStreamsLongitudeProperty ( )
lon . Set ( 119.7667 )
2019-02-10 05:56:00 +09:00
example113Type . SetActivityStreamsLongitude ( lon )
2019-02-08 08:59:10 +09:00
units := NewActivityStreamsUnitsProperty ( )
2019-02-10 05:56:00 +09:00
units . SetXMLSchemaString ( "miles" )
example113Type . SetActivityStreamsUnits ( units )
2019-02-08 08:59:10 +09:00
return example113Type
}
const example114 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"content" : "A <em>simple</em> note"
} `
2019-02-10 05:56:00 +09:00
func example114Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example114Type := NewActivityStreamsNote ( )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example114Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "A <em>simple</em> note" )
example114Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
return example114Type
}
const example115 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"contentMap" : {
"en" : "A <em>simple</em> note" ,
"es" : "Una nota <em>sencilla</em>" ,
"zh-Hans" : "一段<em>简单的</em>笔记"
}
} `
2019-02-10 05:56:00 +09:00
func example115Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example115Type := NewActivityStreamsNote ( )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example115Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendRDFLangString ( map [ string ] string {
2019-02-08 08:59:10 +09:00
"en" : "A <em>simple</em> note" ,
"es" : "Una nota <em>sencilla</em>" ,
"zh-Hans" : "一段<em>简单的</em>笔记" ,
} )
2019-02-10 05:56:00 +09:00
example115Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
return example115Type
}
const example116 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"mediaType" : "text/markdown" ,
"content" : "## A simple note\nA simple markdown ` + " ` note ` " + `"
} `
2019-02-10 05:56:00 +09:00
func example116Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example116Type := NewActivityStreamsNote ( )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example116Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
mediaType := NewActivityStreamsMediaTypeProperty ( )
mediaType . Set ( "text/markdown" )
2019-02-10 05:56:00 +09:00
example116Type . SetActivityStreamsMediaType ( mediaType )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "## A simple note\nA simple markdown `note`" )
example116Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
return example116Type
}
const example117 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Note" ,
"name" : "A simple note"
} `
2019-02-10 05:56:00 +09:00
func example117Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example117Type := NewActivityStreamsNote ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A simple note" )
example117Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example117Type
}
const example118 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Note" ,
"nameMap" : {
"en" : "A simple note" ,
"es" : "Una nota sencilla" ,
"zh-Hans" : "一段简单的笔记"
}
} `
2019-02-10 05:56:00 +09:00
func example118Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example118Type := NewActivityStreamsNote ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendRDFLangString ( map [ string ] string {
2019-02-08 08:59:10 +09:00
"en" : "A simple note" ,
"es" : "Una nota sencilla" ,
"zh-Hans" : "一段简单的笔记" ,
} )
2019-02-10 05:56:00 +09:00
example118Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example118Type
}
const example119 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Video" ,
"name" : "Birds Flying" ,
"url" : "http://example.org/video.mkv" ,
"duration" : "PT2H"
} `
2019-02-10 05:56:00 +09:00
func example119Type ( ) vocab . ActivityStreamsVideo {
2019-02-08 08:59:10 +09:00
example119Type := NewActivityStreamsVideo ( )
u := MustParseURL ( "http://example.org/video.mkv" )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Birds Flying" )
example119Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
example119Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
dur := NewActivityStreamsDurationProperty ( )
dur . Set ( time . Hour * 2 )
2019-02-10 05:56:00 +09:00
example119Type . SetActivityStreamsDuration ( dur )
2019-02-08 08:59:10 +09:00
return example119Type
}
const example120 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Link" ,
"href" : "http://example.org/image.png" ,
"height" : 100 ,
"width" : 100
} `
2019-02-10 05:56:00 +09:00
func example120Type ( ) vocab . ActivityStreamsLink {
2019-02-08 08:59:10 +09:00
example120Type := NewActivityStreamsLink ( )
u := MustParseURL ( "http://example.org/image.png" )
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
example120Type . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
width := NewActivityStreamsWidthProperty ( )
width . Set ( 100 )
2019-02-10 05:56:00 +09:00
example120Type . SetActivityStreamsWidth ( width )
2019-02-08 08:59:10 +09:00
height := NewActivityStreamsHeightProperty ( )
height . Set ( 100 )
2019-02-10 05:56:00 +09:00
example120Type . SetActivityStreamsHeight ( height )
2019-02-08 08:59:10 +09:00
return example120Type
}
const example121 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Link" ,
"href" : "http://example.org/abc" ,
"mediaType" : "text/html" ,
"name" : "Previous"
} `
2019-02-10 05:56:00 +09:00
func example121Type ( ) vocab . ActivityStreamsLink {
2019-02-08 08:59:10 +09:00
example121Type := NewActivityStreamsLink ( )
u := MustParseURL ( "http://example.org/abc" )
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
example121Type . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
mediaType := NewActivityStreamsMediaTypeProperty ( )
mediaType . Set ( "text/html" )
2019-02-10 05:56:00 +09:00
example121Type . SetActivityStreamsMediaType ( mediaType )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Previous" )
example121Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example121Type
}
const example122 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Link" ,
"href" : "http://example.org/abc" ,
"hreflang" : "en" ,
"mediaType" : "text/html" ,
"name" : "Previous"
} `
2019-02-10 05:56:00 +09:00
func example122Type ( ) vocab . ActivityStreamsLink {
2019-02-08 08:59:10 +09:00
example122Type := NewActivityStreamsLink ( )
u := MustParseURL ( "http://example.org/abc" )
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
example122Type . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
mediaType := NewActivityStreamsMediaTypeProperty ( )
mediaType . Set ( "text/html" )
2019-02-10 05:56:00 +09:00
example122Type . SetActivityStreamsMediaType ( mediaType )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Previous" )
example122Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
hreflang := NewActivityStreamsHreflangProperty ( )
hreflang . Set ( "en" )
2019-02-10 05:56:00 +09:00
example122Type . SetActivityStreamsHreflang ( hreflang )
2019-02-08 08:59:10 +09:00
return example122Type
}
const example123 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Page 1 of Sally's notes" ,
"type" : "CollectionPage" ,
"id" : "http://example.org/collection?page=1" ,
"partOf" : "http://example.org/collection" ,
"items" : [
{
"type" : "Note" ,
"name" : "Pizza Toppings to Try"
} ,
{
"type" : "Note" ,
"name" : "Thought about California"
}
]
} `
2019-02-10 05:56:00 +09:00
func example123Type ( ) vocab . ActivityStreamsCollectionPage {
2019-02-08 08:59:10 +09:00
example123Type := NewActivityStreamsCollectionPage ( )
u := MustParseURL ( "http://example.org/collection" )
note1 := NewActivityStreamsNote ( )
name1 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name1 . AppendXMLSchemaString ( "Pizza Toppings to Try" )
note1 . SetActivityStreamsName ( name1 )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
name2 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name2 . AppendXMLSchemaString ( "Thought about California" )
note2 . SetActivityStreamsName ( name2 )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Page 1 of Sally's notes" )
example123Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://example.org/collection?page=1" ) )
2019-02-10 05:56:00 +09:00
example123Type . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
partOf := NewActivityStreamsPartOfProperty ( )
partOf . SetIRI ( u )
2019-02-10 05:56:00 +09:00
example123Type . SetActivityStreamsPartOf ( partOf )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsNote ( note1 )
items . AppendActivityStreamsNote ( note2 )
example123Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example123Type
}
const example124 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Place" ,
"name" : "Fresno Area" ,
"latitude" : 36.75 ,
"longitude" : 119.7667 ,
"radius" : 15 ,
"units" : "miles"
} `
2019-02-10 05:56:00 +09:00
func example124Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example124Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Fresno Area" )
example124Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
lat := NewActivityStreamsLatitudeProperty ( )
lat . Set ( 36.75 )
2019-02-10 05:56:00 +09:00
example124Type . SetActivityStreamsLatitude ( lat )
2019-02-08 08:59:10 +09:00
lon := NewActivityStreamsLongitudeProperty ( )
lon . Set ( 119.7667 )
2019-02-10 05:56:00 +09:00
example124Type . SetActivityStreamsLongitude ( lon )
2019-02-08 08:59:10 +09:00
rad := NewActivityStreamsRadiusProperty ( )
rad . Set ( 15 )
2019-02-10 05:56:00 +09:00
example124Type . SetActivityStreamsRadius ( rad )
2019-02-08 08:59:10 +09:00
units := NewActivityStreamsUnitsProperty ( )
2019-02-10 05:56:00 +09:00
units . SetXMLSchemaString ( "miles" )
example124Type . SetActivityStreamsUnits ( units )
2019-02-08 08:59:10 +09:00
return example124Type
}
const example125 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Place" ,
"name" : "Fresno Area" ,
"latitude" : 36.75 ,
"longitude" : 119.7667 ,
"radius" : 15 ,
"units" : "miles"
} `
2019-02-10 05:56:00 +09:00
func example125Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example125Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Fresno Area" )
example125Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
lat := NewActivityStreamsLatitudeProperty ( )
lat . Set ( 36.75 )
2019-02-10 05:56:00 +09:00
example125Type . SetActivityStreamsLatitude ( lat )
2019-02-08 08:59:10 +09:00
lon := NewActivityStreamsLongitudeProperty ( )
lon . Set ( 119.7667 )
2019-02-10 05:56:00 +09:00
example125Type . SetActivityStreamsLongitude ( lon )
2019-02-08 08:59:10 +09:00
rad := NewActivityStreamsRadiusProperty ( )
rad . Set ( 15 )
2019-02-10 05:56:00 +09:00
example125Type . SetActivityStreamsRadius ( rad )
2019-02-08 08:59:10 +09:00
units := NewActivityStreamsUnitsProperty ( )
2019-02-10 05:56:00 +09:00
units . SetXMLSchemaString ( "miles" )
example125Type . SetActivityStreamsUnits ( units )
2019-02-08 08:59:10 +09:00
return example125Type
}
const example126 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Link" ,
"href" : "http://example.org/abc" ,
"hreflang" : "en" ,
"mediaType" : "text/html" ,
"name" : "Next"
} `
2019-02-10 05:56:00 +09:00
func example126Type ( ) vocab . ActivityStreamsLink {
2019-02-08 08:59:10 +09:00
example126Type := NewActivityStreamsLink ( )
u := MustParseURL ( "http://example.org/abc" )
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
example126Type . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
hreflang := NewActivityStreamsHreflangProperty ( )
hreflang . Set ( "en" )
2019-02-10 05:56:00 +09:00
example126Type . SetActivityStreamsHreflang ( hreflang )
2019-02-08 08:59:10 +09:00
mediaType := NewActivityStreamsMediaTypeProperty ( )
mediaType . Set ( "text/html" )
2019-02-10 05:56:00 +09:00
example126Type . SetActivityStreamsMediaType ( mediaType )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Next" )
example126Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example126Type
}
const example127 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Event" ,
"name" : "Going-Away Party for Jim" ,
"startTime" : "2014-12-31T23:00:00-08:00" ,
"endTime" : "2015-01-01T06:00:00-08:00"
} `
2019-02-10 05:56:00 +09:00
func example127Type ( ) vocab . ActivityStreamsEvent {
2019-02-08 08:59:10 +09:00
example127Type := NewActivityStreamsEvent ( )
t1 , err := time . Parse ( time . RFC3339 , "2014-12-31T23:00:00-08:00" )
if err != nil {
panic ( err )
}
t2 , err := time . Parse ( time . RFC3339 , "2015-01-01T06:00:00-08:00" )
if err != nil {
panic ( err )
}
goingAway := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
goingAway . AppendXMLSchemaString ( "Going-Away Party for Jim" )
example127Type . SetActivityStreamsName ( goingAway )
2019-02-08 08:59:10 +09:00
startTime := NewActivityStreamsStartTimeProperty ( )
startTime . Set ( t1 )
2019-02-10 05:56:00 +09:00
example127Type . SetActivityStreamsStartTime ( startTime )
2019-02-08 08:59:10 +09:00
endTime := NewActivityStreamsEndTimeProperty ( )
endTime . Set ( t2 )
2019-02-10 05:56:00 +09:00
example127Type . SetActivityStreamsEndTime ( endTime )
2019-02-08 08:59:10 +09:00
return example127Type
}
const example128 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "A simple note" ,
"type" : "Note" ,
"content" : "Fish swim." ,
"published" : "2014-12-12T12:12:12Z"
} `
2019-02-10 05:56:00 +09:00
func example128Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example128Type := NewActivityStreamsNote ( )
t , err := time . Parse ( time . RFC3339 , "2014-12-12T12:12:12Z" )
if err != nil {
panic ( err )
}
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple note" )
example128Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "Fish swim." )
example128Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
published := NewActivityStreamsPublishedProperty ( )
published . Set ( t )
2019-02-10 05:56:00 +09:00
example128Type . SetActivityStreamsPublished ( published )
2019-02-08 08:59:10 +09:00
return example128Type
}
const example129 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Event" ,
"name" : "Going-Away Party for Jim" ,
"startTime" : "2014-12-31T23:00:00-08:00" ,
"endTime" : "2015-01-01T06:00:00-08:00"
} `
2019-02-10 05:56:00 +09:00
func example129Type ( ) vocab . ActivityStreamsEvent {
2019-02-08 08:59:10 +09:00
example129Type := NewActivityStreamsEvent ( )
t1 , err := time . Parse ( time . RFC3339 , "2014-12-31T23:00:00-08:00" )
if err != nil {
panic ( err )
}
t2 , err := time . Parse ( time . RFC3339 , "2015-01-01T06:00:00-08:00" )
if err != nil {
panic ( err )
}
goingAway := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
goingAway . AppendXMLSchemaString ( "Going-Away Party for Jim" )
example129Type . SetActivityStreamsName ( goingAway )
2019-02-08 08:59:10 +09:00
startTime := NewActivityStreamsStartTimeProperty ( )
startTime . Set ( t1 )
2019-02-10 05:56:00 +09:00
example129Type . SetActivityStreamsStartTime ( startTime )
2019-02-08 08:59:10 +09:00
endTime := NewActivityStreamsEndTimeProperty ( )
endTime . Set ( t2 )
2019-02-10 05:56:00 +09:00
example129Type . SetActivityStreamsEndTime ( endTime )
2019-02-08 08:59:10 +09:00
return example129Type
}
const example130 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Place" ,
"name" : "Fresno Area" ,
"latitude" : 36.75 ,
"longitude" : 119.7667 ,
"radius" : 15 ,
"units" : "miles"
} `
2019-02-10 05:56:00 +09:00
func example130Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example130Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Fresno Area" )
example130Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
lat := NewActivityStreamsLatitudeProperty ( )
lat . Set ( 36.75 )
2019-02-10 05:56:00 +09:00
example130Type . SetActivityStreamsLatitude ( lat )
2019-02-08 08:59:10 +09:00
lon := NewActivityStreamsLongitudeProperty ( )
lon . Set ( 119.7667 )
2019-02-10 05:56:00 +09:00
example130Type . SetActivityStreamsLongitude ( lon )
2019-02-08 08:59:10 +09:00
rad := NewActivityStreamsRadiusProperty ( )
rad . Set ( 15 )
2019-02-10 05:56:00 +09:00
example130Type . SetActivityStreamsRadius ( rad )
2019-02-08 08:59:10 +09:00
units := NewActivityStreamsUnitsProperty ( )
2019-02-10 05:56:00 +09:00
units . SetXMLSchemaString ( "miles" )
example130Type . SetActivityStreamsUnits ( units )
2019-02-08 08:59:10 +09:00
return example130Type
}
const example131 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Link" ,
"href" : "http://example.org/abc" ,
"hreflang" : "en" ,
"mediaType" : "text/html" ,
"name" : "Preview" ,
"rel" : [ "canonical" , "preview" ]
} `
2019-02-10 05:56:00 +09:00
func example131Type ( ) vocab . ActivityStreamsLink {
2019-02-08 08:59:10 +09:00
example131Type := NewActivityStreamsLink ( )
u := MustParseURL ( "http://example.org/abc" )
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
example131Type . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
hreflang := NewActivityStreamsHreflangProperty ( )
hreflang . Set ( "en" )
2019-02-10 05:56:00 +09:00
example131Type . SetActivityStreamsHreflang ( hreflang )
2019-02-08 08:59:10 +09:00
mediaType := NewActivityStreamsMediaTypeProperty ( )
mediaType . Set ( "text/html" )
2019-02-10 05:56:00 +09:00
example131Type . SetActivityStreamsMediaType ( mediaType )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Preview" )
example131Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
rel := NewActivityStreamsRelProperty ( )
2019-02-10 05:56:00 +09:00
rel . AppendRFCRfc5988 ( "canonical" )
rel . AppendRFCRfc5988 ( "preview" )
example131Type . SetActivityStreamsRel ( rel )
2019-02-08 08:59:10 +09:00
return example131Type
}
const example132 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Page 1 of Sally's notes" ,
"type" : "OrderedCollectionPage" ,
"startIndex" : 0 ,
"orderedItems" : [
{
"type" : "Note" ,
"name" : "Density of Water"
} ,
{
"type" : "Note" ,
"name" : "Air Mattress Idea"
}
]
} `
2019-02-10 05:56:00 +09:00
func example132Type ( ) vocab . ActivityStreamsOrderedCollectionPage {
2019-02-08 08:59:10 +09:00
example132Type := NewActivityStreamsOrderedCollectionPage ( )
note1 := NewActivityStreamsNote ( )
name1 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name1 . AppendXMLSchemaString ( "Density of Water" )
note1 . SetActivityStreamsName ( name1 )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
name2 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name2 . AppendXMLSchemaString ( "Air Mattress Idea" )
note2 . SetActivityStreamsName ( name2 )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Page 1 of Sally's notes" )
example132Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
start := NewActivityStreamsStartIndexProperty ( )
start . Set ( 0 )
2019-02-10 05:56:00 +09:00
example132Type . SetActivityStreamsStartIndex ( start )
2019-02-08 08:59:10 +09:00
orderedItems := NewActivityStreamsOrderedItemsProperty ( )
2019-02-10 05:56:00 +09:00
orderedItems . AppendActivityStreamsNote ( note1 )
orderedItems . AppendActivityStreamsNote ( note2 )
example132Type . SetActivityStreamsOrderedItems ( orderedItems )
2019-02-08 08:59:10 +09:00
return example132Type
}
const example133 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "Cane Sugar Processing" ,
"type" : "Note" ,
"summary" : "A simple <em>note</em>"
} `
2019-02-10 05:56:00 +09:00
func example133Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example133Type := NewActivityStreamsNote ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Cane Sugar Processing" )
example133Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "A simple <em>note</em>" )
example133Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
return example133Type
}
const example134 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "Cane Sugar Processing" ,
"type" : "Note" ,
"summaryMap" : {
"en" : "A simple <em>note</em>" ,
"es" : "Una <em>nota</em> sencilla" ,
"zh-Hans" : "一段<em>简单的</em>笔记"
}
} `
2019-02-10 05:56:00 +09:00
func example134Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example134Type := NewActivityStreamsNote ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Cane Sugar Processing" )
example134Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendRDFLangString ( map [ string ] string {
2019-02-08 08:59:10 +09:00
"en" : "A simple <em>note</em>" ,
"es" : "Una <em>nota</em> sencilla" ,
"zh-Hans" : "一段<em>简单的</em>笔记" ,
} )
2019-02-10 05:56:00 +09:00
example134Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
return example134Type
}
const example135 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's notes" ,
"type" : "Collection" ,
"totalItems" : 2 ,
"items" : [
{
"type" : "Note" ,
"name" : "Which Staircase Should I Use"
} ,
{
"type" : "Note" ,
"name" : "Something to Remember"
}
]
} `
2019-02-10 05:56:00 +09:00
func example135Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example135Type := NewActivityStreamsCollection ( )
note1 := NewActivityStreamsNote ( )
name1 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name1 . AppendXMLSchemaString ( "Which Staircase Should I Use" )
note1 . SetActivityStreamsName ( name1 )
2019-02-08 08:59:10 +09:00
note2 := NewActivityStreamsNote ( )
name2 := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name2 . AppendXMLSchemaString ( "Something to Remember" )
note2 . SetActivityStreamsName ( name2 )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's notes" )
example135Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 2 )
2019-02-10 05:56:00 +09:00
example135Type . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsNote ( note1 )
items . AppendActivityStreamsNote ( note2 )
example135Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example135Type
}
const example136 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Place" ,
"name" : "Fresno Area" ,
"latitude" : 36.75 ,
"longitude" : 119.7667 ,
"radius" : 15 ,
"units" : "miles"
} `
2019-02-10 05:56:00 +09:00
func example136Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example136Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Fresno Area" )
example136Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
lat := NewActivityStreamsLatitudeProperty ( )
lat . Set ( 36.75 )
2019-02-10 05:56:00 +09:00
example136Type . SetActivityStreamsLatitude ( lat )
2019-02-08 08:59:10 +09:00
lon := NewActivityStreamsLongitudeProperty ( )
lon . Set ( 119.7667 )
2019-02-10 05:56:00 +09:00
example136Type . SetActivityStreamsLongitude ( lon )
2019-02-08 08:59:10 +09:00
rad := NewActivityStreamsRadiusProperty ( )
rad . Set ( 15 )
2019-02-10 05:56:00 +09:00
example136Type . SetActivityStreamsRadius ( rad )
2019-02-08 08:59:10 +09:00
units := NewActivityStreamsUnitsProperty ( )
2019-02-10 05:56:00 +09:00
units . SetXMLSchemaString ( "miles" )
example136Type . SetActivityStreamsUnits ( units )
2019-02-08 08:59:10 +09:00
return example136Type
}
const example137 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "Cranberry Sauce Idea" ,
"type" : "Note" ,
"content" : "Mush it up so it does not have the same shape as the can." ,
"updated" : "2014-12-12T12:12:12Z"
} `
2019-02-10 05:56:00 +09:00
func example137Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example137Type := NewActivityStreamsNote ( )
t , err := time . Parse ( time . RFC3339 , "2014-12-12T12:12:12Z" )
if err != nil {
panic ( err )
}
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Cranberry Sauce Idea" )
example137Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "Mush it up so it does not have the same shape as the can." )
example137Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
updated := NewActivityStreamsUpdatedProperty ( )
updated . Set ( t )
2019-02-10 05:56:00 +09:00
example137Type . SetActivityStreamsUpdated ( updated )
2019-02-08 08:59:10 +09:00
return example137Type
}
const example138 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Link" ,
"href" : "http://example.org/image.png" ,
"height" : 100 ,
"width" : 100
} `
2019-02-10 05:56:00 +09:00
func example138Type ( ) vocab . ActivityStreamsLink {
2019-02-08 08:59:10 +09:00
example138Type := NewActivityStreamsLink ( )
u := MustParseURL ( "http://example.org/image.png" )
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
example138Type . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
width := NewActivityStreamsWidthProperty ( )
width . Set ( 100 )
2019-02-10 05:56:00 +09:00
example138Type . SetActivityStreamsWidth ( width )
2019-02-08 08:59:10 +09:00
height := NewActivityStreamsHeightProperty ( )
height . Set ( 100 )
2019-02-10 05:56:00 +09:00
example138Type . SetActivityStreamsHeight ( height )
2019-02-08 08:59:10 +09:00
return example138Type
}
const example139 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally is an acquaintance of John's" ,
"type" : "Relationship" ,
"subject" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"relationship" : "http://purl.org/vocab/relationship/acquaintanceOf" ,
"object" : {
"type" : "Person" ,
"name" : "John"
}
} `
2019-02-10 05:56:00 +09:00
func example139Type ( ) vocab . ActivityStreamsRelationship {
2019-02-08 08:59:10 +09:00
example139Type := NewActivityStreamsRelationship ( )
u := MustParseURL ( "http://purl.org/vocab/relationship/acquaintanceOf" )
subject := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
subject . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsPerson ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "John" )
object . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally is an acquaintance of John's" )
example139Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
subj := NewActivityStreamsSubjectProperty ( )
2019-02-10 05:56:00 +09:00
subj . SetActivityStreamsPerson ( subject )
example139Type . SetActivityStreamsSubject ( subj )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsPerson ( object )
example139Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
relationship := NewActivityStreamsRelationshipProperty ( )
relationship . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
example139Type . SetActivityStreamsRelationship ( relationship )
2019-02-08 08:59:10 +09:00
return example139Type
}
const example140 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally is an acquaintance of John's" ,
"type" : "Relationship" ,
"subject" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"relationship" : "http://purl.org/vocab/relationship/acquaintanceOf" ,
"object" : {
"type" : "Person" ,
"name" : "John"
}
} `
2019-02-10 05:56:00 +09:00
func example140Type ( ) vocab . ActivityStreamsRelationship {
2019-02-08 08:59:10 +09:00
example140Type := NewActivityStreamsRelationship ( )
u := MustParseURL ( "http://purl.org/vocab/relationship/acquaintanceOf" )
subject := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
subject . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsPerson ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "John" )
object . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally is an acquaintance of John's" )
example140Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
subj := NewActivityStreamsSubjectProperty ( )
2019-02-10 05:56:00 +09:00
subj . SetActivityStreamsPerson ( subject )
example140Type . SetActivityStreamsSubject ( subj )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsPerson ( object )
example140Type . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
relationship := NewActivityStreamsRelationshipProperty ( )
relationship . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
example140Type . SetActivityStreamsRelationship ( relationship )
2019-02-08 08:59:10 +09:00
return example140Type
}
const example141 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's profile" ,
"type" : "Profile" ,
"describes" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"url" : "http://sally.example.org"
} `
2019-02-10 05:56:00 +09:00
func example141Type ( ) vocab . ActivityStreamsProfile {
2019-02-08 08:59:10 +09:00
example141Type := NewActivityStreamsProfile ( )
u := MustParseURL ( "http://sally.example.org" )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's profile" )
example141Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
example141Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
describes := NewActivityStreamsDescribesProperty ( )
2019-02-10 05:56:00 +09:00
describes . SetActivityStreamsPerson ( person )
example141Type . SetActivityStreamsDescribes ( describes )
2019-02-08 08:59:10 +09:00
return example141Type
}
const example142 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "This image has been deleted" ,
"type" : "Tombstone" ,
"formerType" : "Image" ,
"url" : "http://example.org/image/2"
} `
2019-02-10 05:56:00 +09:00
func example142Type ( ) vocab . ActivityStreamsTombstone {
2019-02-08 08:59:10 +09:00
example142Type := NewActivityStreamsTombstone ( )
u := MustParseURL ( "http://example.org/image/2" )
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "This image has been deleted" )
example142Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
former := NewActivityStreamsFormerTypeProperty ( )
2019-02-10 05:56:00 +09:00
former . AppendXMLSchemaString ( "Image" )
example142Type . SetActivityStreamsFormerType ( former )
2019-02-08 08:59:10 +09:00
urlProp := NewActivityStreamsUrlProperty ( )
urlProp . AppendIRI ( u )
2019-02-10 05:56:00 +09:00
example142Type . SetActivityStreamsUrl ( urlProp )
2019-02-08 08:59:10 +09:00
return example142Type
}
const example143 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "This image has been deleted" ,
"type" : "Tombstone" ,
"deleted" : "2016-05-03T00:00:00Z"
} `
2019-02-10 05:56:00 +09:00
func example143Type ( ) vocab . ActivityStreamsTombstone {
2019-02-08 08:59:10 +09:00
example143Type := NewActivityStreamsTombstone ( )
t , err := time . Parse ( time . RFC3339 , "2016-05-03T00:00:00Z" )
if err != nil {
panic ( err )
}
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "This image has been deleted" )
example143Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
deleted := NewActivityStreamsDeletedProperty ( )
deleted . Set ( t )
2019-02-10 05:56:00 +09:00
example143Type . SetActivityStreamsDeleted ( deleted )
2019-02-08 08:59:10 +09:00
return example143Type
}
const example144 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Activities in Project XYZ" ,
"type" : "Collection" ,
"items" : [
{
"summary" : "Sally created a note" ,
"type" : "Create" ,
"id" : "http://activities.example.com/1" ,
"actor" : "http://sally.example.org" ,
"object" : {
"summary" : "A note" ,
"type" : "Note" ,
"id" : "http://notes.example.com/1" ,
"content" : "A note"
} ,
"context" : {
"type" : "http://example.org/Project" ,
"name" : "Project XYZ"
} ,
"audience" : {
"type" : "Group" ,
"name" : "Project XYZ Working Group"
} ,
"to" : "http://john.example.org"
} ,
{
"summary" : "John liked Sally's note" ,
"type" : "Like" ,
"id" : "http://activities.example.com/1" ,
"actor" : "http://john.example.org" ,
"object" : "http://notes.example.com/1" ,
"context" : {
"type" : "http://example.org/Project" ,
"name" : "Project XYZ"
} ,
"audience" : {
"type" : "Group" ,
"name" : "Project XYZ Working Group"
} ,
"to" : "http://sally.example.org"
}
]
} `
var example144Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
items := m [ "items" ] . ( [ ] interface { } )
create := items [ 0 ] . ( map [ string ] interface { } )
like := items [ 1 ] . ( map [ string ] interface { } )
create [ "context" ] = map [ string ] interface { } {
"type" : "http://example.org/Project" ,
"name" : "Project XYZ" ,
}
like [ "context" ] = map [ string ] interface { } {
"type" : "http://example.org/Project" ,
"name" : "Project XYZ" ,
}
m [ "items" ] = [ ] interface { } { create , like }
return m
}
2019-02-10 05:56:00 +09:00
func example144Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example144Type := NewActivityStreamsCollection ( )
sally := MustParseURL ( "http://sally.example.org" )
john := MustParseURL ( "http://john.example.org" )
o := MustParseURL ( "http://notes.example.com/1" )
audience := NewActivityStreamsGroup ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Project XYZ Working Group" )
audience . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
note := NewActivityStreamsNote ( )
summaryNote := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryNote . AppendXMLSchemaString ( "A note" )
note . SetActivityStreamsSummary ( summaryNote )
2019-02-08 08:59:10 +09:00
noteId := NewActivityStreamsIdProperty ( )
noteId . Set ( MustParseURL ( "http://notes.example.com/1" ) )
2019-02-10 05:56:00 +09:00
note . SetActivityStreamsId ( noteId )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "A note" )
note . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
create := NewActivityStreamsCreate ( )
summaryCreate := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryCreate . AppendXMLSchemaString ( "Sally created a note" )
create . SetActivityStreamsSummary ( summaryCreate )
2019-02-08 08:59:10 +09:00
createId := NewActivityStreamsIdProperty ( )
createId . Set ( MustParseURL ( "http://activities.example.com/1" ) )
2019-02-10 05:56:00 +09:00
create . SetActivityStreamsId ( createId )
2019-02-08 08:59:10 +09:00
createActor := NewActivityStreamsActorProperty ( )
createActor . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
create . SetActivityStreamsActor ( createActor )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsNote ( note )
create . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
aud1 := NewActivityStreamsAudienceProperty ( )
2019-02-10 05:56:00 +09:00
aud1 . AppendActivityStreamsGroup ( audience )
create . SetActivityStreamsAudience ( aud1 )
2019-02-08 08:59:10 +09:00
toCreate := NewActivityStreamsToProperty ( )
toCreate . AppendIRI ( john )
2019-02-10 05:56:00 +09:00
create . SetActivityStreamsTo ( toCreate )
2019-02-08 08:59:10 +09:00
like := NewActivityStreamsLike ( )
summaryLike := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryLike . AppendXMLSchemaString ( "John liked Sally's note" )
like . SetActivityStreamsSummary ( summaryLike )
2019-02-08 08:59:10 +09:00
likeId := NewActivityStreamsIdProperty ( )
likeId . Set ( MustParseURL ( "http://activities.example.com/1" ) )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsId ( likeId )
2019-02-08 08:59:10 +09:00
likeActor := NewActivityStreamsActorProperty ( )
likeActor . AppendIRI ( john )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsActor ( likeActor )
2019-02-08 08:59:10 +09:00
objLike := NewActivityStreamsObjectProperty ( )
objLike . AppendIRI ( o )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsObject ( objLike )
2019-02-08 08:59:10 +09:00
aud2 := NewActivityStreamsAudienceProperty ( )
2019-02-10 05:56:00 +09:00
aud2 . AppendActivityStreamsGroup ( audience )
like . SetActivityStreamsAudience ( aud2 )
2019-02-08 08:59:10 +09:00
toLike := NewActivityStreamsToProperty ( )
toLike . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsTo ( toLike )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Activities in Project XYZ" )
example144Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsCreate ( create )
items . AppendActivityStreamsLike ( like )
example144Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example144Type
}
const example145 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally's friends list" ,
"type" : "Collection" ,
"items" : [
{
"summary" : "Sally is influenced by Joe" ,
"type" : "Relationship" ,
"subject" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"relationship" : "http://purl.org/vocab/relationship/influencedBy" ,
"object" : {
"type" : "Person" ,
"name" : "Joe"
}
} ,
{
"summary" : "Sally is a friend of Jane" ,
"type" : "Relationship" ,
"subject" : {
"type" : "Person" ,
"name" : "Sally"
} ,
"relationship" : "http://purl.org/vocab/relationship/friendOf" ,
"object" : {
"type" : "Person" ,
"name" : "Jane"
}
}
]
} `
2019-02-10 05:56:00 +09:00
func example145Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example145Type := NewActivityStreamsCollection ( )
friend := MustParseURL ( "http://purl.org/vocab/relationship/friendOf" )
influenced := MustParseURL ( "http://purl.org/vocab/relationship/influencedBy" )
sally := NewActivityStreamsPerson ( )
sallyName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sallyName . AppendXMLSchemaString ( "Sally" )
sally . SetActivityStreamsName ( sallyName )
2019-02-08 08:59:10 +09:00
jane := NewActivityStreamsPerson ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "Jane" )
jane . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
joe := NewActivityStreamsPerson ( )
joeName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
joeName . AppendXMLSchemaString ( "Joe" )
joe . SetActivityStreamsName ( joeName )
2019-02-08 08:59:10 +09:00
joeRel := NewActivityStreamsRelationship ( )
summaryJoe := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryJoe . AppendXMLSchemaString ( "Sally is influenced by Joe" )
joeRel . SetActivityStreamsSummary ( summaryJoe )
2019-02-08 08:59:10 +09:00
subj1 := NewActivityStreamsSubjectProperty ( )
2019-02-10 05:56:00 +09:00
subj1 . SetActivityStreamsPerson ( sally )
joeRel . SetActivityStreamsSubject ( subj1 )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
obj . AppendActivityStreamsPerson ( joe )
joeRel . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
relationship := NewActivityStreamsRelationshipProperty ( )
relationship . AppendIRI ( influenced )
2019-02-10 05:56:00 +09:00
joeRel . SetActivityStreamsRelationship ( relationship )
2019-02-08 08:59:10 +09:00
janeRel := NewActivityStreamsRelationship ( )
summaryJane := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryJane . AppendXMLSchemaString ( "Sally is a friend of Jane" )
janeRel . SetActivityStreamsSummary ( summaryJane )
2019-02-08 08:59:10 +09:00
subj2 := NewActivityStreamsSubjectProperty ( )
2019-02-10 05:56:00 +09:00
subj2 . SetActivityStreamsPerson ( sally )
janeRel . SetActivityStreamsSubject ( subj2 )
2019-02-08 08:59:10 +09:00
objJane := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objJane . AppendActivityStreamsPerson ( jane )
janeRel . SetActivityStreamsObject ( objJane )
2019-02-08 08:59:10 +09:00
relationshipJane := NewActivityStreamsRelationshipProperty ( )
relationshipJane . AppendIRI ( friend )
2019-02-10 05:56:00 +09:00
janeRel . SetActivityStreamsRelationship ( relationshipJane )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally's friends list" )
example145Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsRelationship ( joeRel )
items . AppendActivityStreamsRelationship ( janeRel )
example145Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example145Type
}
// NOTE: Added `Z` to `startTime` to make align to spec!
const example146 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally became a friend of Matt" ,
"type" : "Create" ,
"actor" : "http://sally.example.org" ,
"object" : {
"type" : "Relationship" ,
"subject" : "http://sally.example.org" ,
"relationship" : "http://purl.org/vocab/relationship/friendOf" ,
"object" : "http://matt.example.org" ,
"startTime" : "2015-04-21T12:34:56Z"
}
} `
2019-02-10 05:56:00 +09:00
func example146Type ( ) vocab . ActivityStreamsCreate {
2019-02-08 08:59:10 +09:00
example146Type := NewActivityStreamsCreate ( )
friend := MustParseURL ( "http://purl.org/vocab/relationship/friendOf" )
m := MustParseURL ( "http://matt.example.org" )
s := MustParseURL ( "http://sally.example.org" )
t , err := time . Parse ( time . RFC3339 , "2015-04-21T12:34:56Z" )
if err != nil {
panic ( err )
}
relationship := NewActivityStreamsRelationship ( )
subj := NewActivityStreamsSubjectProperty ( )
subj . SetIRI ( s )
2019-02-10 05:56:00 +09:00
relationship . SetActivityStreamsSubject ( subj )
2019-02-08 08:59:10 +09:00
friendRel := NewActivityStreamsRelationshipProperty ( )
friendRel . AppendIRI ( friend )
2019-02-10 05:56:00 +09:00
relationship . SetActivityStreamsRelationship ( friendRel )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( m )
2019-02-10 05:56:00 +09:00
relationship . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
startTime := NewActivityStreamsStartTimeProperty ( )
startTime . Set ( t )
2019-02-10 05:56:00 +09:00
relationship . SetActivityStreamsStartTime ( startTime )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally became a friend of Matt" )
example146Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( s )
2019-02-10 05:56:00 +09:00
example146Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
objRoot := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objRoot . AppendActivityStreamsRelationship ( relationship )
example146Type . SetActivityStreamsObject ( objRoot )
2019-02-08 08:59:10 +09:00
return example146Type
}
const example147 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"id" : "http://example.org/connection-requests/123" ,
"summary" : "Sally requested to be a friend of John" ,
"type" : "Offer" ,
"actor" : "acct:sally@example.org" ,
"object" : {
"summary" : "Sally and John's friendship" ,
"id" : "http://example.org/connections/123" ,
"type" : "Relationship" ,
"subject" : "acct:sally@example.org" ,
"relationship" : "http://purl.org/vocab/relationship/friendOf" ,
"object" : "acct:john@example.org"
} ,
"target" : "acct:john@example.org"
} `
2019-02-10 05:56:00 +09:00
func example147Type ( ) vocab . ActivityStreamsOffer {
2019-02-08 08:59:10 +09:00
example147Type := NewActivityStreamsOffer ( )
friend := MustParseURL ( "http://purl.org/vocab/relationship/friendOf" )
s := MustParseURL ( "acct:sally@example.org" )
t := MustParseURL ( "acct:john@example.org" )
rel := NewActivityStreamsRelationship ( )
summaryRel := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryRel . AppendXMLSchemaString ( "Sally and John's friendship" )
rel . SetActivityStreamsSummary ( summaryRel )
2019-02-08 08:59:10 +09:00
relId := NewActivityStreamsIdProperty ( )
relId . Set ( MustParseURL ( "http://example.org/connections/123" ) )
2019-02-10 05:56:00 +09:00
rel . SetActivityStreamsId ( relId )
2019-02-08 08:59:10 +09:00
subj := NewActivityStreamsSubjectProperty ( )
subj . SetIRI ( s )
2019-02-10 05:56:00 +09:00
rel . SetActivityStreamsSubject ( subj )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( t )
2019-02-10 05:56:00 +09:00
rel . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
relationship := NewActivityStreamsRelationshipProperty ( )
relationship . AppendIRI ( friend )
2019-02-10 05:56:00 +09:00
rel . SetActivityStreamsRelationship ( relationship )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally requested to be a friend of John" )
example147Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://example.org/connection-requests/123" ) )
2019-02-10 05:56:00 +09:00
example147Type . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( s )
2019-02-10 05:56:00 +09:00
example147Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
objRel := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objRel . AppendActivityStreamsRelationship ( rel )
example147Type . SetActivityStreamsObject ( objRel )
2019-02-08 08:59:10 +09:00
objRoot := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objRoot . AppendActivityStreamsRelationship ( rel )
example147Type . SetActivityStreamsObject ( objRoot )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsTargetProperty ( )
target . AppendIRI ( t )
2019-02-10 05:56:00 +09:00
example147Type . SetActivityStreamsTarget ( target )
2019-02-08 08:59:10 +09:00
return example147Type
}
const example148 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally and John's relationship history" ,
"type" : "Collection" ,
"items" : [
{
"summary" : "John accepted Sally's friend request" ,
"id" : "http://example.org/activities/122" ,
"type" : "Accept" ,
"actor" : "acct:john@example.org" ,
"object" : "http://example.org/connection-requests/123" ,
"inReplyTo" : "http://example.org/connection-requests/123" ,
"context" : "http://example.org/connections/123" ,
"result" : [
"http://example.org/activities/123" ,
"http://example.org/activities/124" ,
"http://example.org/activities/125" ,
"http://example.org/activities/126"
]
} ,
{
"summary" : "John followed Sally" ,
"id" : "http://example.org/activities/123" ,
"type" : "Follow" ,
"actor" : "acct:john@example.org" ,
"object" : "acct:sally@example.org" ,
"context" : "http://example.org/connections/123"
} ,
{
"summary" : "Sally followed John" ,
"id" : "http://example.org/activities/124" ,
"type" : "Follow" ,
"actor" : "acct:sally@example.org" ,
"object" : "acct:john@example.org" ,
"context" : "http://example.org/connections/123"
} ,
{
"summary" : "John added Sally to his friends list" ,
"id" : "http://example.org/activities/125" ,
"type" : "Add" ,
"actor" : "acct:john@example.org" ,
"object" : "http://example.org/connections/123" ,
"target" : {
"type" : "Collection" ,
"summary" : "John's Connections"
} ,
"context" : "http://example.org/connections/123"
} ,
{
"summary" : "Sally added John to her friends list" ,
"id" : "http://example.org/activities/126" ,
"type" : "Add" ,
"actor" : "acct:sally@example.org" ,
"object" : "http://example.org/connections/123" ,
"target" : {
"type" : "Collection" ,
"summary" : "Sally's Connections"
} ,
"context" : "http://example.org/connections/123"
}
]
} `
2019-02-10 05:56:00 +09:00
func example148Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example148Type := NewActivityStreamsCollection ( )
john := MustParseURL ( "acct:john@example.org" )
sally := MustParseURL ( "acct:sally@example.org" )
req123 := MustParseURL ( "http://example.org/connection-requests/123" )
conn123 := MustParseURL ( "http://example.org/connections/123" )
a123 := MustParseURL ( "http://example.org/activities/123" )
a124 := MustParseURL ( "http://example.org/activities/124" )
a125 := MustParseURL ( "http://example.org/activities/125" )
a126 := MustParseURL ( "http://example.org/activities/126" )
jc := NewActivityStreamsCollection ( )
summaryJc := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryJc . AppendXMLSchemaString ( "John's Connections" )
jc . SetActivityStreamsSummary ( summaryJc )
2019-02-08 08:59:10 +09:00
sc := NewActivityStreamsCollection ( )
summarySc := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summarySc . AppendXMLSchemaString ( "Sally's Connections" )
sc . SetActivityStreamsSummary ( summarySc )
2019-02-08 08:59:10 +09:00
o1 := NewActivityStreamsAccept ( )
oId1 := NewActivityStreamsIdProperty ( )
oId1 . Set ( MustParseURL ( "http://example.org/activities/122" ) )
2019-02-10 05:56:00 +09:00
o1 . SetActivityStreamsId ( oId1 )
2019-02-08 08:59:10 +09:00
summary1 := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary1 . AppendXMLSchemaString ( "John accepted Sally's friend request" )
o1 . SetActivityStreamsSummary ( summary1 )
2019-02-08 08:59:10 +09:00
obj1 := NewActivityStreamsObjectProperty ( )
obj1 . AppendIRI ( req123 )
2019-02-10 05:56:00 +09:00
o1 . SetActivityStreamsObject ( obj1 )
2019-02-08 08:59:10 +09:00
inReplyTo := NewActivityStreamsInReplyToProperty ( )
inReplyTo . AppendIRI ( req123 )
2019-02-10 05:56:00 +09:00
o1 . SetActivityStreamsInReplyTo ( inReplyTo )
2019-02-08 08:59:10 +09:00
ctx1 := NewActivityStreamsContextProperty ( )
ctx1 . AppendIRI ( conn123 )
2019-02-10 05:56:00 +09:00
o1 . SetActivityStreamsContext ( ctx1 )
2019-02-08 08:59:10 +09:00
result := NewActivityStreamsResultProperty ( )
result . AppendIRI ( a123 )
result . AppendIRI ( a124 )
result . AppendIRI ( a125 )
result . AppendIRI ( a126 )
2019-02-10 05:56:00 +09:00
o1 . SetActivityStreamsResult ( result )
2019-02-08 08:59:10 +09:00
objectActor1 := NewActivityStreamsActorProperty ( )
objectActor1 . AppendIRI ( john )
2019-02-10 05:56:00 +09:00
o1 . SetActivityStreamsActor ( objectActor1 )
2019-02-08 08:59:10 +09:00
o2 := NewActivityStreamsFollow ( )
oId2 := NewActivityStreamsIdProperty ( )
oId2 . Set ( MustParseURL ( "http://example.org/activities/123" ) )
2019-02-10 05:56:00 +09:00
o2 . SetActivityStreamsId ( oId2 )
2019-02-08 08:59:10 +09:00
objectActor2 := NewActivityStreamsActorProperty ( )
objectActor2 . AppendIRI ( john )
2019-02-10 05:56:00 +09:00
o2 . SetActivityStreamsActor ( objectActor2 )
2019-02-08 08:59:10 +09:00
obj2 := NewActivityStreamsObjectProperty ( )
obj2 . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
o2 . SetActivityStreamsObject ( obj2 )
2019-02-08 08:59:10 +09:00
ctx2 := NewActivityStreamsContextProperty ( )
ctx2 . AppendIRI ( conn123 )
2019-02-10 05:56:00 +09:00
o2 . SetActivityStreamsContext ( ctx2 )
2019-02-08 08:59:10 +09:00
summary2 := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary2 . AppendXMLSchemaString ( "John followed Sally" )
o2 . SetActivityStreamsSummary ( summary2 )
2019-02-08 08:59:10 +09:00
o3 := NewActivityStreamsFollow ( )
oId3 := NewActivityStreamsIdProperty ( )
oId3 . Set ( MustParseURL ( "http://example.org/activities/124" ) )
2019-02-10 05:56:00 +09:00
o3 . SetActivityStreamsId ( oId3 )
2019-02-08 08:59:10 +09:00
objectActor3 := NewActivityStreamsActorProperty ( )
objectActor3 . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
o3 . SetActivityStreamsActor ( objectActor3 )
2019-02-08 08:59:10 +09:00
obj3 := NewActivityStreamsObjectProperty ( )
obj3 . AppendIRI ( john )
2019-02-10 05:56:00 +09:00
o3 . SetActivityStreamsObject ( obj3 )
2019-02-08 08:59:10 +09:00
ctx3 := NewActivityStreamsContextProperty ( )
ctx3 . AppendIRI ( conn123 )
2019-02-10 05:56:00 +09:00
o3 . SetActivityStreamsContext ( ctx3 )
2019-02-08 08:59:10 +09:00
summary3 := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary3 . AppendXMLSchemaString ( "Sally followed John" )
o3 . SetActivityStreamsSummary ( summary3 )
2019-02-08 08:59:10 +09:00
o4 := NewActivityStreamsAdd ( )
oId4 := NewActivityStreamsIdProperty ( )
oId4 . Set ( MustParseURL ( "http://example.org/activities/125" ) )
2019-02-10 05:56:00 +09:00
o4 . SetActivityStreamsId ( oId4 )
2019-02-08 08:59:10 +09:00
summary4 := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary4 . AppendXMLSchemaString ( "John added Sally to his friends list" )
o4 . SetActivityStreamsSummary ( summary4 )
2019-02-08 08:59:10 +09:00
objectActor4 := NewActivityStreamsActorProperty ( )
objectActor4 . AppendIRI ( john )
2019-02-10 05:56:00 +09:00
o4 . SetActivityStreamsActor ( objectActor4 )
2019-02-08 08:59:10 +09:00
obj4 := NewActivityStreamsObjectProperty ( )
obj4 . AppendIRI ( conn123 )
2019-02-10 05:56:00 +09:00
o4 . SetActivityStreamsObject ( obj4 )
2019-02-08 08:59:10 +09:00
ctx4 := NewActivityStreamsContextProperty ( )
ctx4 . AppendIRI ( conn123 )
2019-02-10 05:56:00 +09:00
o4 . SetActivityStreamsContext ( ctx4 )
2019-02-08 08:59:10 +09:00
tobj4 := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj4 . AppendActivityStreamsCollection ( jc )
o4 . SetActivityStreamsTarget ( tobj4 )
2019-02-08 08:59:10 +09:00
o5 := NewActivityStreamsAdd ( )
oId5 := NewActivityStreamsIdProperty ( )
oId5 . Set ( MustParseURL ( "http://example.org/activities/126" ) )
2019-02-10 05:56:00 +09:00
o5 . SetActivityStreamsId ( oId5 )
2019-02-08 08:59:10 +09:00
summary5 := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary5 . AppendXMLSchemaString ( "Sally added John to her friends list" )
o5 . SetActivityStreamsSummary ( summary5 )
2019-02-08 08:59:10 +09:00
objectActor5 := NewActivityStreamsActorProperty ( )
objectActor5 . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
o5 . SetActivityStreamsActor ( objectActor5 )
2019-02-08 08:59:10 +09:00
obj5 := NewActivityStreamsObjectProperty ( )
obj5 . AppendIRI ( conn123 )
2019-02-10 05:56:00 +09:00
o5 . SetActivityStreamsObject ( obj5 )
2019-02-08 08:59:10 +09:00
ctx5 := NewActivityStreamsContextProperty ( )
ctx5 . AppendIRI ( conn123 )
2019-02-10 05:56:00 +09:00
o5 . SetActivityStreamsContext ( ctx5 )
2019-02-08 08:59:10 +09:00
tobj5 := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj5 . AppendActivityStreamsCollection ( sc )
o5 . SetActivityStreamsTarget ( tobj5 )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally and John's relationship history" )
example148Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsAccept ( o1 )
items . AppendActivityStreamsFollow ( o2 )
items . AppendActivityStreamsFollow ( o3 )
items . AppendActivityStreamsAdd ( o4 )
items . AppendActivityStreamsAdd ( o5 )
example148Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example148Type
}
const example149 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Place" ,
"name" : "San Francisco, CA"
} `
2019-02-10 05:56:00 +09:00
func example149Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example149Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "San Francisco, CA" )
example149Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
return example149Type
}
// NOTE: Un-stringified the longitude and latitude values.
const example150 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"type" : "Place" ,
"name" : "San Francisco, CA" ,
"longitude" : 122.4167 ,
"latitude" : 37.7833
} `
2019-02-10 05:56:00 +09:00
func example150Type ( ) vocab . ActivityStreamsPlace {
2019-02-08 08:59:10 +09:00
example150Type := NewActivityStreamsPlace ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "San Francisco, CA" )
example150Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
lon := NewActivityStreamsLongitudeProperty ( )
lon . Set ( 122.4167 )
2019-02-10 05:56:00 +09:00
example150Type . SetActivityStreamsLongitude ( lon )
2019-02-08 08:59:10 +09:00
lat := NewActivityStreamsLatitudeProperty ( )
lat . Set ( 37.7833 )
2019-02-10 05:56:00 +09:00
example150Type . SetActivityStreamsLatitude ( lat )
2019-02-08 08:59:10 +09:00
return example150Type
}
const example151 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "A question about robots" ,
"id" : "http://help.example.org/question/1" ,
"type" : "Question" ,
"content" : "I'd like to build a robot to feed my cat. Should I use Arduino or Raspberry Pi?"
} `
2019-02-10 05:56:00 +09:00
func example151Type ( ) vocab . ActivityStreamsQuestion {
2019-02-08 08:59:10 +09:00
example151Type := NewActivityStreamsQuestion ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A question about robots" )
example151Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://help.example.org/question/1" ) )
2019-02-10 05:56:00 +09:00
example151Type . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "I'd like to build a robot to feed my cat. Should I use Arduino or Raspberry Pi?" )
example151Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
return example151Type
}
const example152 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"id" : "http://polls.example.org/question/1" ,
"name" : "A question about robots" ,
"type" : "Question" ,
"content" : "I'd like to build a robot to feed my cat. Which platform is best?" ,
"oneOf" : [
{ "name" : "arduino" } ,
{ "name" : "raspberry pi" }
]
} `
var example152Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
ard := make ( map [ string ] interface { } )
ard [ "name" ] = "arduino"
ras := make ( map [ string ] interface { } )
ras [ "name" ] = "raspberry pi"
m [ "oneOf" ] = [ ] interface { } { ard , ras }
return m
}
2019-02-10 05:56:00 +09:00
func example152Type ( ) vocab . ActivityStreamsQuestion {
2019-02-08 08:59:10 +09:00
example152Type := NewActivityStreamsQuestion ( )
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A question about robots" )
example152Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://polls.example.org/question/1" ) )
2019-02-10 05:56:00 +09:00
example152Type . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "I'd like to build a robot to feed my cat. Which platform is best?" )
example152Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
return example152Type
}
const example153 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"attributedTo" : "http://sally.example.org" ,
"inReplyTo" : "http://polls.example.org/question/1" ,
"name" : "arduino"
} `
var example153Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
m [ "attributedTo" ] = "http://sally.example.org"
m [ "inReplyTo" ] = "http://polls.example.org/question/1"
m [ "name" ] = "arduino"
return m
}
const example154 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "A question about robots" ,
"id" : "http://polls.example.org/question/1" ,
"type" : "Question" ,
"content" : "I'd like to build a robot to feed my cat. Which platform is best?" ,
"oneOf" : [
{ "name" : "arduino" } ,
{ "name" : "raspberry pi" }
] ,
"replies" : {
"type" : "Collection" ,
"totalItems" : 3 ,
"items" : [
{
"attributedTo" : "http://sally.example.org" ,
"inReplyTo" : "http://polls.example.org/question/1" ,
"name" : "arduino"
} ,
{
"attributedTo" : "http://joe.example.org" ,
"inReplyTo" : "http://polls.example.org/question/1" ,
"name" : "arduino"
} ,
{
"attributedTo" : "http://john.example.org" ,
"inReplyTo" : "http://polls.example.org/question/1" ,
"name" : "raspberry pi"
}
]
} ,
"result" : {
"type" : "Note" ,
"content" : "Users are favoriting "arduino" by a 33% margin."
}
} `
var example154Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
ard := make ( map [ string ] interface { } )
ard [ "name" ] = "arduino"
ras := make ( map [ string ] interface { } )
ras [ "name" ] = "raspberry pi"
m [ "oneOf" ] = [ ] interface { } { ard , ras }
// replies
one := make ( map [ string ] interface { } )
one [ "attributedTo" ] = "http://sally.example.org"
one [ "inReplyTo" ] = "http://polls.example.org/question/1"
one [ "name" ] = "arduino"
two := make ( map [ string ] interface { } )
two [ "attributedTo" ] = "http://joe.example.org"
two [ "inReplyTo" ] = "http://polls.example.org/question/1"
two [ "name" ] = "arduino"
three := make ( map [ string ] interface { } )
three [ "attributedTo" ] = "http://john.example.org"
three [ "inReplyTo" ] = "http://polls.example.org/question/1"
three [ "name" ] = "raspberry pi"
items := [ ] interface { } { one , two , three }
replies := m [ "replies" ] . ( map [ string ] interface { } )
replies [ "items" ] = items
return m
}
2019-02-10 05:56:00 +09:00
func example154Type ( ) vocab . ActivityStreamsQuestion {
2019-02-08 08:59:10 +09:00
example154Type := NewActivityStreamsQuestion ( )
replies := NewActivityStreamsCollection ( )
totalItems := NewActivityStreamsTotalItemsProperty ( )
totalItems . Set ( 3 )
2019-02-10 05:56:00 +09:00
replies . SetActivityStreamsTotalItems ( totalItems )
2019-02-08 08:59:10 +09:00
note := NewActivityStreamsNote ( )
contentNote := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
contentNote . AppendXMLSchemaString ( "Users are favoriting "arduino" by a 33% margin." )
note . SetActivityStreamsContent ( contentNote )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A question about robots" )
example154Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://polls.example.org/question/1" ) )
2019-02-10 05:56:00 +09:00
example154Type . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
content := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
content . AppendXMLSchemaString ( "I'd like to build a robot to feed my cat. Which platform is best?" )
example154Type . SetActivityStreamsContent ( content )
2019-02-08 08:59:10 +09:00
reply := NewActivityStreamsRepliesProperty ( )
2019-02-10 05:56:00 +09:00
reply . SetActivityStreamsCollection ( replies )
example154Type . SetActivityStreamsReplies ( reply )
2019-02-08 08:59:10 +09:00
result := NewActivityStreamsResultProperty ( )
2019-02-10 05:56:00 +09:00
result . AppendActivityStreamsNote ( note )
example154Type . SetActivityStreamsResult ( result )
2019-02-08 08:59:10 +09:00
return example154Type
}
const example155 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "History of John's note" ,
"type" : "Collection" ,
"items" : [
{
"summary" : "Sally liked John's note" ,
"type" : "Like" ,
"actor" : "http://sally.example.org" ,
"id" : "http://activities.example.com/1" ,
"published" : "2015-11-12T12:34:56Z" ,
"object" : {
"summary" : "John's note" ,
"type" : "Note" ,
"id" : "http://notes.example.com/1" ,
"attributedTo" : "http://john.example.org" ,
"content" : "My note"
}
} ,
{
"summary" : "Sally disliked John's note" ,
"type" : "Dislike" ,
"actor" : "http://sally.example.org" ,
"id" : "http://activities.example.com/2" ,
"published" : "2015-12-11T21:43:56Z" ,
"object" : {
"summary" : "John's note" ,
"type" : "Note" ,
"id" : "http://notes.example.com/1" ,
"attributedTo" : "http://john.example.org" ,
"content" : "My note"
}
}
]
} `
2019-02-10 05:56:00 +09:00
func example155Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example155Type := NewActivityStreamsCollection ( )
john := MustParseURL ( "http://john.example.org" )
sally := MustParseURL ( "http://sally.example.org" )
t1 , err := time . Parse ( time . RFC3339 , "2015-11-12T12:34:56Z" )
if err != nil {
panic ( err )
}
t2 , err := time . Parse ( time . RFC3339 , "2015-12-11T21:43:56Z" )
if err != nil {
panic ( err )
}
note := NewActivityStreamsNote ( )
summaryNote := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryNote . AppendXMLSchemaString ( "John's note" )
note . SetActivityStreamsSummary ( summaryNote )
2019-02-08 08:59:10 +09:00
noteId := NewActivityStreamsIdProperty ( )
noteId . Set ( MustParseURL ( "http://notes.example.com/1" ) )
2019-02-10 05:56:00 +09:00
note . SetActivityStreamsId ( noteId )
2019-02-08 08:59:10 +09:00
contentNote := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
contentNote . AppendXMLSchemaString ( "My note" )
note . SetActivityStreamsContent ( contentNote )
2019-02-08 08:59:10 +09:00
attr := NewActivityStreamsAttributedToProperty ( )
attr . AppendIRI ( john )
2019-02-10 05:56:00 +09:00
note . SetActivityStreamsAttributedTo ( attr )
2019-02-08 08:59:10 +09:00
like := NewActivityStreamsLike ( )
summaryLike := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryLike . AppendXMLSchemaString ( "Sally liked John's note" )
like . SetActivityStreamsSummary ( summaryLike )
2019-02-08 08:59:10 +09:00
likeId := NewActivityStreamsIdProperty ( )
likeId . Set ( MustParseURL ( "http://activities.example.com/1" ) )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsId ( likeId )
2019-02-08 08:59:10 +09:00
likeActor := NewActivityStreamsActorProperty ( )
likeActor . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsActor ( likeActor )
2019-02-08 08:59:10 +09:00
published1 := NewActivityStreamsPublishedProperty ( )
published1 . Set ( t1 )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsPublished ( published1 )
2019-02-08 08:59:10 +09:00
objLike := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objLike . AppendActivityStreamsNote ( note )
like . SetActivityStreamsObject ( objLike )
2019-02-08 08:59:10 +09:00
dislike := NewActivityStreamsDislike ( )
summaryDislike := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryDislike . AppendXMLSchemaString ( "Sally disliked John's note" )
dislike . SetActivityStreamsSummary ( summaryDislike )
2019-02-08 08:59:10 +09:00
dislikeId := NewActivityStreamsIdProperty ( )
dislikeId . Set ( MustParseURL ( "http://activities.example.com/2" ) )
2019-02-10 05:56:00 +09:00
dislike . SetActivityStreamsId ( dislikeId )
2019-02-08 08:59:10 +09:00
dislikeActor := NewActivityStreamsActorProperty ( )
dislikeActor . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
dislike . SetActivityStreamsActor ( dislikeActor )
2019-02-08 08:59:10 +09:00
published2 := NewActivityStreamsPublishedProperty ( )
published2 . Set ( t2 )
2019-02-10 05:56:00 +09:00
dislike . SetActivityStreamsPublished ( published2 )
2019-02-08 08:59:10 +09:00
objDislike := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objDislike . AppendActivityStreamsNote ( note )
dislike . SetActivityStreamsObject ( objDislike )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "History of John's note" )
example155Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsLike ( like )
items . AppendActivityStreamsDislike ( dislike )
example155Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example155Type
}
const example156 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "History of John's note" ,
"type" : "Collection" ,
"items" : [
{
"summary" : "Sally liked John's note" ,
"type" : "Like" ,
"id" : "http://activities.example.com/1" ,
"actor" : "http://sally.example.org" ,
"published" : "2015-11-12T12:34:56Z" ,
"object" : {
"summary" : "John's note" ,
"type" : "Note" ,
"id" : "http://notes.example.com/1" ,
"attributedTo" : "http://john.example.org" ,
"content" : "My note"
}
} ,
{
"summary" : "Sally no longer likes John's note" ,
"type" : "Undo" ,
"id" : "http://activities.example.com/2" ,
"actor" : "http://sally.example.org" ,
"published" : "2015-12-11T21:43:56Z" ,
"object" : "http://activities.example.com/1"
}
]
} `
2019-02-10 05:56:00 +09:00
func example156Type ( ) vocab . ActivityStreamsCollection {
2019-02-08 08:59:10 +09:00
example156Type := NewActivityStreamsCollection ( )
john := MustParseURL ( "http://john.example.org" )
sally := MustParseURL ( "http://sally.example.org" )
a := MustParseURL ( "http://activities.example.com/1" )
t1 , err := time . Parse ( time . RFC3339 , "2015-11-12T12:34:56Z" )
if err != nil {
panic ( err )
}
t2 , err := time . Parse ( time . RFC3339 , "2015-12-11T21:43:56Z" )
if err != nil {
panic ( err )
}
note := NewActivityStreamsNote ( )
noteId := NewActivityStreamsIdProperty ( )
noteId . Set ( MustParseURL ( "http://notes.example.com/1" ) )
2019-02-10 05:56:00 +09:00
note . SetActivityStreamsId ( noteId )
2019-02-08 08:59:10 +09:00
summaryNote := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryNote . AppendXMLSchemaString ( "John's note" )
note . SetActivityStreamsSummary ( summaryNote )
2019-02-08 08:59:10 +09:00
attr := NewActivityStreamsAttributedToProperty ( )
attr . AppendIRI ( john )
2019-02-10 05:56:00 +09:00
note . SetActivityStreamsAttributedTo ( attr )
2019-02-08 08:59:10 +09:00
contentNote := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
contentNote . AppendXMLSchemaString ( "My note" )
note . SetActivityStreamsContent ( contentNote )
2019-02-08 08:59:10 +09:00
like := NewActivityStreamsLike ( )
likeId := NewActivityStreamsIdProperty ( )
likeId . Set ( MustParseURL ( "http://activities.example.com/1" ) )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsId ( likeId )
2019-02-08 08:59:10 +09:00
summaryLike := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryLike . AppendXMLSchemaString ( "Sally liked John's note" )
like . SetActivityStreamsSummary ( summaryLike )
2019-02-08 08:59:10 +09:00
likeActor := NewActivityStreamsActorProperty ( )
likeActor . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsActor ( likeActor )
2019-02-08 08:59:10 +09:00
published1 := NewActivityStreamsPublishedProperty ( )
published1 . Set ( t1 )
2019-02-10 05:56:00 +09:00
like . SetActivityStreamsPublished ( published1 )
2019-02-08 08:59:10 +09:00
objLike := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
objLike . AppendActivityStreamsNote ( note )
like . SetActivityStreamsObject ( objLike )
2019-02-08 08:59:10 +09:00
undo := NewActivityStreamsUndo ( )
undoId := NewActivityStreamsIdProperty ( )
undoId . Set ( MustParseURL ( "http://activities.example.com/2" ) )
2019-02-10 05:56:00 +09:00
undo . SetActivityStreamsId ( undoId )
2019-02-08 08:59:10 +09:00
summaryUndo := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summaryUndo . AppendXMLSchemaString ( "Sally no longer likes John's note" )
undo . SetActivityStreamsSummary ( summaryUndo )
2019-02-08 08:59:10 +09:00
undoActor := NewActivityStreamsActorProperty ( )
undoActor . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
undo . SetActivityStreamsActor ( undoActor )
2019-02-08 08:59:10 +09:00
published2 := NewActivityStreamsPublishedProperty ( )
published2 . Set ( t2 )
2019-02-10 05:56:00 +09:00
undo . SetActivityStreamsPublished ( published2 )
2019-02-08 08:59:10 +09:00
obj := NewActivityStreamsObjectProperty ( )
obj . AppendIRI ( a )
2019-02-10 05:56:00 +09:00
undo . SetActivityStreamsObject ( obj )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "History of John's note" )
example156Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
items := NewActivityStreamsItemsProperty ( )
2019-02-10 05:56:00 +09:00
items . AppendActivityStreamsLike ( like )
items . AppendActivityStreamsUndo ( undo )
example156Type . SetActivityStreamsItems ( items )
2019-02-08 08:59:10 +09:00
return example156Type
}
// NOTE: The `content` field has been inlined to keep within JSON spec.
const example157 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "A thank-you note" ,
"type" : "Note" ,
"content" : "Thank you <a href='http://sally.example.org'>@sally</a> for all your hard work! <a href='http://example.org/tags/givingthanks'>#givingthanks</a>" ,
"to" : {
"name" : "Sally" ,
"type" : "Person" ,
"id" : "http://sally.example.org"
} ,
"tag" : {
"id" : "http://example.org/tags/givingthanks" ,
"name" : "#givingthanks"
}
} `
var example157Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
m [ "tag" ] = map [ string ] interface { } {
"id" : "http://example.org/tags/givingthanks" ,
"name" : "#givingthanks" ,
}
return m
}
2019-02-10 05:56:00 +09:00
func example157Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example157Type := NewActivityStreamsNote ( )
person := NewActivityStreamsPerson ( )
sally := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
sally . AppendXMLSchemaString ( "Sally" )
person . SetActivityStreamsName ( sally )
2019-02-08 08:59:10 +09:00
id := NewActivityStreamsIdProperty ( )
id . Set ( MustParseURL ( "http://sally.example.org" ) )
2019-02-10 05:56:00 +09:00
person . SetActivityStreamsId ( id )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A thank-you note" )
example157Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
contentNote := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
contentNote . AppendXMLSchemaString ( "Thank you <a href='http://sally.example.org'>@sally</a> for all your hard work! <a href='http://example.org/tags/givingthanks'>#givingthanks</a>" )
example157Type . SetActivityStreamsContent ( contentNote )
2019-02-08 08:59:10 +09:00
to := NewActivityStreamsToProperty ( )
2019-02-10 05:56:00 +09:00
to . AppendActivityStreamsPerson ( person )
example157Type . SetActivityStreamsTo ( to )
2019-02-08 08:59:10 +09:00
return example157Type
}
const example158 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"name" : "A thank-you note" ,
"type" : "Note" ,
"content" : "Thank you @sally for all your hard work! #givingthanks" ,
"tag" : [
{
"type" : "Mention" ,
"href" : "http://example.org/people/sally" ,
"name" : "@sally"
} ,
{
"id" : "http://example.org/tags/givingthanks" ,
"name" : "#givingthanks"
}
]
} `
var example158Unknown = func ( m map [ string ] interface { } ) map [ string ] interface { } {
existing := m [ "tag" ]
next := map [ string ] interface { } {
"id" : "http://example.org/tags/givingthanks" ,
"name" : "#givingthanks" ,
}
m [ "tag" ] = [ ] interface { } { existing , next }
return m
}
2019-02-10 05:56:00 +09:00
func example158Type ( ) vocab . ActivityStreamsNote {
2019-02-08 08:59:10 +09:00
example158Type := NewActivityStreamsNote ( )
u := MustParseURL ( "http://example.org/people/sally" )
mention := NewActivityStreamsMention ( )
hrefLink := NewActivityStreamsHrefProperty ( )
hrefLink . Set ( u )
2019-02-10 05:56:00 +09:00
mention . SetActivityStreamsHref ( hrefLink )
2019-02-08 08:59:10 +09:00
mentionName := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
mentionName . AppendXMLSchemaString ( "@sally" )
mention . SetActivityStreamsName ( mentionName )
2019-02-08 08:59:10 +09:00
name := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
name . AppendXMLSchemaString ( "A thank-you note" )
example158Type . SetActivityStreamsName ( name )
2019-02-08 08:59:10 +09:00
contentNote := NewActivityStreamsContentProperty ( )
2019-02-10 05:56:00 +09:00
contentNote . AppendXMLSchemaString ( "Thank you @sally for all your hard work! #givingthanks" )
example158Type . SetActivityStreamsContent ( contentNote )
2019-02-08 08:59:10 +09:00
tag := NewActivityStreamsTagProperty ( )
2019-02-10 05:56:00 +09:00
tag . AppendActivityStreamsMention ( mention )
example158Type . SetActivityStreamsTag ( tag )
2019-02-08 08:59:10 +09:00
return example158Type
}
const example159 = ` {
"@context" : "https://www.w3.org/ns/activitystreams" ,
"summary" : "Sally moved the sales figures from Folder A to Folder B" ,
"type" : "Move" ,
"actor" : "http://sally.example.org" ,
"object" : {
"type" : "Document" ,
"name" : "sales figures"
} ,
"origin" : {
"type" : "Collection" ,
"name" : "Folder A"
} ,
"target" : {
"type" : "Collection" ,
"name" : "Folder B"
}
} `
2019-02-10 05:56:00 +09:00
func example159Type ( ) vocab . ActivityStreamsMove {
2019-02-08 08:59:10 +09:00
example159Type := NewActivityStreamsMove ( )
sally := MustParseURL ( "http://sally.example.org" )
obj := NewActivityStreamsDocument ( )
nameObj := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
nameObj . AppendXMLSchemaString ( "sales figures" )
obj . SetActivityStreamsName ( nameObj )
2019-02-08 08:59:10 +09:00
origin := NewActivityStreamsCollection ( )
nameOrigin := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
nameOrigin . AppendXMLSchemaString ( "Folder A" )
origin . SetActivityStreamsName ( nameOrigin )
2019-02-08 08:59:10 +09:00
target := NewActivityStreamsCollection ( )
nameTarget := NewActivityStreamsNameProperty ( )
2019-02-10 05:56:00 +09:00
nameTarget . AppendXMLSchemaString ( "Folder B" )
target . SetActivityStreamsName ( nameTarget )
2019-02-08 08:59:10 +09:00
summary := NewActivityStreamsSummaryProperty ( )
2019-02-10 05:56:00 +09:00
summary . AppendXMLSchemaString ( "Sally moved the sales figures from Folder A to Folder B" )
example159Type . SetActivityStreamsSummary ( summary )
2019-02-08 08:59:10 +09:00
objectActor := NewActivityStreamsActorProperty ( )
objectActor . AppendIRI ( sally )
2019-02-10 05:56:00 +09:00
example159Type . SetActivityStreamsActor ( objectActor )
2019-02-08 08:59:10 +09:00
object := NewActivityStreamsObjectProperty ( )
2019-02-10 05:56:00 +09:00
object . AppendActivityStreamsDocument ( obj )
example159Type . SetActivityStreamsObject ( object )
2019-02-08 08:59:10 +09:00
originProp := NewActivityStreamsOriginProperty ( )
2019-02-10 05:56:00 +09:00
originProp . AppendActivityStreamsCollection ( origin )
example159Type . SetActivityStreamsOrigin ( originProp )
2019-02-08 08:59:10 +09:00
tobj := NewActivityStreamsTargetProperty ( )
2019-02-10 05:56:00 +09:00
tobj . AppendActivityStreamsCollection ( target )
example159Type . SetActivityStreamsTarget ( tobj )
2019-02-08 08:59:10 +09:00
return example159Type
}