| 10393 | |
| 10394 | @typecheck |
| 10395 | class JSONValue(Type): |
| 10396 | async def as_array(self) -> list["JSONValue"]: |
| 10397 | """Decode an array from json""" |
| 10398 | _args: list[Arg] = [] |
| 10399 | _ctx = self._select("asArray", _args) |
| 10400 | return await _ctx.execute_object_list(JSONValue) |
| 10401 | |
| 10402 | async def as_boolean(self) -> bool: |
| 10403 | """Decode a boolean from json |
| 10404 | |
| 10405 | Returns |
| 10406 | ------- |
| 10407 | bool |
| 10408 | The `Boolean` scalar type represents `true` or `false`. |
| 10409 | |
| 10410 | Raises |
| 10411 | ------ |
| 10412 | ExecuteTimeoutError |
| 10413 | If the time to execute the query exceeds the configured timeout. |
| 10414 | QueryError |
| 10415 | If the API returns an error. |
| 10416 | """ |
| 10417 | _args: list[Arg] = [] |
| 10418 | _ctx = self._select("asBoolean", _args) |
| 10419 | return await _ctx.execute(bool) |
| 10420 | |
| 10421 | async def as_integer(self) -> int: |
| 10422 | """Decode an integer from json |
| 10423 | |
| 10424 | Returns |
| 10425 | ------- |
| 10426 | int |
| 10427 | The `Int` scalar type represents non-fractional signed whole |
| 10428 | numeric values. Int can represent values between -(2^31) and 2^31 |
| 10429 | - 1. |
| 10430 | |
| 10431 | Raises |
| 10432 | ------ |
| 10433 | ExecuteTimeoutError |
| 10434 | If the time to execute the query exceeds the configured timeout. |
| 10435 | QueryError |
| 10436 | If the API returns an error. |
| 10437 | """ |
| 10438 | _args: list[Arg] = [] |
| 10439 | _ctx = self._select("asInteger", _args) |
| 10440 | return await _ctx.execute(int) |
| 10441 | |
| 10442 | async def as_string(self) -> str: |
| 10443 | """Decode a string from json |
| 10444 | |
| 10445 | Returns |
| 10446 | ------- |
| 10447 | str |
| 10448 | The `String` scalar type represents textual data, represented as |
| 10449 | UTF-8 character sequences. The String type is most often used by |
| 10450 | GraphQL to represent free-form human-readable text. |
| 10451 | |
| 10452 | Raises |
no outgoing calls
no test coverage detected