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:
path
Path of the share.permissions
Permissions for the share.shareType
Type of the share. Defaults to-1
.shareWith
The entity this should be shared with.publicUpload
If public uploading is allowed. Defaults tofalse
.password
Password for the share. Defaults to''
.sendPasswordByTalk
Send the password for the share over Talk.expireDate
Expiry date of the share. Defaults to''
.note
Note for the share. Defaults to''
.label
Label for the share (only used in link and email). Defaults to''
.attributes
Additional attributes for the share.oCSAPIRequest
Required 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:
- createShareRaw for an experimental operation that returns a DynamiteRawResponse that can be serialized.
Implementation
Future<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 rawResponse = createShareRaw(
path: path,
permissions: permissions,
shareType: shareType,
shareWith: shareWith,
publicUpload: publicUpload,
password: password,
sendPasswordByTalk: sendPasswordByTalk,
expireDate: expireDate,
note: note,
label: label,
attributes: attributes,
oCSAPIRequest: oCSAPIRequest,
);
return rawResponse.future;
}