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:
objectType
Type of the object.objectId
ID of the object.metaData
Additional metadata. Defaults to""
.actorDisplayName
Guest name. Defaults to""
.referenceId
Reference ID. Defaults to""
.apiVersion
Defaults to"v1"
.token
oCSAPIRequest
Required 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
Response
from 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);
}