Trait

ru.pavkin.todoist.api.core

AuthorizedAPI

Related Doc: package core

Permalink

trait AuthorizedAPI[F[_], P[_], Base] extends AnyRef

Authorized API client that is entitled to perform most of the API calls.

Methods are separated into two groups:

- get methods, for querying resources - perform methods, for sending commands

All the implicit parameters for those methods are usually supplied by the imported API suite, e.g.:

import ru.pavkin.todoist.api.dispatch.circe.default._

All methods return request definition containers, that are not yet executed. To execute a request definition, you have to call execute method on it.

Request definitions can be chained together to compose a multiple entity request. Chaining is done with and method, e.g.:

api.get[Projects].and[Labels].and[Tasks]
api.getAll[Projects :: Labels :: HNil].and[Tasks]
api.perform(AddProject("p1")).and(AddProject("p2"))
api.performAll(AddProject("p1") :+ AddProject("p2"))
Source
AuthorizedAPI.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AuthorizedAPI
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def get[R](implicit IR: HasRawRequest[R], parser: SingleResponseDecoder[P, Base, R]): SingleQueryDefinition[F, P, R, Base]

    Permalink

    Returns a single resource request definition, that after being executed will return the resource of type R

  2. abstract def getAll[R <: HList](implicit IR: HasRawRequest[R], ID: IsDistinctConstraint[R], parser: MultipleResponseDecoder[P, Base, R]): MultipleQueryDefinition[F, P, R, Base]

    Permalink

    Returns a multiple resources request definition, that after being executed will return an HList of resources, specified in phantom type parameter R

    Returns a multiple resources request definition, that after being executed will return an HList of resources, specified in phantom type parameter R

    Example usage:

    api.getAll[Projects :: Labels :: Tasks :: HNil]
    // will return List[Projects] :: List[Labels] :: List[Tasks] :: HNil upon execution

    Syntax helpers are available for working with multiple resources response. After handling the API effect, you can call these methods on the result:

    res.projects // returns List[Project]
    res.labels // returns List[Label]
    // ...
    // etc, but only for resources that were requested

    For syntax helpers to be available, you should import the syntax toolkit, for example:

    import ru.pavkin.todoist.api.dispatch.circe.default.syntax._
    Note

    Doesn't allow to specify duplicate resources.

  3. abstract def perform[C, R](command: C)(implicit trr: ToRawRequest[C], cr: Aux[C, R], parser: Aux[P, C, Base, R]): SingleCommandDefinition[F, P, C, R, Base]

    Permalink

    Returns a single command request definition, that when being executed performs a supplied command: C and returns command result of type R.

    Returns a single command request definition, that when being executed performs a supplied command: C and returns command result of type R.

    All command results are successors of ru.pavkin.todoist.api.core.model.TodoistCommandResult:

    - For ru.pavkin.todoist.api.core.model.SimpleCommand returns ru.pavkin.todoist.api.core.model.CommandResult - For ru.pavkin.todoist.api.core.model.TempIdCommand returns ru.pavkin.todoist.api.core.model.TempIdCommandResult

    command

    Command to execute within the request

  4. abstract def performAll[C <: HList, R <: HList, CR <: HList](commands: C)(implicit R: Aux[C, CR], trr: ToRawRequest[CR], cr: Aux[CR, R], parser: Aux[P, CR, Base, R]): MultipleCommandDefinition[F, P, CR, R, Base]

    Permalink

    Returns a multiple commands request definition, that when being executed performs all supplied commands and returns an HList of corresponding command results.

    Returns a multiple commands request definition, that when being executed performs all supplied commands and returns an HList of corresponding command results. See AuthorizedAPI.perform method docs for command results details

    Syntax helpers are available for multiple command results response. After handling the API effect, you can call these methods on the result:

    res.resultFor(_0) // returns strictly typed result of the first command on the list
    res.resultFor(_1) // returns strictly typed result of the seconds command on the list
    // ...
    // and so on, but only for the amount of commands that was actually sent
    
    res.resultFor(uuid:UUID) // tries to find result for command with specific uuid
    // returns an Option[TodoistCommandResult]

    For syntax helpers to be available, you should import the syntax toolkit, for example:

    import ru.pavkin.todoist.api.dispatch.circe.default.syntax._
    commands

    HList of commands to execute

Concrete Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from AuthorizedAPI[F, P, Base] to any2stringadd[AuthorizedAPI[F, P, Base]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (AuthorizedAPI[F, P, Base], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from AuthorizedAPI[F, P, Base] to ArrowAssoc[AuthorizedAPI[F, P, Base]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (AuthorizedAPI[F, P, Base]) ⇒ Boolean, msg: ⇒ Any): AuthorizedAPI[F, P, Base]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AuthorizedAPI[F, P, Base] to Ensuring[AuthorizedAPI[F, P, Base]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (AuthorizedAPI[F, P, Base]) ⇒ Boolean): AuthorizedAPI[F, P, Base]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AuthorizedAPI[F, P, Base] to Ensuring[AuthorizedAPI[F, P, Base]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): AuthorizedAPI[F, P, Base]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AuthorizedAPI[F, P, Base] to Ensuring[AuthorizedAPI[F, P, Base]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): AuthorizedAPI[F, P, Base]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AuthorizedAPI[F, P, Base] to Ensuring[AuthorizedAPI[F, P, Base]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from AuthorizedAPI[F, P, Base] to StringFormat[AuthorizedAPI[F, P, Base]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  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( ... )
  27. def [B](y: B): (AuthorizedAPI[F, P, Base], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from AuthorizedAPI[F, P, Base] to ArrowAssoc[AuthorizedAPI[F, P, Base]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from AuthorizedAPI[F, P, Base] to any2stringadd[AuthorizedAPI[F, P, Base]]

Inherited by implicit conversion StringFormat from AuthorizedAPI[F, P, Base] to StringFormat[AuthorizedAPI[F, P, Base]]

Inherited by implicit conversion Ensuring from AuthorizedAPI[F, P, Base] to Ensuring[AuthorizedAPI[F, P, Base]]

Inherited by implicit conversion ArrowAssoc from AuthorizedAPI[F, P, Base] to ArrowAssoc[AuthorizedAPI[F, P, Base]]

Ungrouped