예제 #1
0
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Create a collaboration for a Box item.";
            _path              = FilePathOption.ConfigureOption(command);
            _bulkPath          = BulkFilePathOption.ConfigureOption(command);
            _save              = SaveOption.ConfigureOption(command);
            _fileFormat        = FileFormatOption.ConfigureOption(command);
            _fieldsOption      = FieldsOption.ConfigureOption(command);
            _editor            = command.Option("--editor", "Set the role to editor.", CommandOptionType.NoValue);
            _viewer            = command.Option("--viewer", "Set the role to viewer.", CommandOptionType.NoValue);
            _previewer         = command.Option("--previewer", "Set the role to previewer.", CommandOptionType.NoValue);
            _uploader          = command.Option("--uploader", "Set the role to uploader.", CommandOptionType.NoValue);
            _previewerUploader = command.Option("--previewer-uploader", "Set the role to previewer uploader.", CommandOptionType.NoValue);
            _viewerUploader    = command.Option("--viewer-uploader", "Set the role to viewer uploader.", CommandOptionType.NoValue);
            _coowner           = command.Option("--co-owner", "Set the role to co-owner.", CommandOptionType.NoValue);
            _role              = command.Option("-r|--role", "An option to manually enter the role", CommandOptionType.SingleValue);
            _userId            = command.Option("--user-id", "Id for user to collaborate", CommandOptionType.SingleValue);
            _groupId           = command.Option("--group-id", "Id for group to collaborate", CommandOptionType.SingleValue);
            _login             = command.Option("--login", "Login for user to collaborate", CommandOptionType.SingleValue);
            _canViewPath       = command.Option("--can-view-path", "Whether view path collaboration feature is enabled or not.", CommandOptionType.NoValue);
            _idOnly            = IdOnlyOption.ConfigureOption(command);
            _id = command.Argument("boxItemId",
                                   "Id of the Box item");
            if (base._t == BoxType.enterprise)
            {
                _type = command.Argument("boxItemType", "Type of Box item");
            }

            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
