ElicitRequest extends Request
FinalYes
A request from the server to elicit additional information from the user.
Comes in two modes. In form mode the client presents the message alongside
the requested schema and returns the values the user filled in. In url mode
it sends the user to a URL to complete the interaction out of band, and the
result carries only the user's action — no content.
Tags
Table of Contents
Properties
- $message : string
- $mode : ElicitationMode
- $requestedSchema : ElicitationSchema|null
- $url : string|null
- $id : string|int
- $meta : array<string, mixed>|null
Methods
- __construct() : mixed
- forForm() : self
- Elicit values from the user through a form built from $requestedSchema.
- forUrl() : self
- Send the user to $url to complete the interaction out of band.
- fromArray() : static
- getId() : string|int
- getMeta() : array<string, mixed>|null
- getMethod() : string
- jsonSerialize() : RequestData
- withId() : static
- withMeta() : static
- fromParams() : static
- getParams() : ElicitationSchema, url?: string}
Properties
$message read-only
public
string
$message
$mode read-only
public
ElicitationMode
$mode
= ElicitationMode::Form
$requestedSchema read-only
public
ElicitationSchema|null
$requestedSchema
= null
$url read-only
public
string|null
$url
= null
$id
protected
string|int
$id
$meta
protected
array<string, mixed>|null
$meta
= null
Methods
__construct()
public
__construct(string $message[, ElicitationSchema|null $requestedSchema = null ][, ElicitationMode $mode = ElicitationMode::Form ][, string|null $url = null ]) : mixed
Parameters
- $message : string
-
A human-readable message describing what information is needed
- $requestedSchema : ElicitationSchema|null = null
-
The schema defining the fields to elicit; required in form mode
- $mode : ElicitationMode = ElicitationMode::Form
-
how the client should collect the information
- $url : string|null = null
-
the URL to send the user to; required in url mode
forForm()
Elicit values from the user through a form built from $requestedSchema.
public
static forForm(string $message, ElicitationSchema $requestedSchema) : self
Parameters
- $message : string
- $requestedSchema : ElicitationSchema
Return values
selfforUrl()
Send the user to $url to complete the interaction out of band.
public
static forUrl(string $message, string $url) : self
Parameters
- $message : string
- $url : string
Return values
selffromArray()
public
static fromArray(RequestData $data) : static
Parameters
- $data : RequestData
Return values
staticgetId()
public
getId() : string|int
Return values
string|intgetMeta()
public
getMeta() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetMethod()
public
static getMethod() : string
Return values
stringjsonSerialize()
public
jsonSerialize() : RequestData
Return values
RequestDatawithId()
public
withId(string|int $id) : static
Parameters
- $id : string|int
Return values
staticwithMeta()
public
withMeta(array<string, mixed>|null $meta) : static
Parameters
- $meta : array<string, mixed>|null
Return values
staticfromParams()
protected
static fromParams(array<string|int, mixed>|null $params) : static
Parameters
- $params : array<string|int, mixed>|null
Return values
staticgetParams()
protected
getParams() : ElicitationSchema, url?: string}