object entitydecoder extends EntityDecoderInstances
- Alphabetic
- By Inheritance
- entitydecoder
- EntityDecoderInstances
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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
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( ... )
Example: -
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 ofOption[A]
e.g.dynamicsclient.getOne[Option[A]](..)(ExpectOnlyOneToOption)
.- Definition Classes
- EntityDecoderInstances
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
val
dateRegex: RegExp
Dates from dynamics server.
Dates from dynamics server. (js regexp)
- Attributes
- protected
- Definition Classes
- EntityDecoderInstances
-
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
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
implicit
def
jsObjectDecoder[A <: Object](implicit ec: ExecutionContext): EntityDecoder[IO, A]
Implicit versio of
JsObjectDecoder
Implicit versio of
JsObjectDecoder
- Definition Classes
- EntityDecoderInstances
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
val
reg: Regex
GUID regex.
GUID regex. (scala)
- Definition Classes
- EntityDecoderInstances
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
val
undefinedReviver: Reviver
JSON reviver that matches nothing.
JSON reviver that matches nothing.
- Definition Classes
- EntityDecoderInstances
-
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
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )