ClassificationResponse
class ClassificationResponse implements Arrayable, ArrayAccess, Countable, IteratorAggregate, JsonSerializable
Traits
Properties
| Response|null | $raw | The raw HTTP response, if available for the provider. |
from HasRawResponse |
Methods
Prepare the instance for serialization, discarding the unserializable raw HTTP response.
Create a new classification response instance.
Get the answers as a collection.
Get the number of answers in the response.
Get the instance as an array.
Get the JSON serializable representation of the instance.
Get an iterator for the answers.
Determine if an answer exists for the given key.
Reject writes to the immutable answers.
Reject removal of immutable answers.
Details
in
HasRawResponse at line 19
HasRawResponse
withRawResponse(Response|null $response)
Set the raw HTTP response.
in
HasRawResponse at line 29
array
__serialize()
Prepare the instance for serialization, discarding the unserializable raw HTTP response.
at line 30
__construct(array $answers, TextUsage $usage, Meta $meta)
Create a new classification response instance.
at line 42
Answer
answer(string|int $key)
Get the answer for the given question key.
at line 52
Collection
collect()
Get the answers as a collection.
at line 60
int
count()
Get the number of answers in the response.
at line 68
array
toArray()
Get the instance as an array.
at line 80
array
jsonSerialize()
Get the JSON serializable representation of the instance.
at line 90
Traversable
getIterator()
Get an iterator for the answers.
at line 98
bool
offsetExists(mixed $offset)
Determine if an answer exists for the given key.
at line 106
Answer
offsetGet(mixed $offset)
Get the answer for the given key.
at line 114
void
offsetSet(mixed $offset, mixed $value)
Reject writes to the immutable answers.
at line 122
void
offsetUnset(mixed $offset)
Reject removal of immutable answers.