Packages

p

org.coursera

naptime

package naptime

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. trait DangerousAccessToUnderlyingRequest extends AnyRef
  2. sealed trait ETag extends AnyRef

    Resources should always use weak validators because Naptime does not guarantee byte-equality between responses.

    Resources should always use weak validators because Naptime does not guarantee byte-equality between responses. See ETag.Weak.

  3. trait Errors extends AnyRef

    Error responses.

    Error responses. Note: These error responses are special exceptions that can be caught by the framework. They are not designed to work outside the framework.

  4. case class FacetField(facetEntries: Seq[FacetFieldValue], fieldCardinality: Option[Long]) extends Product with Serializable

    Contains all of the information relating to a facet in a sophisticated search.

    Contains all of the information relating to a facet in a sophisticated search.

    facetEntries

    An ordered (potentially partial) list of facet entries.

    fieldCardinality

    Not all potential values for this facet may be included. The fieldCardinality is the count of all possible different values for this facet.

  5. case class FacetFieldValue(id: String, name: Option[String], count: Long) extends Product with Serializable

    Information about one particular choice of value for one particular facet.

    Information about one particular choice of value for one particular facet.

    id

    The id or code for this facet value.

    name

    The display name for this facet value.

    count

    The number of results for this facet.

  6. sealed trait FieldsFunction extends (RequestHeader, QueryFields) ⇒ QueryFields
  7. case class NaptimeActionException(httpCode: Int, errorCode: Option[String], message: Option[String], details: Option[JsValue] = None, cause: Option[Throwable] = None) extends RuntimeException with Product with Serializable

    Throw to break out of a Naptime action body on error.

  8. trait NaptimeModule extends BinderExposer with ScalaModule

    Inherit from this trait to bind resources and schema types.

    Inherit from this trait to bind resources and schema types.

    Naptime builds upon Guice to discover and find all resources in the service, as well as to discover the reverse mappings from high-level class types to their wire representations.

  9. final case class Ok[+T](content: T, related: Map[ResourceName, Related[_, _]] = Map.empty, pagination: Option[ResponsePagination] = None, eTag: Option[ETag] = None) extends RestResponse[T] with Product with Serializable
  10. case class PaginationConfiguration(defaultLimit: Int = 100) extends Product with Serializable

    Configure the defaults for pagination.

  11. final case class Redirect(url: String, isTemporary: Boolean) extends RestResponse[Nothing] with Product with Serializable
  12. trait RequestFields extends AnyRef

    Passed to Resources so if there are certain fields that require more work to fetch, they can skip that work if the request does not include it.

    Passed to Resources so if there are certain fields that require more work to fetch, they can skip that work if the request does not include it.

    Note: the API is intentionally severely constrained to allow for future flexibility and internal changes to the Naptime framework.

  13. trait RequestIncludes extends AnyRef

    Passed to Resources so if there are certain related objects that require more work to fetch, they can skip that work if the request does not ask for those related resources.

    Passed to Resources so if there are certain related objects that require more work to fetch, they can skip that work if the request does not ask for those related resources.

    Note: the API is intentionally severely constrained to allow for future flexibility and internal changes to the Naptime framework.

  14. case class RequestPagination(limit: Int, start: Option[String], isDefault: Boolean) extends Product with Serializable

    Calculates the request pagination.

    Calculates the request pagination.

    TODO: URL-safe base64 encoding

  15. sealed case class ResourceFields[T](defaultFields: Set[String], fieldsPermissionsFunction: FieldsFunction, relations: Map[String, ResourceName], graphQLRelations: Map[String, GraphQLRelation])(implicit format: OFormat[T]) extends Product with Serializable

    Contains all the required information related to a resource's fields.

    Contains all the required information related to a resource's fields.

    T

    The type of the resource in the collection.

    defaultFields

    The default fields that should be included in a response.

    fieldsPermissionsFunction

    A function that, given a request header, determines if particular fields are to be included in the response. This function can be used to hide particular fields depending on arbitrary information about the request. (e.g. Sensitive fields can be made unavailable in certain contexts. (e.g. CORS, 3rd party requests to APIs, JSONP, etc.) IMPORTANT NOTE: this functionality is not fully implemented yet! WORK IN PROGRESS. DO NOT USE YET!

    relations

    A map of field name to related resource's name and version pair. This configuration is used to automatically join related resources as requested. For example, if we have an "author" id field that references the "userBasicProfile" v1 resource, and a "post" id field that references a "discoursePost" v1 the map would look like: Map("author" -> ("userBasicProfile", 1), "post" -> ("discoursePost", 1)).

    format

    The JSON serialization formatter for the resource.

    Annotations
    @implicitNotFound( ... )
  16. case class ResourceName(topLevelName: String, version: Int, resourcePath: Seq[String] = List.empty) extends Product with Serializable

    The structured name + version + path of a resource.

    The structured name + version + path of a resource.

    topLevelName

    The first top level name.

    version

    The version of the top level resource.

    resourcePath

    The names of path selectors.

  17. case class ResponsePagination(next: Option[String], total: Option[Long] = None, facets: Option[Map[String, FacetField]] = None) extends Product with Serializable

    If there are subsequent pages, include a next 'pointer'.

    If there are subsequent pages, include a next 'pointer'. This is opaque to clients.

    TODO: consider base64 encoding over the wire for safety.

    facets

    If present, a map of field name to facet information.

  18. class RestContext[+AuthType, +BodyType] extends AnyRef

    All the contextual information about a naptime request.

  19. final case class RestError(error: NaptimeActionException) extends RestResponse[Nothing] with Product with Serializable
  20. sealed abstract class RestResponse[+T] extends AnyRef
  21. case class FinderGraphQLRelation(resourceName: ResourceName, finderName: String, arguments: Map[String, String] = Map.empty, description: String = "", authOverride: Option[AuthOverride] = None) extends GraphQLRelation with Product with Serializable
    Annotations
    @deprecated
    Deprecated

    (Since version 2019-12-16) Coursera is moving away from automatic GraphQL inclusion. Reach out in the #graphql channel if you need guidance.

  22. case class GetGraphQLRelation(resourceName: ResourceName, id: String, arguments: Map[String, String] = Map.empty, description: String = "", authOverride: Option[AuthOverride] = None) extends GraphQLRelation with Product with Serializable
    Annotations
    @deprecated
    Deprecated

    (Since version 2019-12-16) Coursera is moving away from automatic GraphQL inclusion. Reach out in the #graphql channel if you need guidance.

  23. trait GraphQLRelation extends AnyRef
    Annotations
    @deprecated
    Deprecated

    (Since version 2019-12-16) Coursera is moving away from automatic GraphQL inclusion. Reach out in the #graphql channel if you need guidance.

  24. case class MultiGetGraphQLRelation(resourceName: ResourceName, ids: String, arguments: Map[String, String] = Map.empty, description: String = "", authOverride: Option[AuthOverride] = None) extends GraphQLRelation with Product with Serializable
    Annotations
    @deprecated
    Deprecated

    (Since version 2019-12-16) Coursera is moving away from automatic GraphQL inclusion. Reach out in the #graphql channel if you need guidance.

  25. sealed trait RequestEvidence extends AnyRef

    Marker trait to try and hide access to the underlying Play request.

    Marker trait to try and hide access to the underlying Play request.

    Annotations
    @implicitNotFound( ... ) @deprecated
    Deprecated

    This is not used in Naptime anymore.

  26. case class SingleElementFinderGraphQLRelation(resourceName: ResourceName, finderName: String, arguments: Map[String, String] = Map.empty, description: String = "", authOverride: Option[AuthOverride] = None) extends GraphQLRelation with Product with Serializable
    Annotations
    @deprecated
    Deprecated

    (Since version 2019-12-16) Coursera is moving away from automatic GraphQL inclusion. Reach out in the #graphql channel if you need guidance.

Value Members

  1. object ETag
  2. object Errors extends Errors
  3. object FacetField extends Serializable
  4. object FacetFieldValue extends Serializable
  5. object FieldsFunction
  6. object NaptimeActionException extends Serializable
  7. object NaptimeModule extends AbstractModule with ScalaModule

    Install this singleton module into your service to configure Naptime defaults to ensure a successful boot.

    Install this singleton module into your service to configure Naptime defaults to ensure a successful boot.

    install(NaptimeModule)

    Note: as of writing this comment, there is no need to install this module in your service for correct operation.

  8. object Ok extends Serializable
  9. object RequestFields
  10. object RequestPagination extends Serializable
  11. object ResourceFields extends Serializable
  12. object ResourceName extends Serializable
  13. object ResponsePagination extends Serializable
  14. object SchemaUtils

    Helpers for working with Courier/Pegasus Schemas.

  15. object Types extends StrictLogging

Ungrouped