getMessageContext method
Future<DynamiteResponse<ChatGetMessageContextResponseApplicationJson, ChatChatGetMessageContextHeaders> >
getMessageContext({
- required String token,
- required int messageId,
- ChatGetMessageContextApiVersion? apiVersion,
- int? limit,
- bool? oCSAPIRequest,
Get the context of a message.
Returns a Future containing a DynamiteResponse
with the status code, deserialized body and headers.
Throws a DynamiteApiException
if the API call does not return an expected status code.
Parameters:
apiVersion
Defaults to"v1"
.token
messageId
The focused message which should be in the "middle" of the returned context.limit
Number of chat messages to receive in both directions (50 by default, 100 at most, might return 201 messages). Defaults to50
.oCSAPIRequest
Required to be true for the API request to pass. Defaults totrue
.
Status codes:
- 200: Message context returned
- 304: No messages
See:
- $getMessageContext_Request for the request send by this method.
- $getMessageContext_Serializer for a converter to parse the
Response
from an executed request.
Implementation
Future<_i1.DynamiteResponse<ChatGetMessageContextResponseApplicationJson, ChatChatGetMessageContextHeaders>>
getMessageContext({
required String token,
required int messageId,
ChatGetMessageContextApiVersion? apiVersion,
int? limit,
bool? oCSAPIRequest,
}) async {
final _request = $getMessageContext_Request(
token: token,
messageId: messageId,
apiVersion: apiVersion,
limit: limit,
oCSAPIRequest: oCSAPIRequest,
);
final _streamedResponse = await _rootClient.httpClient.send(_request);
final _response = await _i3.Response.fromStream(_streamedResponse);
final _serializer = $getMessageContext_Serializer();
return _i1.ResponseConverter<ChatGetMessageContextResponseApplicationJson, ChatChatGetMessageContextHeaders>(
_serializer,
).convert(_response);
}