Skip to content

Commit 52b2e07

Browse files
author
Matt Willer
authored
Add option to update collaboration expiration (#95)
1 parent d955f75 commit 52b2e07

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

BoxCLI/Commands/CollaborationSubCommands/CollaborationUpdateCommand.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class CollaborationUpdateCommand : CollaborationSubCommandBase
2929
private CommandOption _coowner;
3030
private CommandOption _owner;
3131
private CommandOption _canViewPath;
32+
private CommandOption _expiresAt;
3233
private CommandOption _fieldsOption;
3334
private CommandLineApplication _app;
3435
private IBoxHome _home;
@@ -61,6 +62,7 @@ public override void Configure(CommandLineApplication command)
6162
_role = command.Option("-r|--role", "An option to manually enter the role", CommandOptionType.SingleValue);
6263
_status = command.Option("--status", "Update the collaboration status", CommandOptionType.SingleValue);
6364
_canViewPath = command.Option("--can-view-path", "Whether view path collaboration feature is enabled or not.", CommandOptionType.NoValue);
65+
_expiresAt = command.Option("--expires-at", "When the collaboration should expire.", CommandOptionType.SingleValue);
6466
command.OnExecute(async () =>
6567
{
6668
return await this.Execute();
@@ -114,6 +116,10 @@ await base.ProcessAddCollaborationsFromFile(_bulkPath.Value(), base._t, commandN
114116
{
115117
collabRequest.Status = _status.Value();
116118
}
119+
if (this._expiresAt.HasValue())
120+
{
121+
collabRequest.ExpiresAt = GeneralUtilities.GetDateTimeFromString(this._expiresAt.Value());
122+
}
117123
collabRequest.Role = role;
118124

119125
var result = await boxClient.CollaborationsManager.EditCollaborationAsync(collabRequest, fields: fields);

0 commit comments

Comments
 (0)