/// <summary> /// Get EncryptedEmail Message Thread /// </summary> /// <remarks> /// Get list of EncryptedEmail objects in a single email thread.Only messages to which the current logged in User has access are returned.If EncryptedEmail.RequireUserInfo is true, the user info query parameters are required. /// </remarks> /// <returns> /// Feed of EncryptedEmail objects /// </returns> public IQuery <ODataFeed <EncryptedEmail> > Thread(Uri url, string firstName = null, string lastName = null, string email = null, string company = null) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <EncryptedEmail> >(Client); sfApiQuery.Action("Thread"); sfApiQuery.Uri(url); sfApiQuery.QueryString("firstName", firstName); sfApiQuery.QueryString("lastName", lastName); sfApiQuery.QueryString("email", email); sfApiQuery.QueryString("company", company); sfApiQuery.HttpMethod = "GET"; return(sfApiQuery); }
/// <summary> /// Create AccessControl /// </summary> /// <example> /// { /// "Principal":{"url":"https://account.sf-api.com/v3/Groups(id)"}, /// "CanUpload":true, /// "CanDownload":true, /// "CanView":true, /// "CanDelete":true, /// "CanManagePermissions":true, /// "Message":"Message" /// } /// </example> /// <remarks> /// Creates a new Access Controls entry for a given Item. Access controls can only define a single Principal, /// which can be either a Group or User. The 'Principal' element is specified as an object - you should populate /// either the URL or the ID reference. /// /// If CanDownload is set to true, CanView will automatically be set to true. /// If CanDownload is set to false, CanDelete will be set to false. /// In order for a user/group to be able to manage permissions, they must be able to upload, download, and delete. Otherwise it will be set to false. /// /// This endpoint can return an AsyncOperation if the request is to be fulfilled asynchronously /// </remarks> /// <param name="url"></param> /// <param name="accessControl"></param> /// <param name="recursive"></param> /// <param name="message"></param> /// <param name="sendDefaultNotification"></param> /// <returns> /// the created or modified AccessControl instance, or AsyncOperation /// </returns> public IQuery <AccessControl> CreateByItem(Uri url, AccessControl accessControl, bool recursive = false, bool sendDefaultNotification = false, string message = null) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query <AccessControl>(Client); sfApiQuery.Action("AccessControls"); sfApiQuery.Uri(url); sfApiQuery.QueryString("recursive", recursive); sfApiQuery.QueryString("sendDefaultNotification", sendDefaultNotification); accessControl.AddProperty("Message", message); sfApiQuery.Body = accessControl; sfApiQuery.HttpMethod = "POST"; return(sfApiQuery); }
/// <summary> /// Get List of Accounts for User /// </summary> /// <example> /// { /// "password":"******" /// } /// </example> /// <remarks> /// Retrieve the list of Accounts associated with a given user /// All parameters to this call may be passed in the Post body as root JSON parameters, or in the URI - /// with the exception of password that must be provided in the POST body. /// This operation does not require authentication /// </remarks> /// <param name="username"></param> /// <param name="password"></param> /// <param name="employeesonly"></param> /// <param name="requirehomefolders"></param> /// <param name="singleplane"></param> /// <returns> /// The list of Accounts associated with this username/password. /// </returns> public IQuery <ODataFeed <Account> > GetByUser(ODataObject parameters, string username, bool employeesonly = false, bool requirehomefolders = false, bool singleplane = false) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <Account> >(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("GetByUser"); parameters.AddProperty("username", username); parameters.AddProperty("employeesonly", employeesonly); parameters.AddProperty("requirehomefolders", requirehomefolders); parameters.AddProperty("singleplane", singleplane); sfApiQuery.Body = parameters; sfApiQuery.HttpMethod = "POST"; return(sfApiQuery); }
/// <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> /// Downloads Share Items /// </summary> /// <remarks> /// Downloads items from the Share. The default action will download all Items in the Share. /// If a Share has a single item, the download attachment name /// will use the item name. Otherwise, the download will contain a ZIP archive containing all /// files and folders in the share, named Files.zip.To download Shares that require authentication, make sure this request is authenticated. To download /// shares that require require user information, provide the Name, Email and Company parameters in the URI /// query. Anyone can download files from anonymous shares.You can also download individual Items in the Share. Use the Share(id)/Items(id)/Download action. The /// item ID must be a top-level item in the Share - i.e., you cannot download or address files contained inside /// a shared folder. /// </remarks> /// <param name="shareUrl"></param> /// <param name="itemId"></param> /// <param name="Name"></param> /// <param name="Email"></param> /// <param name="Company"></param> /// <param name="redirect"></param> /// <returns> /// Redirects the caller (302) to the download address for the share contents. /// </returns> public IQuery <Stream> Download(Uri shareUrl, string itemId = null, string Name = null, string Email = null, string Company = null, bool redirect = true) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Stream>(Client); sfApiQuery.Action("Download"); sfApiQuery.Uri(shareUrl); sfApiQuery.QueryString("id", itemId); sfApiQuery.QueryString("Name", Name); sfApiQuery.QueryString("Email", Email); sfApiQuery.QueryString("Company", Company); sfApiQuery.QueryString("redirect", redirect); sfApiQuery.HttpMethod = "GET"; return(sfApiQuery); }
/// <summary> /// Get Zone Metadata /// </summary> /// <remarks> /// Gets metadata associated with the specified zone /// </remarks> /// <param name="url"></param> /// <returns> /// the zone metadata feed /// </returns> public IQuery<ODataFeed<Metadata>> GetMetadata(Uri url) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Metadata>>(Client); sfApiQuery.Action("Metadata"); sfApiQuery.Uri(url); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Get Account Product Defaults /// </summary> /// <returns> /// Account defaults /// </returns> public IQuery<ProductDefaults> GetProductDefaults() { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ProductDefaults>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("ProductDefaults"); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Run Report /// </summary> /// <remarks> /// Run a report and get the run id. /// </remarks> /// <returns> /// ReportRecord /// </returns> public IQuery<ReportRecord> GetRun(Uri url) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ReportRecord>(Client); sfApiQuery.Action("Run"); sfApiQuery.Uri(url); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Get recurring reports /// </summary> /// <remarks> /// Returns all recurring reports for the current account. /// </remarks> /// <returns> /// List of reports /// </returns> public IQuery<ODataFeed<Report>> GetRecurring() { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Report>>(Client); sfApiQuery.From("Reports"); sfApiQuery.Action("Recurring"); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Update AccessControl /// </summary> /// <example> /// { /// "Principal":{"Email":"*****@*****.**"}, /// "CanUpload":true, /// "CanDownload":true, /// "CanView":true, /// "CanDelete":true, /// "CanManagePermissions":true /// } /// </example> /// <remarks> /// Updates an existing Access Controls of a given Item. The Principal element cannot be modified, it is provided /// in the Body to identity the AccessControl element to be modified. You can provide an ID, Email or URL on the /// Principal object. /// </remarks> /// <param name="url"></param> /// <param name="accessControl"></param> /// <param name="recursive"></param> /// <returns> /// the created or modified AccessControl instance /// </returns> public IQuery<AccessControl> UpdateByItem(Uri url, AccessControl accessControl, bool recursive = false) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<AccessControl>(Client); sfApiQuery.Action("AccessControls"); sfApiQuery.Uri(url); sfApiQuery.QueryString("recursive", recursive); sfApiQuery.Body = accessControl; sfApiQuery.HttpMethod = "PATCH"; return sfApiQuery; }
/// <summary> /// Get AccessControl List By Item /// </summary> /// <remarks> /// Retrieves the Access Control List for a given Item. /// </remarks> /// <param name="url"></param> /// <returns> /// Access Control List of the given object ID. /// </returns> public IQuery<ODataFeed<AccessControl>> GetByItem(Uri url) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<AccessControl>>(Client); sfApiQuery.Action("AccessControls"); sfApiQuery.Uri(url); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Get Account Single Sign-On Configuration /// </summary> /// <remarks> /// Retrieve the Single Sign-on configuration for the Account /// </remarks> /// <param name="provider"></param> /// <param name="idpEntityId"></param> public IQuery<SSOAccountProvider> GetSSO(string provider = "saml", string idpEntityId = null) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<SSOAccountProvider>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("SSO"); sfApiQuery.QueryString("provider", provider); sfApiQuery.QueryString("idpEntityId", idpEntityId); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Create StorageCenter /// </summary> /// <example> /// { /// "ExternalAddress":"https://server/", /// "Version":"4.12.20", /// "HostName":"hostname" /// } /// </example> /// <remarks> /// Creates a new Storage Center associated with a specific zone /// </remarks> /// <param name="url"></param> /// <param name="storageCenter"></param> /// <returns> /// The new storage center /// </returns> public IQuery<StorageCenter> CreateByZone(Uri url, StorageCenter storageCenter) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<StorageCenter>(Client); sfApiQuery.Action("StorageCenters"); sfApiQuery.Uri(url); sfApiQuery.Body = storageCenter; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Create or replace the Login Access Control List of domains /// </summary> /// <example> /// { /// "AccessControlType" : "AllowedDomains", /// "Domains": ["domainA", "domainB", ...] /// } /// </example> /// <param name="AccessControlType"></param> /// <param name="Domains"></param> /// <returns> /// The new Login Access Control List of domains for the Account /// </returns> public IQuery<AccessControlDomains> CreateLoginAccessControlDomains(AccessControlDomains accessControlDomains) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<AccessControlDomains>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("LoginAccessControlDomains"); sfApiQuery.Body = accessControlDomains; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Get the Folder Access Control List of domains /// </summary> /// <remarks> /// Retrieve the list of domains that are allowed or disallowed to have access to folders. Whether the list is an allow or disallow list /// is configured by the AccessControlType property. /// /// The list blocks user access to folders by preventing adding a user to distribution groups or folders. /// The domain names are checked against the domains of all the email addresses of the user. /// This is an account-wide setting. /// </remarks> /// <returns> /// The Folder Access Control List of domains for the Account, e.g. /// /// { /// "AccessControlType" : "AllowedDomains", /// "Domains": ["domainA", "domainB", ...] /// } /// </returns> public IQuery<AccessControlDomains> GetFolderAccessControlDomains() { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<AccessControlDomains>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("FolderAccessControlDomains"); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Get List of Accounts for User /// </summary> /// <example> /// { /// "password":"******" /// } /// </example> /// <remarks> /// Retrieve the list of Accounts associated with a given user /// All parameters to this call may be passed in the Post body as root JSON parameters, or in the URI - /// with the exception of password that must be provided in the POST body. /// This operation does not require authentication /// </remarks> /// <param name="username"></param> /// <param name="password"></param> /// <param name="employeesonly"></param> /// <param name="requirehomefolders"></param> /// <param name="singleplane"></param> /// <returns> /// The list of Accounts associated with this username/password. /// </returns> public IQuery<ODataFeed<Account>> GetByUser(ODataObject parameters, string username, bool employeesonly = false, bool requirehomefolders = false, bool singleplane = false) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Account>>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("GetByUser"); parameters.AddProperty("username", username); parameters.AddProperty("employeesonly", employeesonly); parameters.AddProperty("requirehomefolders", requirehomefolders); parameters.AddProperty("singleplane", singleplane); sfApiQuery.Body = parameters; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Update Account Single Sign-On Configuration /// </summary> /// <example> /// { /// "LogoutUrl":"", /// "LoginUrl":"https://idp.com/signin", /// "IPRestrictions":"+all", /// "ForceSSO":true, /// "EntityID":"http://account.sf-api.com/saml/info", /// "SFEntityID":"http://idp.com/saml/info", /// "SPInitatedAuthContext":"exact", /// "SPInitatedAuthMethod":"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" /// } /// </example> /// <remarks> /// Modifies the Single Sign-on Configuration for this account. /// </remarks> /// <param name="sso"></param> /// <param name="provider"></param> public IQuery<SSOAccountProvider> UpdateSSO(SSOAccountProvider sso, string provider = "saml") { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<SSOAccountProvider>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("SSO"); sfApiQuery.QueryString("provider", provider); sfApiQuery.Body = sso; sfApiQuery.HttpMethod = "PATCH"; return sfApiQuery; }
/// <summary> /// Create or update Zone Metadata /// </summary> /// <example> /// [ /// {"Name":"metadataName1", "Value":"metadataValue1", "IsPublic":"true"}, /// {"Name":"metadataName2", "Value":"metadataValue2", "IsPublic":"false"}, /// ... /// ] /// </example> /// <remarks> /// Creates or updates Metadata entries associated with the specified zone /// </remarks> /// <param name="url"></param> /// <param name="metadata"></param> /// <returns> /// the zone metadata feed /// </returns> public IQuery<ODataFeed<Metadata>> CreateMetadata(Uri url, IEnumerable<Metadata> metadata) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Metadata>>(Client); sfApiQuery.Action("Metadata"); sfApiQuery.Uri(url); sfApiQuery.Body = metadata; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Get StorageCenter Metadata /// </summary> /// <remarks> /// Gets metadata associated with the specified storage center /// </remarks> /// <param name="zUrl"></param> /// <param name="scid"></param> /// <returns> /// the storage center metadata feed /// </returns> public IQuery<ODataFeed<Metadata>> GetMetadata(Uri zUrl, string scid) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Metadata>>(Client); sfApiQuery.Action("StorageCenters"); sfApiQuery.Uri(zUrl); sfApiQuery.ActionIds(scid); sfApiQuery.SubAction("Metadata"); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Update the Folder Access Control List of domains /// </summary> /// <example> /// { /// "AccessControlType" : "AllowedDomains", /// "Domains": ["domainA", "domainB", ...] /// } /// </example> /// <remarks> /// Merges the specified domains with existing domains in the list, and/or updates the AccessControlType. One of the parameters needs to be specified. It /// allows to add new domains to the list. /// </remarks> /// <param name="AccessControlType"></param> /// <param name="Domains"></param> /// <returns> /// The updated Folder Access Control List of domains for the Account /// </returns> public IQuery<AccessControlDomains> UpdateFolderAccessControlDomains(AccessControlDomains accessControlDomains) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<AccessControlDomains>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("FolderAccessControlDomains"); sfApiQuery.Body = accessControlDomains; sfApiQuery.HttpMethod = "PATCH"; return sfApiQuery; }
/// <summary> /// Get Account Preferences /// </summary> /// <returns> /// Account preferences /// </returns> public IQuery<AccountPreferences> GetPreferences() { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<AccountPreferences>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("Preferences"); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Get List of StorageCenters from Zone /// </summary> /// <remarks> /// Lists Storage Centers of a given Zone /// </remarks> /// <param name="url"></param> /// <returns> /// A list of Storage Centers associated with the provided zone /// </returns> public IQuery<ODataFeed<StorageCenter>> GetByZone(Uri url) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<StorageCenter>>(Client); sfApiQuery.Action("StorageCenters"); sfApiQuery.Uri(url); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Check if subdomain is required /// </summary> /// <param name="username"></param> /// <param name="singlePlane"></param> /// <returns> /// RequireSubdomainResult /// </returns> public IQuery<RequireSubdomainResult> RequireSubdomain(string username, bool singlePlane = false) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<RequireSubdomainResult>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("RequireSubdomain"); sfApiQuery.QueryString("username", username); sfApiQuery.QueryString("singlePlane", singlePlane); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Update StorageCenter /// </summary> /// <example> /// { /// "ExternalAddress":"https://server/", /// "Version":"4.12.20", /// "HostName":"hostname" /// } /// </example> /// <remarks> /// Updates an existing Storage Center /// </remarks> /// <param name="zUrl"></param> /// <param name="scid"></param> /// <param name="storageCenter"></param> /// <returns> /// the modified storage center /// </returns> public IQuery<StorageCenter> UpdateByZone(Uri zUrl, string scid, StorageCenter storageCenter) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<StorageCenter>(Client); sfApiQuery.Action("StorageCenters"); sfApiQuery.Uri(zUrl); sfApiQuery.ActionIds(scid); sfApiQuery.Body = storageCenter; sfApiQuery.HttpMethod = "PATCH"; return sfApiQuery; }
/// <summary> /// Find Subdomain /// </summary> /// <example> /// { /// "UsernameShort":"usernameShort", /// "Password":"******", /// "EmployeeOnly":false /// } /// </example> /// <remarks> /// Find the user account information based on the short username /// </remarks> /// <param name="findSubdomainParams"></param> /// <param name="singlePlane"></param> /// <returns> /// FindSubdomainResult /// </returns> public IQuery<FindSubdomainResult> FindSubdomain(FindSubdomainParams findSubdomainParams, bool singlePlane = false) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<FindSubdomainResult>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("FindSubdomain"); sfApiQuery.QueryString("singlePlane", singlePlane); sfApiQuery.Body = findSubdomainParams; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Create or update StorageCenter Metadata /// </summary> /// <example> /// [ /// {"Name":"metadataName1", "Value":"metadataValue1", "IsPublic":"true"}, /// {"Name":"metadataName2", "Value":"metadataValue2", "IsPublic":"false"}, /// ... /// ] /// </example> /// <remarks> /// Creates or updates Metadata entries associated with the specified storage center /// </remarks> /// <param name="zUrl"></param> /// <param name="scid"></param> /// <param name="metadata"></param> /// <returns> /// the storage center metadata feed /// </returns> public IQuery<ODataFeed<Metadata>> CreateMetadata(Uri zUrl, string scid, IEnumerable<Metadata> metadata) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Metadata>>(Client); sfApiQuery.Action("StorageCenters"); sfApiQuery.Uri(zUrl); sfApiQuery.ActionIds(scid); sfApiQuery.SubAction("Metadata"); sfApiQuery.Body = metadata; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Get Outlook Information /// </summary> /// <returns> /// OutlookInformation /// </returns> public IQuery<OutlookInformation> GetOutlookInformation() { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<OutlookInformation>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("OutlookInformation"); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Create AccessControl /// </summary> /// <example> /// { /// "Principal":{"url":"https://account.sf-api.com/v3/Groups(id)"}, /// "CanUpload":true, /// "CanDownload":true, /// "CanView":true, /// "CanDelete":true, /// "CanManagePermissions":true, /// "Message":"Message" /// } /// </example> /// <remarks> /// Creates a new Access Controls entry for a given Item. Access controls can only define a single Principal, /// which can be either a Group or User. The 'Principal' element is specified as an object - you should populate /// either the URL or the ID reference. /// </remarks> /// <param name="url"></param> /// <param name="accessControl"></param> /// <param name="recursive"></param> /// <param name="message"></param> /// <param name="sendDefaultNotification"></param> /// <returns> /// the created or modified AccessControl instance /// </returns> public IQuery<AccessControl> CreateByItem(Uri url, AccessControl accessControl, bool recursive = false, bool sendDefaultNotification = false, string message = null) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<AccessControl>(Client); sfApiQuery.Action("AccessControls"); sfApiQuery.Uri(url); sfApiQuery.QueryString("recursive", recursive); sfApiQuery.QueryString("sendDefaultNotification", sendDefaultNotification); accessControl.AddProperty("message", message); sfApiQuery.Body = accessControl; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Get SSO Info /// </summary> /// <param name="subdomain"></param> /// <returns> /// SSOInfo /// </returns> public IQuery<SSOInfo> GetSSOInfo(string subdomain) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<SSOInfo>(Client); sfApiQuery.From("Accounts"); sfApiQuery.Action("SSOInfo"); sfApiQuery.QueryString("subdomain", subdomain); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Create or Update multiple AccessControls for a given Item /// </summary> /// <example> /// { /// "NotifyUser":true, /// "NotifyMessage":"msg", /// /// "AccessControlParams": /// [ /// { /// "AccessControl": /// { /// "Principal" : { "Id":"existing_user_id" }, /// "CanUpload" : true, /// "CanDownload" : false, /// "CanView" : true /// }, /// "NotifyUser":false /// }, /// { /// "AccessControl": /// { /// "Principal" : { "Id":"group_id" }, /// "CanUpload" : false, /// "CanDownload" : true, /// "CanView" : true /// }, /// "Recursive":true /// }, /// { /// "AccessControl": /// { /// "Principal" : { "Email":"*****@*****.**" }, /// "CanUpload" : false, /// "CanDownload" : true, /// "CanView" : true /// } /// } /// ] /// } /// </example> /// <remarks> /// All the AccessControls are created or updated for a single Item identified by the Item id in the URI. AccessControl.Item Ids are not allowed. /// If an AccessControl doesn't specify NotifyUser or NotifyMessage property their values are inherited from the corresponding /// top-level properties. /// The Principal can be identified by Id or Email (Users). If a User with the specified email does not exist it will be created. /// Defaults for NotifyUser and Recursive are false. /// See AccessControlsBulkParams for other details. /// </remarks> /// <param name="url"></param> /// <param name="bulkParams"></param> /// <returns> /// AccessControlBulkResult /// </returns> public IQuery<AccessControlBulkResult> BulkSet(Uri url, AccessControlsBulkParams bulkParams) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<AccessControlBulkResult>(Client); sfApiQuery.Action("AccessControls"); sfApiQuery.Uri(url); sfApiQuery.SubAction("BulkSet"); sfApiQuery.Body = bulkParams; sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Reset Zone Secret /// </summary> /// <remarks> /// Resets the current Zone Secret to a new Random value /// Caution! This Call will invalidate all Storage Center communications until the Storage Center Zone secret /// is also updated. /// User must be a Zone admin to perform this action /// </remarks> /// <param name="url"></param> /// <returns> /// The modified Zone object /// </returns> public IQuery<Zone> ResetSecret(Uri url) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Zone>(Client); sfApiQuery.Action("ResetSecret"); sfApiQuery.Uri(url); sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Get Report Record by ID /// </summary> /// <remarks> /// Returns a single record. /// </remarks> /// <param name="id"></param> /// <returns> /// Single Record /// </returns> public IQuery<ReportRecord> GetRecord(string id) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ReportRecord>(Client); sfApiQuery.From("Reports"); sfApiQuery.Action("Record"); sfApiQuery.ActionIds(id); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Get the tenants of a multi-tenant zone /// </summary> /// <param name="parentUrl"></param> /// <returns> /// List of tenant accounts, not including the zone admin account. /// </returns> public IQuery<ODataFeed<Account>> GetTenants(Uri parentUrl) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Account>>(Client); sfApiQuery.Action("Tenants"); sfApiQuery.Uri(parentUrl); sfApiQuery.HttpMethod = "GET"; return sfApiQuery; }
/// <summary> /// Get a preview location for the report /// </summary> /// <param name="reportUrl"></param> public IQuery<ItemProtocolLink> Preview(Uri reportUrl) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ItemProtocolLink>(Client); sfApiQuery.Action("Preview"); sfApiQuery.Uri(reportUrl); sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }
/// <summary> /// Add a tenant account to a multi-tenant zone /// </summary> /// <param name="parentUrl"></param> /// <param name="accountId"></param> public IQuery<Account> CreateTenants(Uri parentUrl, string accountId) { var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Account>(Client); sfApiQuery.Action("Tenants"); sfApiQuery.Uri(parentUrl); sfApiQuery.QueryString("accountId", accountId); sfApiQuery.HttpMethod = "POST"; return sfApiQuery; }