예제 #2
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Update a folder.";
     _folderId           = command.Argument("folderId",
                                            "Id of folder to update");
     _bulkFilePath   = BulkFilePathOption.ConfigureOption(command);
     _filePath       = FilePathOption.ConfigureOption(command);
     _fileFormat     = FileFormatOption.ConfigureOption(command);
     _save           = SaveOption.ConfigureOption(command);
     _parentFolderId = command.Option("--parent-folder-id",
                                      "Id of new parent folder <ID>", CommandOptionType.SingleValue);
     _name = command.Option("--name",
                            "New name for folder <NAME>", CommandOptionType.SingleValue);
     _description = command.Option("--description",
                                   "New description for folder <DESCRIPTION>", CommandOptionType.SingleValue);
     _notSynced = command.Option("--not-synced",
                                 "Set sync state to not synced", CommandOptionType.NoValue);
     _partiallySynced = command.Option("--partially-synced",
                                       "Set sync state to partially synced", CommandOptionType.NoValue);
     _synced = command.Option("--synced",
                              "Set sync state to synced", CommandOptionType.NoValue);
     _access                = command.Option("--folder-upload-email-access <ACCESS>", "Upload email access level", CommandOptionType.SingleValue);
     _sharedLinkAccess      = command.Option("--shared-link-access <ACCESS>", "Shared link access level", CommandOptionType.SingleValue);
     _sharedLinkPassword    = command.Option("--shared-link-password <PASSWORD>", "Shared link password", CommandOptionType.SingleValue);
     _sharedLinkUnsharedAt  = command.Option("--shared-link-unshared-at <TIME>", "Time that this link will become disabled, use formatting like 03w for 3 weeks.", CommandOptionType.SingleValue);
     _sharedLinkCanDownload = command.Option("--shared-link-can-download", "Whether the shared link allows downloads", CommandOptionType.NoValue);
     _tags = command.Option("--tags <TAGS>", "Comma seperated tags", CommandOptionType.SingleValue);
     _etag = command.Option("--etag <ETAG>", "Only move if etag value matches", CommandOptionType.SingleValue);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #3
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Update a Box User";
     _userId             = command.Argument("userId",
                                            "User ID to Update");
     _enterprise  = command.Option("--remove", "Remove the user from the enterprise, convert to free account", CommandOptionType.NoValue);
     _name        = command.Option("-n|--name", "New name of user", CommandOptionType.SingleValue);
     _role        = command.Option("-r|--role", "Role of user. Enter user or coadmin", CommandOptionType.SingleValue);
     _language    = command.Option("-l|--language", "Language of the user (ISO 639-1 Language Code)", CommandOptionType.SingleValue);
     _syncEnable  = command.Option("--sync-enable", "Enable Sync for this user", CommandOptionType.NoValue);
     _syncDisable = command.Option("--sync-disable", "Disable Box Sync for this user", CommandOptionType.NoValue);
     _jobTitle    = command.Option("-j|--job-title", "Job title of the user", CommandOptionType.SingleValue);
     _phoneNumber = command.Option("-p|--phone-number", "Phone number of the user", CommandOptionType.SingleValue);
     _address     = command.Option("-a|--address", "Address of the user", CommandOptionType.SingleValue);
     _spaceAmount = command.Option("-d|--disk-space", "User's available storage in bytes. Value of -1 grants unlimited storage", CommandOptionType.SingleValue);
     _status      = command.Option("-s|--status", "User status. Enter active, inactive, cannot_delete_edit, or cannot_delete_edit_upload", CommandOptionType.SingleValue);
     _isExemptFromDeviceLimits       = command.Option("--is-exempt-from-device-limits", "Exempt user from device limits", CommandOptionType.NoValue);
     _notExemptFromDeviceLimits      = command.Option("--not-exempt-from-device-limits", "User is not exempt from device limits", CommandOptionType.NoValue);
     _isExemptFromLoginVerificaton   = command.Option("--is-exempt-login-verification", "Exempt user from two-factor auth", CommandOptionType.NoValue);
     _notExemptFromLoginVerification = command.Option("--not-exempt-login-verification", "User is not exempt from two-factor auth", CommandOptionType.NoValue);
     _isPasswordResetRequired        = command.Option("--password-reset", "Force the user to reset password", CommandOptionType.NoValue);
     _dontPrompt   = SuppressDeletePromptOption.ConfigureOption(command);
     _bulkFilePath = BulkFilePathOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #4
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Update a collaboration.";
     _id = command.Argument("collaborationId",
                            "ID of the collaboration");
     _path              = FilePathOption.ConfigureOption(command);
     _bulkPath          = BulkFilePathOption.ConfigureOption(command);
     _save              = SaveOption.ConfigureOption(command);
     _fileFormat        = FileFormatOption.ConfigureOption(command);
     _fieldsOption      = FieldsOption.ConfigureOption(command);
     _editor            = command.Option("--editor", "Set the role to editor.", CommandOptionType.NoValue);
     _viewer            = command.Option("--viewer", "Set the role to viewer.", CommandOptionType.NoValue);
     _previewer         = command.Option("--previewer", "Set the role to previewer.", CommandOptionType.NoValue);
     _uploader          = command.Option("--uploader", "Set the role to uploader.", CommandOptionType.NoValue);
     _previewerUploader = command.Option("--previewer-uploader", "Set the role to previewer uploader.", CommandOptionType.NoValue);
     _viewerUploader    = command.Option("--viewer-uploader", "Set the role to viewer uploader.", CommandOptionType.NoValue);
     _coowner           = command.Option("--co-owner", "Set the role to co-owner.", CommandOptionType.NoValue);
     _owner             = command.Option("--owner", "Set the role to owner.", CommandOptionType.NoValue);
     _role              = command.Option("-r|--role", "An option to manually enter the role", CommandOptionType.SingleValue);
     _status            = command.Option("--status", "Update the collaboration status", CommandOptionType.SingleValue);
     _canViewPath       = command.Option("--can-view-path", "Whether view path collaboration feature is enabled or not.", CommandOptionType.NoValue);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #5
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Remove a user from a group.";
     _membershipId       = command.Argument("membershipId",
                                            "Id of group membership");
     _bulkPath = BulkFilePathOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #6
0
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Delete a webhook.";
            _webhookId          = command.Argument("webhookId",
                                                   "Id of webhook to delete");
            _path = BulkFilePathOption.ConfigureOption(command);

            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Remove a collaboration";
     _id = command.Argument("collaborationId",
                            "ID of the collaboration");
     _dontPrompt = SuppressDeletePromptOption.ConfigureOption(command);
     _bulkPath   = BulkFilePathOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #8
