/// Parameters for updating an existing share via OCS `PUT shares/{id}`.
/// Only the fields that are explicitly set are sent — every field is optional
/// and a null is omitted from the request (sending `permissions=null` would be
/// rejected by the server).
///
/// Use an empty string for [expireDate]/[password] to explicitly clear the
/// value server-side (Nextcloud treats `expireDate=` as "remove expiry").
class ShareUpdateParams {
  final int? permissions;
  final String? password;
  final String? expireDate;

  const ShareUpdateParams({this.permissions, this.password, this.expireDate});

  Map<String, String> toQuery() => {
    if (permissions != null) 'permissions': permissions.toString(),
    'password': ?password,
    'expireDate': ?expireDate,
  };
}
