Class

org.coursera.naptime.resources

NestedCourierCollectionResource

Related Doc: package resources

Permalink

abstract class NestedCourierCollectionResource[ParentResource <: Resource[_], K, M <: ScalaRecordTemplate] extends CollectionResource[ParentResource, K, M]

If the resource is a courier model, extending from NestedCourierCollectionResource removes some boilerplate.

Aside from automating some of the boilerplate away, it functions the same as a standard CollectionResource. If the resource is a top level resource, check out the CourierCollectionResource abstract class.

To configure customized fields, use the following snippet:

override implicit lazy val Fields = super.FIelds.withRelated(...)
ParentResource

The parent resource (for nesting purposes). If it is a top level, check out: CourierCollectionResource

K

The key type of the resource.

M

The "value" type of the resource.

Linear Supertypes
CollectionResource[ParentResource, K, M], Resource[M], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NestedCourierCollectionResource
  2. CollectionResource
  3. Resource
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NestedCourierCollectionResource()(implicit kf: KeyFormat[K], classTag: ClassTag[M], ec: ExecutionContext, mat: Materializer)

    Permalink

    kf

    The KeyFormat for the key type in the resource.

    classTag

    The concrete class tag for the value type in the resource.

Type Members

  1. type AncestorKeys = ParentResource.PathKey

    Permalink

    The (Hlist-like) collection of ancestor keys has this type.

    The (Hlist-like) collection of ancestor keys has this type.

    Definition Classes
    CollectionResource
  2. type KeyType = K

    Permalink
    Definition Classes
    CollectionResource
  3. abstract type OptPathKey <: :::[Option[KeyType], ParentResource.PathKey]

    Permalink
    Definition Classes
    CollectionResource
  4. abstract type PathKey <: :::[KeyType, ParentResource.PathKey]

    Permalink

    The (HList-like) collection of all keys that identifies a single element of this collection.

    The (HList-like) collection of all keys that identifies a single element of this collection.

    Definition Classes
    CollectionResourceResource
  5. abstract type PathParser <: PathKeyParser[PathKey]

    Permalink
    Definition Classes
    Resource

Abstract Value Members

  1. abstract val parentResource: ParentResource

    Permalink

    A references to the parent resource (used to construct the path key parser).

    A references to the parent resource (used to construct the path key parser).

    Must be implemented in the resources that this trait is mixed into, typically with a val param.

    class MyNestedResource @Inject() (
        val parentResource: MyParentResource)
      extends CollectionResource[KeyType, ElemType]
      with NestedCollection[MyParentResource, KeyType] {
      // ...
    }
    Attributes
    protected[this]
    Definition Classes
    CollectionResource
  2. abstract def resourceName: String

    Permalink
    Definition Classes
    Resource

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final lazy val BaseFields: Fields[M]

    Permalink
    Attributes
    protected[this]
  5. implicit def Fields: Fields[M]

    Permalink
  6. def Nap[RACType, ResponseType]: RestActionBuilder[RACType, Unit, AnyContent, K, M, ResponseType]

    Permalink

    Helper to easily construct Naptime actions.

    Helper to easily construct Naptime actions.

    Typically, all actions in a naptime resource will all use the same auth parser and policy, or will want to use the same error handling function for all requests. These resources should do something similar to the following:

    class MyResource extends TopLevelCollectionResource[MyKeyType, MyValueType] {
      def Rest[RACType, ResponseType] =
        Nap[RACType, ResponseType].auth(myAuthPolicy).catching(errorFn)
    
    ...
    }
    Definition Classes
    CollectionResource
  7. def OkIfPresent(key: K, maybeElement: Option[M]): RestResponse[Keyed[K, M]]

    Permalink
    Definition Classes
    CollectionResource
  8. def OkIfPresent[T](a: Option[T]): RestResponse[T]

    Permalink
    Definition Classes
    CollectionResource
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. implicit val executionContext: ExecutionContext

    Permalink
    Attributes
    protected
    Definition Classes
    NestedCourierCollectionResourceCollectionResource
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. implicit final val keyFormat: KeyFormat[K]

    Permalink
  19. implicit val materializer: Materializer

    Permalink
    Attributes
    protected
    Definition Classes
    NestedCourierCollectionResourceCollectionResource
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. implicit val paginationConfiguration: PaginationConfiguration

    Permalink

    Provide a default pagination configuration for the resource that users can override and configure as needed.

    Provide a default pagination configuration for the resource that users can override and configure as needed.

    Definition Classes
    CollectionResource
  24. implicit final lazy val resourceFormat: OFormat[M]

    Permalink
  25. def resourceVersion: Int

    Permalink
    Definition Classes
    Resource
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CollectionResource[ParentResource, K, M]

Inherited from Resource[M]

Inherited from AnyRef

Inherited from Any

Ungrouped