/// <summary> /// Create Employee /// </summary> /// <example> /// { /// "Email":"*****@*****.**", /// "FirstName":"Name", /// "LastName":"Last Name", /// "Company":"Company", /// "Password":"******", /// "StorageQuotaLimitGB":50, /// "Preferences": /// { /// "CanResetPassword":true, /// "CanViewMySettings":true /// }, /// "DefaultZone": /// { /// "Id":"zoneid" /// }, /// "IsAdministrator": false, /// "CanCreateFolders": false, /// "CanUseFileBox": true, /// "CanManageUsers": false, /// "Roles": [ /// "CanChangePassword", "CanManageMySettings", /// "CanUseFileBox, "CanManageUsers, "CanCreateFolders, "CanUseDropBox, "CanSelectFolderZone, /// "AdminAccountPolicies", "AdminBilling", "AdminBranding", "AdminChangePlan", "AdminFileBoxAccess", /// "AdminManageEmployees", "AdminRemoteUploadForms", "AdminReporting", "AdminSharedDistGroups", /// "AdminSharedAddressBook", "AdminViewReceipts", "AdminDelegate", "AdminManageFolderTemplates", /// "AdminEmailMessages", "AdminSSO", "AdminSuperGroup", "AdminZones", "AdminCreateSharedGroups", "AdminConnectors" /// ] /// } /// </example> /// <remarks> /// Creates a new Employee User (AccountUser) and associates it to an Account /// The following parameters from the input object are used: Email, FirstName, LastName, Company, /// DefaultZone, Password, IsEmployee, IsAdministrator, CanCreateFolders, CanUseFileBox, CanManageUsers, /// Preferences.CanResetPassword and Preferences.CanViewMySettings. /// Other parameters are ignoredStorageQuotaLimitGB parameter is optional. If not specified or equal to -1 the account default storage quota value will be set for the User. /// </remarks> /// <param name="user"></param> /// <param name="pushCreatorDefaultSettings"></param> /// <param name="addshared"></param> /// <param name="notify"></param> /// <param name="ifNecessary"></param> /// <returns> /// The new employee user /// </returns> public IQuery<User> CreateAccountUser(AccountUser user, bool pushCreatorDefaultSettings = false, bool addshared = false, bool notify = false, bool ifNecessary = false) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<User>(Client); sfApiQuery.From("Users"); sfApiQuery.Action("AccountUser"); sfApiQuery.QueryString("pushCreatorDefaultSettings", pushCreatorDefaultSettings); sfApiQuery.QueryString("addshared", addshared); sfApiQuery.QueryString("notify", notify); sfApiQuery.QueryString("ifNecessary", ifNecessary); sfApiQuery.Body = user; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Update Employee or Promote Customer /// </summary> /// <example> /// { /// "FirstName":"FirstName", /// "LastName":"LastName", /// "Company":"Company", /// "Email":"*****@*****.**", /// "StorageQuotaLimitGB":100, /// "Security": /// { /// "IsDisabled":false /// } /// "DefaultZone": /// { /// "Id":"newzoneid" /// } /// } /// </example> /// <remarks> /// Modifies an existing user object /// The following parameters can be modified through this call: FirstName, LastName, Company, /// Email, IsEmployee, IsDisabled, DefaultZone Id, StorageQuotaLimitGB.During a promotion (the user id points to Customer), the following parameters can be /// modified: CanCreateFolders, CanUseFileBox, CanManageUsers. StorageQuotaLimitGB equal to -1 sets the user quota to the account default storage quota value. /// </remarks> /// <param name="id"></param> /// <param name="user"></param> /// <returns> /// a modified user record /// </returns> public IQuery<User> UpdateAccountUser(string id, AccountUser user) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<User>(Client); sfApiQuery.From("Users"); sfApiQuery.Action("AccountUser"); sfApiQuery.ActionIds(id); sfApiQuery.Body = user; sfApiQuery.HttpMethod = "PATCH"; return sfApiQuery; }