t

dynamics.http

AllInstances

trait AllInstances extends MultipartInstances with EntityEncoderInstances with EntityDecoderInstances with MethodInstances

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AllInstances
  2. MethodInstances
  3. EntityDecoderInstances
  4. EntityEncoderInstances
  5. MultipartInstances
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def ExpectOnlyOne[A <: Object](implicit ec: ExecutionContext): EntityDecoder[IO, A]

    Use this when you expect only one value in an array or return an error.

    Use this when you expect only one value in an array or return an error.

    Definition Classes
    EntityDecoderInstances
    Example:
    1. val q = QuerySpec(...) // select value by name, which should be unique but is not a PK
       dynclient.getOne[Blah](q.url("entitysetname"))(ExpectOnlyOne)
         .map( ... )
         .recover( ... )
  2. def ExpectOnlyOneToOption[A <: Object](implicit ec: ExecutionContext): EntityDecoder[IO, Option[A]]

    Transform a DecodeFailure(OnlyOneExpected) to None if present, otherwise Some.

    Transform a DecodeFailure(OnlyOneExpected) to None if present, otherwise Some. Use as an explicit encoder and use a type of Option[A] e.g. dynamicsclient.getOne[Option[A]](..)(ExpectOnlyOneToOption).

    Definition Classes
    EntityDecoderInstances
  3. implicit def JSONDecoder(reviver: Option[Reviver] = None)(implicit ec: ExecutionContext): EntityDecoder[IO, Dynamic]

    Pparsed into JSON using JSON.parse().

    Pparsed into JSON using JSON.parse(). Note that JSON parse could return a simple value, not a JS object. Having said that, all response bodies (for valid responses) from the server are objects.

    Definition Classes
    EntityDecoderInstances
  4. def JSONDecoderValidate(f: (Dynamic) ⇒ Boolean, failedMsg: String = "Failed validation.", reviver: Option[Reviver] = None)(implicit ec: ExecutionContext): EntityDecoder[IO, Dynamic]

    Filter on JSON value.

    Filter on JSON value. Create DecodeFailure if filter func returns false.

    Definition Classes
    EntityDecoderInstances
  5. implicit val JsDynamicEncoder: EntityEncoder[Dynamic]

    scalajs specific

    scalajs specific

    Definition Classes
    EntityEncoderInstances
  6. def JsObjectDecoder[A <: Object](reviver: Option[Reviver] = None)(implicit ec: ExecutionContext): EntityDecoder[IO, A]

    Decode the body as json and cast to A instead of JSONDecoder which casts the body to js.Dynamic.

    Decode the body as json and cast to A instead of JSONDecoder which casts the body to js.Dynamic. Typebounds implies that JS traits can use this decoder easily.

    Definition Classes
    EntityDecoderInstances
  7. def JsObjectEncoder[A <: Object]: EntityEncoder[A]

    scalajs specific

    scalajs specific

    Definition Classes
    EntityEncoderInstances
  8. val ReturnedIdDecoder: EntityDecoder[IO, String]

    A decoder that only looks at the header for an OData-EntityId (case-insensitive) value and returns that, otherwise fail.

    A decoder that only looks at the header for an OData-EntityId (case-insensitive) value and returns that, otherwise fail. To ensure that the id is returned in the header, you must make sure that return=representation is *not* set in the Prefer headers when the HTTP call is issued.

    Definition Classes
    EntityDecoderInstances
  9. def SingleValueDecoder[A <: Any](implicit ec: ExecutionContext): EntityDecoder[IO, Option[A]]

    Decode based on the expectation of a single value in a fieldname called "value".

    Decode based on the expectation of a single value in a fieldname called "value". You might get this when you navigate to a simple/single value property on a specific entity e.g. '/myentities(theguid)/somesimpleattribute'. A null value or undefined value is automatically taken into account in the returned Option. Preversely, you could assume that "js.Array[YourSomething]" is the single value and use that instead of ValueArrayDecoder.

    Definition Classes
    EntityDecoderInstances
  10. implicit val StringEncoder: EntityEncoder[String]
    Definition Classes
    EntityEncoderInstances
  11. implicit def TextDecoder(implicit ec: ExecutionContext): EntityDecoder[IO, String]

    Decode body to text.

    Decode body to text. Since the body in a response is already text this is the simplest decoder.

    Definition Classes
    EntityDecoderInstances
  12. def ValueArrayDecoder[A <: Any](implicit ec: ExecutionContext): EntityDecoder[IO, Array[A]]

    Decode based on the expectation of a "value" field name that has an array of "A" values.

    Decode based on the expectation of a "value" field name that has an array of "A" values. The returned value is a js Array not a scala collection. If "value" fieldname is undefined, return an empty array freshly allocated.

    Definition Classes
    EntityDecoderInstances
  13. def ValueWrapper[A <: Object](implicit ec: ExecutionContext): EntityDecoder[IO, A]

    Check for value array and if there is a value array return the first element.

    Check for value array and if there is a value array return the first element. Otherwise cast the entire response to A directly and return it. Either way, return a single value of type T. Because of these assumptions, you could get undefined behavior. If there is more than one element in the array, return an OnlyOneExpected error.

    If you are assuming a different underlying decode approach to the raw http body, you need to write your own wrapper to detect the "value" array and decide how to decode based on its presence. That's because its assumed in this function that we will decode to a js.Object first to check for the value array in the response body. This should really be called FirstElementOfValueArrayIfThereIsOneOrCastWholeMessage.

    Definition Classes
    EntityDecoderInstances
  14. val dateReviver: Reviver

    JSON Date reviver based on ISO string format dateRegex.

    JSON Date reviver based on ISO string format dateRegex. (js)

    Definition Classes
    EntityDecoderInstances
  15. implicit def defaultEncoder[A <: Object]: EntityEncoder[A]

    Explicit lower order priority implicit.

    Explicit lower order priority implicit.

    Definition Classes
    EntityEncoderInstances
  16. implicit def jsObjectDecoder[A <: Object](implicit ec: ExecutionContext): EntityDecoder[IO, A]

    Implicit versio of JsObjectDecoder

    Implicit versio of JsObjectDecoder

    Definition Classes
    EntityDecoderInstances
  17. implicit val jsObjectEncoder: EntityEncoder[Object]

    Implicitly decode anything that is a subclass of js.Object.

    Implicitly decode anything that is a subclass of js.Object.

    Definition Classes
    EntityEncoderInstances
  18. implicit def multipartEntityEncoder: EntityEncoder[Multipart]
    Definition Classes
    MultipartInstances
  19. val reg: Regex

    GUID regex.

    GUID regex. (scala)

    Definition Classes
    EntityDecoderInstances
  20. implicit val showForMethod: Show[Method]
    Definition Classes
    MethodInstances
  21. val undefinedReviver: Reviver

    JSON reviver that matches nothing.

    JSON reviver that matches nothing.

    Definition Classes
    EntityDecoderInstances
  22. implicit val void: EntityDecoder[IO, Unit]

    Ignore the response completely (status and body) and return decode "unit" success.

    Ignore the response completely (status and body) and return decode "unit" success. You typically use this decoder with a client type parameter of Unit and when you only want to check that a successful status code was returned or error out otherwise.

    Definition Classes
    EntityDecoderInstances