Trait

org.coursera.naptime.resources

TopLevelCollectionResource

Related Doc: package resources

Permalink

trait TopLevelCollectionResource[K, M] extends CollectionResource[RootResource, K, M]

All collection resource that are not a sub-resource of any other resource should extend this.

Nested resources should extend the standard CollectionResource trait, supplying the parent resource as the first type parameter.

Linear Supertypes
CollectionResource[RootResource, K, M], Resource[M], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TopLevelCollectionResource
  2. CollectionResource
  3. Resource
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. type AncestorKeys = RootResource.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], RootResource.PathKey]

    Permalink
    Definition Classes
    CollectionResource
  4. abstract type PathKey <: :::[KeyType, RootResource.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 def keyFormat: KeyFormat[KeyType]

    Permalink
    Definition Classes
    CollectionResource
  2. implicit abstract def resourceFormat: OFormat[M]

    Permalink
    Definition Classes
    Resource
  3. 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. def Fields: Fields[M]

    Permalink
    Definition Classes
    Resource
  5. 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
  6. def OkIfPresent(key: K, maybeElement: Option[M]): RestResponse[Keyed[K, M]]

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

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

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

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

    Permalink
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  19. 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
  20. val parentResource: RootResource

    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] {
      // ...
    }
    Definition Classes
    TopLevelCollectionResourceCollectionResource
  21. def resourceVersion: Int

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

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

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

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

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

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

Inherited from CollectionResource[RootResource, K, M]

Inherited from Resource[M]

Inherited from AnyRef

Inherited from Any

Ungrouped