0
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Remove a storage policy assignment, returning the user to the enterprise default.";
            _assignmentId       = command.Argument("assignmentId",
                                                   "Id of the storage policy assignment");
            _bulkPath = BulkFilePathOption.ConfigureOption(command);

            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
예제 #9
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Delete a group.";
     _groupId            = command.Argument("groupId",
                                            "Id of group");
     _bulkPath   = BulkFilePathOption.ConfigureOption(command);
     _dontPrompt = SuppressDeletePromptOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #10
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Download a file.";
     _fileId             = command.Argument("fileId",
                                            "Id of file to download");
     _multiId = command.Option("-m|--multi",
                               "Download multiple files with a comma separated list of IDs.",
                               CommandOptionType.NoValue);
     _bulkPath = BulkFilePathOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #11
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Update a webhook";
     _path = BulkFilePathOption.ConfigureOption(command);
     _save = SaveOption.ConfigureOption(command);
     _id   = command.Argument("webhookId",
                              "Id of the webhook");
     _triggers = command.Option("-t|--triggers <TRIGGERS>", "Triggers for webhook, enter as comma separated list. For example: FILE.DELETED,FILE.PREVIEWED", CommandOptionType.SingleValue);
     _address  = command.Option("-a|--address", "URL for your webhook handler", CommandOptionType.SingleValue);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #12
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Delete a Box User";
     _userId = command.Argument("userId",
                            "User ID to Delete");
     _notify = command.Option("--notify", "The user should be notified", CommandOptionType.NoValue);
     _force = command.Option("-f|--force", "Delete user even if they own files", CommandOptionType.NoValue);
     _dontPrompt = SuppressDeletePromptOption.ConfigureOption(command);
     _path = BulkFilePathOption.ConfigureOption(command);
     command.OnExecute(async () =>
     {
         return await this.Execute();
     });
     base.Configure(command);
 }
예제 #13
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Create a new folder";
     _bulkPath           = BulkFilePathOption.ConfigureOption(command);
     _filePath           = FilePathOption.ConfigureOption(command);
     _fileFormat         = FileFormatOption.ConfigureOption(command);
     _save           = SaveOption.ConfigureOption(command);
     _idOnly         = IdOnlyOption.ConfigureOption(command);
     _parentFolderId = command.Argument("parentFolderId",
                                        "Id of parent folder to add new folder to, use '0' for the root folder");
     _name = command.Argument("name", "Name of new folder");
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #14
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Create a new webhook";
     _path   = BulkFilePathOption.ConfigureOption(command);
     _save   = SaveOption.ConfigureOption(command);
     _idOnly = IdOnlyOption.ConfigureOption(command);
     _id     = command.Argument("boxItemId",
                                "Id of the Box item");
     _type     = command.Argument("boxItemType", "Type of Box item");
     _triggers = command.Argument("triggers", "Triggers for webhook, enter as comma separated list. For example: FILE.DELETED,FILE.PREVIEWED");
     _address  = command.Argument("address", "URL for your webhook handler");
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #15
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Upload a file";
     _parentFolderId     = command.Option("-p|--parent-folder",
                                          "Id of folder to upload file to, defaults to the root folder",
                                          CommandOptionType.SingleValue);
     _path = command.Argument("filePath",
                              "Local path to file");
     _name = command.Option("-n|--name",
                            "Provide different name for uploaded file", CommandOptionType.SingleValue);
     _bulkPath = BulkFilePathOption.ConfigureOption(command);
     _idOnly   = IdOnlyOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #16
0
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Assign a storage policy to a user.";
            _policyId           = command.Argument("storagePolicyId",
                                                   "Id of the storage policy");
            _userId = command.Argument("userId",
                                       "Id of the user to assign the policy to");

            _bulkPath   = BulkFilePathOption.ConfigureOption(command);
            _save       = SaveOption.ConfigureOption(command);
            _fileFormat = FileFormatOption.ConfigureOption(command);

            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
