2019-10-20 07:45:12 +09:00
// Code generated by astool. DO NOT EDIT.
2019-01-30 06:28:40 +09:00
package streams
import (
"context"
"errors"
vocab "github.com/go-fed/activity/streams/vocab"
)
// TypePredicatedResolver resolves ActivityStreams values if the value satisfies a
// predicate condition based on its type.
type TypePredicatedResolver struct {
delegate Resolver
predicate interface { }
}
// NewTypePredicatedResolver creates a new Resolver that applies a predicate to an
// ActivityStreams value to determine whether to Resolve or not. The
// ActivityStreams value's type is examined to determine if the predicate can
// apply itself to the value. This guarantees the predicate will receive a
// concrete value whose underlying ActivityStreams type matches the concrete
// interface name. The predicate function must be of the form:
//
// func(context.Context, <TypeInterface>) (bool, error)
//
// where TypeInterface is the code-generated interface for an ActivityStreams
// type. An error is returned if the predicate does not match this signature.
func NewTypePredicatedResolver ( delegate Resolver , predicate interface { } ) ( * TypePredicatedResolver , error ) {
// The predicate must satisfy one known predicate function signature, or else we will generate a runtime error instead of silently fail.
switch predicate . ( type ) {
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsAccept ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsActivity ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsAdd ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsAnnounce ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsApplication ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsArrive ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsArticle ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsAudio ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsBlock ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsCollection ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsCollectionPage ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsCreate ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsDelete ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsDislike ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsDocument ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsEvent ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsFlag ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsFollow ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsGroup ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsIgnore ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsImage ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsIntransitiveActivity ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsInvite ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsJoin ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsLeave ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsLike ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsLink ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsListen ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsMention ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsMove ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsNote ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsObject ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsOffer ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsOrderedCollection ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsOrderedCollectionPage ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsOrganization ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsPage ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsPerson ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsPlace ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsProfile ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-09-17 05:49:31 +09:00
case func ( context . Context , vocab . W3IDSecurityV1PublicKey ) ( bool , error ) :
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsQuestion ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsRead ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsReject ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsRelationship ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsRemove ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsService ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsTentativeAccept ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsTentativeReject ) ( bool , error ) :
2019-02-05 06:29:04 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsTombstone ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsTravel ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsUndo ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsUpdate ) ( bool , error ) :
2019-02-05 06:29:04 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsVideo ) ( bool , error ) :
2019-02-05 06:29:04 +09:00
// Do nothing, this predicate has a correct signature.
2019-02-10 05:56:00 +09:00
case func ( context . Context , vocab . ActivityStreamsView ) ( bool , error ) :
2019-01-30 06:28:40 +09:00
// Do nothing, this predicate has a correct signature.
default :
return nil , errors . New ( "the predicate function is of the wrong signature and would never be called" )
}
return & TypePredicatedResolver {
delegate : delegate ,
predicate : predicate ,
} , nil
}
// Apply uses a predicate to determine whether to resolve the ActivityStreams
// value. The predicate's signature is matched with the ActivityStreams
// value's type. This strictly assures that the predicate will only be passed
// ActivityStream objects whose type matches its interface. Returns an error
// if the ActivityStreams type does not match the predicate, is not a type
// handled by the generated code, or the resolver returns an error. Returns
// true if the predicate returned true.
func ( this TypePredicatedResolver ) Apply ( ctx context . Context , o ActivityStreamsInterface ) ( bool , error ) {
var predicatePasses bool
var err error
2019-04-13 07:00:52 +09:00
if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Accept" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsAccept ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsAccept ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Activity" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsActivity ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsActivity ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Add" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsAdd ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsAdd ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Announce" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsAnnounce ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsAnnounce ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Application" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsApplication ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsApplication ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Arrive" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsArrive ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsArrive ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Article" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsArticle ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsArticle ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Audio" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsAudio ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsAudio ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( c tx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Block" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsBlock ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsBlock ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Collection" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsCollection ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsCollection ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "CollectionPage" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsCollectionPage ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsCollectionPage ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Create" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsCreate ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsCreate ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Delete" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsDelete ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsDelete ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Dislike" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsDislike ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsDislike ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Document" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsDocument ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsDocument ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Event" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsEvent ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsEvent ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Flag" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsFlag ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsFlag ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Follow" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsFollow ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsFollow ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Group" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsGroup ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsGroup ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Ignore" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsIgnore ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsIgnore ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Image" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsImage ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsImage ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "IntransitiveActivity" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsIntransitiveActivity ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsIntransitiveActivity ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Invite" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsInvite ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsInvite ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Join" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsJoin ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsJoin ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Leave" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsLeave ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsLeave ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Like" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsLike ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsLike ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Link" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsLink ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsLink ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Listen" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsListen ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsListen ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Mention" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsMention ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsMention ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Move" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsMove ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsMove ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Note" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsNote ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsNote ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Object" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsObject ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsObject ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Offer" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsOffer ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsOffer ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "OrderedCollection" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsOrderedCollection ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsOrderedCollection ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "OrderedCollectionPage" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsOrderedCollectionPage ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsOrderedCollectionPage ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Organization" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsOrganization ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsOrganization ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Page" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsPage ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsPage ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Person" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsPerson ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsPerson ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Place" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsPlace ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsPlace ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Profile" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsProfile ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsProfile ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-09-17 05:49:31 +09:00
} else if o . VocabularyURI ( ) == "https://w3id.org/security/v1" && o . GetTypeName ( ) == "PublicKey" {
if fn , ok := this . predicate . ( func ( context . Context , vocab . W3IDSecurityV1PublicKey ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . W3IDSecurityV1PublicKey ) ; ok {
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Question" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsQuestion ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsQuestion ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Read" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsRead ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsRead ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Reject" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsReject ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsReject ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Relationship" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsRelationship ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsRelationship ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Remove" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsRemove ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsRemove ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Service" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsService ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsService ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "TentativeAccept" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsTentativeAccept ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsTentativeAccept ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "TentativeReject" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsTentativeReject ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsTentativeReject ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Tombstone" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsTombstone ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsTombstone ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Travel" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsTravel ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsTravel ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Undo" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsUndo ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsUndo ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Update" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsUpdate ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsUpdate ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "Video" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsVideo ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsVideo ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-04-13 07:00:52 +09:00
} else if o . VocabularyURI ( ) == "https://www.w3.org/ns/activitystreams" && o . GetTypeName ( ) == "View" {
2019-02-10 05:56:00 +09:00
if fn , ok := this . predicate . ( func ( context . Context , vocab . ActivityStreamsView ) ( bool , error ) ) ; ok {
if v , ok := o . ( vocab . ActivityStreamsView ) ; ok {
2019-01-30 06:28:40 +09:00
predicatePasses , err = fn ( ctx , v )
} else {
// This occurs when the value is either not a go-fed type and is improperly satisfying various interfaces, or there is a bug in the go-fed generated code.
return false , errCannotTypeAssertType
}
} else {
return false , ErrPredicateUnmatched
}
2019-02-10 05:56:00 +09:00
} else {
2019-01-30 06:28:40 +09:00
return false , ErrUnhandledType
}
if err != nil {
return predicatePasses , err
}
if predicatePasses {
return true , this . delegate . Resolve ( ctx , o )
} else {
return false , nil
}
}