getMessageContext method
Future<DynamiteResponse<ChatGetMessageContextResponseApplicationJson, ChatChatGetMessageContextHeaders> >
getMessageContext({
- required String token,
- required int messageId,
- int? limit,
- ChatGetMessageContextApiVersion? apiVersion,
- 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:
limit
Number of chat messages to receive in both directions (50 by default, 100 at most, might return 201 messages). Defaults to50
.apiVersion
Defaults to"v1"
.token
messageId
The focused message which should be in the "middle" of the returned context.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,
int? limit,
ChatGetMessageContextApiVersion? apiVersion,
bool? oCSAPIRequest,
}) async {
final _request = $getMessageContext_Request(
token: token,
messageId: messageId,
limit: limit,
apiVersion: apiVersion,
oCSAPIRequest: oCSAPIRequest,
);
final _response = await _rootClient.httpClient.send(_request);
final _serializer = $getMessageContext_Serializer();
final _rawResponse =
await _i1.ResponseConverter<ChatGetMessageContextResponseApplicationJson, ChatChatGetMessageContextHeaders>(
_serializer,
).convert(_response);
return _i1.DynamiteResponse.fromRawResponse(_rawResponse);
}