createShare method

Future<DynamiteResponse<ShareapiCreateShareResponseApplicationJson, void>> createShare({
  1. String? path,
  2. int? permissions,
  3. int? shareType,
  4. String? shareWith,
  5. String? publicUpload,
  6. String? password,
  7. String? sendPasswordByTalk,
  8. String? expireDate,
  9. String? note,
  10. String? label,
  11. String? attributes,
  12. bool? oCSAPIRequest,
})

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 to "false".
  • password Password for the share. Defaults to "".
  • sendPasswordByTalk Send the password for the share over Talk.
  • expireDate Expiry date of the share using user timezone at 00:00. It means date in UTC timezone will be used. 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 to true.

Status codes:

  • 200: Share created
  • 400: Unknown share type
  • 403: Creating the share is not allowed
  • 404: Creating the share failed

See:

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);
}