coarnotify.patterns

All the COAR Notify pattern objects are defined in this module.

Some of the pattern objects have supporting objects in their individual submodules

Submodules

Classes

Accept

Class to represent an Accept notification

AnnounceEndorsement

Class to represent an Announce Endorsement pattern

AnnounceRelationship

Class to represent an Announce Relationship notification

AnnounceReview

Class to represent Announce Review pattern

AnnounceServiceResult

Class to represent the Announce Service Result Pattern

Reject

Class to represent a Reject notification

RequestEndorsement

Class to represent a Request Endorsement notification

RequestReview

Class to represent a Request Review notification

TentativelyAccept

Class to represent a Tentative Accept notification

TentativelyReject

Class to represent a Tentative Reject notification

UndoOffer

Class to represent the Undo Offer notification

UnprocessableNotification

Class to represent the Unprocessable Notification notification

Package Contents

class coarnotify.patterns.Accept(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NestedPatternObjectMixin, coarnotify.core.notify.NotifyPattern

Class to represent an Accept notification

validate() bool

Validate the Accept pattern.

In addition to the base validation, this:

  • Makes inReplyTo required

  • Requires the inReplyTo value to be the same as the object.id value

Returns:

True if valid, otherwise raises a coarnotify.exceptions.ValidationError

TYPE

The Accept type

class coarnotify.patterns.AnnounceEndorsement(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NotifyPattern

Class to represent an Announce Endorsement pattern

validate() bool

Extends the base validation to make context required

Returns:

True if valid, otherwise raises coarnotify.exceptions.ValidationError

TYPE

Announce Endorsement type, consisting of Activity Streams Announce and Notify Endorsement Action

property context: AnnounceEndorsementContext | None

Get a context specific to Announce Endorsement

Returns:

The Announce Endorsement context object

class coarnotify.patterns.AnnounceRelationship(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NotifyPattern

Class to represent an Announce Relationship notification

validate() bool

Extends the base validation to make context required

Returns:

True if valid, otherwise raises coarnotify.exceptions.ValidationError

TYPE

Announce Relationship types, including an ActivityStreams announce and a COAR Notify Relationship Action

property object: AnnounceRelationshipObject | None

Custom getter to retrieve the object property as an AnnounceRelationshipObject

class coarnotify.patterns.AnnounceReview(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NotifyPattern

Class to represent Announce Review pattern

validate() bool

Extends the base validation to make context required

Returns:

True if valid, otherwise raises coarnotify.exceptions.ValidationError

TYPE

Announce Review type, including Acitivity Streams Announce and Notify Review Action

property context: AnnounceReviewContext | None

Custom getter to retrieve AnnounceReview Context

Returns:

AnnounceReviewContext

property object: AnnounceReviewObject | None

Custom getter to retrieve Announce Review object

Returns:

Announce Review Object

class coarnotify.patterns.AnnounceServiceResult(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NotifyPattern

Class to represent the Announce Service Result Pattern

validate() bool

Extends the base validation to make context required

Returns:

True if valid, otherwise raises coarnotify.exceptions.ValidationError

TYPE

Announce Service Result type, the ActivityStreams Announce type

property context: AnnounceServiceResultContext | None

Custom getter to retrieve the context property as an AnnounceServiceResultContext

Returns:

AnnounceSericeResultCOntext

property object: AnnounceServiceResultObject | None

Custom getter to retrieve the object property as an AnnounceServiceResultObject

Returns:

AnnounceServiceResultObject

class coarnotify.patterns.Reject(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NestedPatternObjectMixin, coarnotify.core.notify.NotifyPattern, coarnotify.core.notify.SummaryMixin

Class to represent a Reject notification

validate() bool

In addition to the base validation apply the following constraints:

  • The inReplyTo property is required

  • The inReplyTo value must match the object.id value

Returns:

True if the validation passes, otherwise raise a ValidationError

TYPE

Reject type, the ActivityStreams Reject type

class coarnotify.patterns.RequestEndorsement(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NotifyPattern

Class to represent a Request Endorsement notification

TYPE

Request Endorsement types, including an ActivityStreams offer and a COAR Notify Endorsement Action

property object: RequestEndorsementObject | None

Custom getter to retrieve the object property as a RequestEndorsementObject

Returns:

class coarnotify.patterns.RequestReview(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NotifyPattern

Class to represent a Request Review notification

TYPE

Request Review types, including an ActivityStreams offer and a COAR Notify Review Action

property object: RequestReviewObject | None

Custom getter to retrieve the object property as a RequestReviewObject :return:

class coarnotify.patterns.TentativelyAccept(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NestedPatternObjectMixin, coarnotify.core.notify.NotifyPattern, coarnotify.core.notify.SummaryMixin

Class to represent a Tentative Accept notification

validate() bool

In addition to the base validation apply the following constraints:

  • The inReplyTo property is required

  • The inReplyTo value must match the object.id value

Returns:

TYPE

Tentative Accept type, the ActivityStreams Tentative Accept type

class coarnotify.patterns.TentativelyReject(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NestedPatternObjectMixin, coarnotify.core.notify.NotifyPattern, coarnotify.core.notify.SummaryMixin

Class to represent a Tentative Reject notification

validate() bool

In addition to the base validation apply the following constraints:

  • The inReplyTo property is required

  • The inReplyTo value must match the object.id value

Returns:

TYPE

Tentative Reject type, the ActivityStreams Tentative Reject type

class coarnotify.patterns.UndoOffer(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NestedPatternObjectMixin, coarnotify.core.notify.NotifyPattern, coarnotify.core.notify.SummaryMixin

Class to represent the Undo Offer notification

validate() bool

In addition to the base validation apply the following constraints:

  • The inReplyTo property is required

  • The inReplyTo value must match the object.id value

Returns:

TYPE

Undo Offer type, the ActivityStreams Undo type

class coarnotify.patterns.UnprocessableNotification(stream: coarnotify.core.activitystreams2.ActivityStream | dict = None, validate_stream_on_construct=True, validate_properties=True, validators=None, validation_context=None, properties_by_reference=True)

Bases: coarnotify.core.notify.NotifyPattern, coarnotify.core.notify.SummaryMixin

Class to represent the Unprocessable Notification notification

validate() bool

In addition to the base validation apply the following constraints:

  • The inReplyTo property is required

  • The summary property is required

Returns:

TYPE

Unprocessable Notification types, including an ActivityStreams Flag and a COAR Notify Unprocessable Notification