예제 #17
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Add metadata to an item";
     _id = command.Argument("boxItemId",
                            "Id of the Box item");
     _scope = command.Argument("scope",
                               "The scope of the metadata object");
     _template = command.Argument("template",
                                  "The key of the template");
     _bulkFilePath = BulkFilePathOption.ConfigureOption(command);
     _keyVal       = command.Option("--kv <KEYVALS>",
                                    "Keys and values for metadata. Format like key1|val1&key2|val2",
                                    CommandOptionType.SingleValue);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #18
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Add metadata to an item";
     _id = command.Argument("boxItemId",
                            "Id of the Box item");
     _scope = command.Argument("scope",
                               "The scope of the metadata object");
     _template = command.Argument("template",
                                  "The key of the template");
     _bulkFilePath = BulkFilePathOption.ConfigureOption(command);
     _keyVal       = command.Option("--kv <KEYVALS>",
                                    "Metadata keys and values. Usage: key1=val1&key2=val2 Note: For float type, use \"f\" on end of digits, key1=1234f&key2=1234.50f",
                                    CommandOptionType.SingleValue);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #19
0
        public override void Configure(CommandLineApplication command)
        {
            _app = command;
            command.Description = "Update a user's membership to a group.";
            _bulkPath           = BulkFilePathOption.ConfigureOption(command);
            _save         = SaveOption.ConfigureOption(command);
            _fileFormat   = FileFormatOption.ConfigureOption(command);
            _membershipId = command.Argument("membershipId",
                                             "Id of group membership");
            _admin = command.Option("--set-admin",
                                    "Set the user's role to Group Admin", CommandOptionType.NoValue);
            _member = command.Option("--set-member",
                                     "Set the user's role to Group Member", CommandOptionType.NoValue);

            command.OnExecute(async() =>
            {
                return(await this.Execute());
            });
            base.Configure(command);
        }
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Create a new metadata template";
     _scope = command.Argument("scope",
                               "The scope of the metadata template");
     _name = command.Argument("displayName",
                              "The display name of the template.");
     _templateKey   = command.Option("--template-key", "A unique identifier for the template.", CommandOptionType.SingleValue);
     _hidden        = command.Option("--hidden", "Whether this template is hidden in the UI.", CommandOptionType.NoValue);
     _bulkFilePaths = command.Option("--bulk-file-path-csv",
                                     "Provide file paths for the metadata template CSV file and metadata template fields CSV file, ex: box metadata-templates create --bulk-file-path-csv /path/to/template.csv --bulk-file-path-csv /path/to/fields.csv",
                                     CommandOptionType.MultipleValue);
     _bulkFilePath = BulkFilePathOption.ConfigureOption(command);
     _idOnly       = IdOnlyOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #21
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Create a shared link for a Box item.";
     _path = BulkFilePathOption.ConfigureOption(command);
     _id   = command.Argument("boxItemId",
                              "Id of the Box item");
     _access      = command.Option("--access <ACCESS>", "Shared link access level", CommandOptionType.SingleValue);
     _password    = command.Option("--password <PASSWORD>", "Shared link password", CommandOptionType.SingleValue);
     _unsharedAt  = command.Option("--unshared-at <TIME>", "Time that this link will become disabled, use formatting like 03w for 3 weeks.", CommandOptionType.SingleValue);
     _canDownload = command.Option("--can-download", "Whether the shared link allows downloads", CommandOptionType.NoValue);
     if (base._t == BoxType.enterprise)
     {
         _type = command.Argument("itemType", "Type of item for shared link: either file or folder.");
     }
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
예제 #22
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description = "Update a group.";
     _id          = command.Argument("groupId", "Group ID");
     _name        = command.Option("-n|--name", "Group name", CommandOptionType.SingleValue);
     _inviteLevel = command.Option("-i|--invite",
                                   "Specifies who can invite the group to collaborate. Enter admins_only, admins_and_members, or all_managed_users",
                                   CommandOptionType.SingleValue);
     _viewMembershipLevel = command.Option("-m|--view-members",
                                           "Specifies who can view the members of the group. Enter admins_only, admins_and_members, or all_managed_users",
                                           CommandOptionType.SingleValue);
     _bulkPath   = BulkFilePathOption.ConfigureOption(command);
     _save       = SaveOption.ConfigureOption(command);
     _fileFormat = FileFormatOption.ConfigureOption(command);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }