Пример #1
0
 /// <summary>
 /// Create SymbolicLink
 /// </summary>
 /// <example>
 /// {
 /// "Name":"RemoteFileName",
 /// "Description":"Description",
 /// "Zone":{ "Id":"z014766e-8e96-4615-86aa-57132a69843c" },
 /// "ConnectorGroup": { "Id":"1" }
 /// }
 /// </example>
 /// <remarks>
 /// Creates a Symbolic Link
 /// The body must contain either a "Link" parameter with a fully qualified URI; or use
 /// FileName + Zone to have sharefile.com attempt to convert the Connector path to an
 /// URI using a call to the Zone - using ShareFile Hash authentication mode. For active
 /// clients, it's recommended to make the convertion call to the Zone directly, using
 /// Items/ByPath=name, retriving the resulting URL, and calling this method with the
 /// Link parameter.SymbolicLinks must be created as top-level folders - i.e., this call requires
 /// the parent to be the Item(accountid) element.Zone defines the location of the SymbolicLink target - for example, for
 /// Network Shares connectors, the SymbolicLink will point to the StorageZone Controller
 /// that will serve the file browsing requests.The ConnectorGroup parameter indicates the kind of symbolic link - e.g., Network
 /// Share, or SharePoint.
 /// </remarks>
 /// <param name="parentUrl"></param>
 /// <param name="symlink"></param>
 /// <param name="overwrite"></param>
 /// <returns>
 /// the new SymbolicLink
 /// </returns>
 public IQuery<SymbolicLink> CreateSymbolicLink(Uri parentUrl, SymbolicLink symlink, bool overwrite = false)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<SymbolicLink>(Client);
     sfApiQuery.Action("SymbolicLink");
     sfApiQuery.Uri(parentUrl);
     sfApiQuery.QueryString("overwrite", overwrite);
     sfApiQuery.Body = symlink;
     sfApiQuery.HttpMethod = "POST";
     return sfApiQuery;
 }
Пример #2
0
 /// <summary>
 /// Update SymbolicLink
 /// </summary>
 /// <example>
 /// {
 /// "Name":"Name",
 /// "Description":"Description",
 /// "Link": "https://server/path"
 /// }
 /// </example>
 /// <remarks>
 /// Updates a Symbolic Link object
 /// </remarks>
 /// <param name="id"></param>
 /// <param name="symlink"></param>
 /// <returns>
 /// The modified SymbolicLink object
 /// </returns>
 public IQuery<SymbolicLink> UpdateSymbolicLink(string id, SymbolicLink symlink)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<SymbolicLink>(Client);
     sfApiQuery.From("Items");
     sfApiQuery.Action("SymbolicLink");
     sfApiQuery.ActionIds(id);
     sfApiQuery.Body = symlink;
     sfApiQuery.HttpMethod = "PATCH";
     return sfApiQuery;
 }
Пример #3
0
 /// <summary>
 /// Creates SymbolicLink
 /// </summary>
 /// <example>
 /// {
 /// "Name":"RemoteFileName",
 /// "Description":"Description",
 /// "Link":"https://server/provider/version/Items(id)",
 /// "Zone":{ "Id":"z014766e-8e96-4615-86aa-57132a69843c" },
 /// "ConnectorGroup": { "Id":"1" }
 /// }
 /// </example>
 /// <param name="url"></param>
 /// <param name="symlink"></param>
 /// <param name="overwrite"></param>
 /// <returns>
 /// the new SymbolicLink
 /// </returns>
 public IQuery<SymbolicLink> CreateChildrenByConnectorGroup(Uri url, SymbolicLink symlink, bool overwrite = false)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<SymbolicLink>(Client);
     sfApiQuery.Action("Children");
     sfApiQuery.Uri(url);
     sfApiQuery.QueryString("overwrite", overwrite);
     sfApiQuery.Body = symlink;
     sfApiQuery.HttpMethod = "POST";
     return sfApiQuery;
 }