shareObjectToChat method
Future<DynamiteResponse<ChatShareObjectToChatResponseApplicationJson, ChatChatShareObjectToChatHeaders> >
shareObjectToChat({
Sends a rich-object to the given room.
The author and timestamp are automatically set to the current user/guest and time.
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:
objectTypeType of the object.objectIdID of the object.metaDataAdditional metadata. Defaults to"".actorDisplayNameGuest name. Defaults to"".referenceIdReference ID. Defaults to"".apiVersionDefaults to"v1".tokenoCSAPIRequestRequired to be true for the API request to pass. Defaults totrue.
Status codes:
- 201: Object shared successfully
- 400: Sharing object is not possible
- 404: Actor not found
- 413: Message too long
See:
- $shareObjectToChat_Request for the request send by this method.
- $shareObjectToChat_Serializer for a converter to parse the
Responsefrom an executed request.
Implementation
Future<_i1.DynamiteResponse<ChatShareObjectToChatResponseApplicationJson, ChatChatShareObjectToChatHeaders>>
shareObjectToChat({
required String objectType,
required String objectId,
required String token,
String? metaData,
String? actorDisplayName,
String? referenceId,
ChatShareObjectToChatApiVersion? apiVersion,
bool? oCSAPIRequest,
}) async {
final _request = $shareObjectToChat_Request(
objectType: objectType,
objectId: objectId,
token: token,
metaData: metaData,
actorDisplayName: actorDisplayName,
referenceId: referenceId,
apiVersion: apiVersion,
oCSAPIRequest: oCSAPIRequest,
);
final _response = await _rootClient.httpClient.send(_request);
final _serializer = $shareObjectToChat_Serializer();
final _rawResponse =
await _i1.ResponseConverter<ChatShareObjectToChatResponseApplicationJson, ChatChatShareObjectToChatHeaders>(
_serializer,
).convert(_response);
return _i1.DynamiteResponse.fromRawResponse(_rawResponse);
}