createShare method
Create a share.
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:
pathPath of the share.permissionsPermissions for the share.shareTypeType of the share. Defaults to-1.shareWithThe entity this should be shared with.publicUploadIf public uploading is allowed. Defaults to"false".passwordPassword for the share. Defaults to"".sendPasswordByTalkSend the password for the share over Talk.expireDateExpiry date of the share using user timezone at 00:00. It means date in UTC timezone will be used. Defaults to"".noteNote for the share. Defaults to"".labelLabel for the share (only used in link and email). Defaults to"".attributesAdditional attributes for the share.oCSAPIRequestRequired to be true for the API request to pass. Defaults totrue.
Status codes:
- 200: Share created
- 400: Unknown share type
- 403: Creating the share is not allowed
- 404: Creating the share failed
See:
- $createShare_Request for the request send by this method.
- $createShare_Serializer for a converter to parse the
Responsefrom an executed request.
Implementation
Future<_i1.DynamiteResponse<ShareapiCreateShareResponseApplicationJson, void>> createShare({
String? path,
int? permissions,
int? shareType,
String? shareWith,
String? publicUpload,
String? password,
String? sendPasswordByTalk,
String? expireDate,
String? note,
String? label,
String? attributes,
bool? oCSAPIRequest,
}) async {
final _request = $createShare_Request(
path: path,
permissions: permissions,
shareType: shareType,
shareWith: shareWith,
publicUpload: publicUpload,
password: password,
sendPasswordByTalk: sendPasswordByTalk,
expireDate: expireDate,
note: note,
label: label,
attributes: attributes,
oCSAPIRequest: oCSAPIRequest,
);
final _response = await _rootClient.httpClient.send(_request);
final _serializer = $createShare_Serializer();
final _rawResponse =
await _i1.ResponseConverter<ShareapiCreateShareResponseApplicationJson, void>(_serializer).convert(_response);
return _i1.DynamiteResponse.fromRawResponse(_rawResponse);
}