Esempio n. 1
0
        /// <summary>
        /// Create a Feedback Workflow
        /// </summary>
        /// <example>
        /// {
        /// "Participants":
        /// [
        /// {
        /// "Contact":
        /// {
        /// "Email": "*****@*****.**"
        /// },
        /// "Role": "Active"
        /// },
        /// {
        /// "Contact":
        /// {
        /// "Email": "*****@*****.**"
        /// },
        /// "Role": "Passive"
        /// }
        /// ]
        /// }
        /// </example>
        /// <param name="url"></param>
        /// <param name="request"></param>
        /// <returns>
        /// A new feedback workflow
        /// </returns>
        public IQuery <Workflow> CreateFeedback(Uri url, CreateWorkflowParams request)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Workflow>(Client);

            sfApiQuery.Action("Workflows");
            sfApiQuery.Uri(url);
            sfApiQuery.SubAction("Feedback");
            sfApiQuery.Body       = request;
            sfApiQuery.HttpMethod = "POST";
            return(sfApiQuery);
        }
Esempio n. 2
0
        /// <summary>
        /// Get List of Protocol Links of a Share item
        /// </summary>
        /// <param name="shareUrl"></param>
        /// <param name="itemid"></param>
        /// <param name="platform"></param>
        /// <returns>
        /// A list of protocol links depending on the input parameter 'platform', 404 (Not Found) if not supported by the item
        /// </returns>
        public IQuery <ODataFeed <ItemProtocolLink> > ProtocolLinks(Uri shareUrl, string itemid, PreviewPlatform platform)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <ItemProtocolLink> >(Client);

            sfApiQuery.Action("Items");
            sfApiQuery.Uri(shareUrl);
            sfApiQuery.ActionIds(itemid);
            sfApiQuery.SubAction("ProtocolLinks", platform);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Esempio n. 3
0
        /// <summary>
        /// Get list of multi-tenant zones assigned to a tenant.
        /// </summary>
        /// <param name="parentid"></param>
        /// <returns>
        /// List of multi-tenant zones assigned to the tenant
        /// </returns>
        public IQuery <ODataFeed <Zone> > GetZones(string parentid)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <Zone> >(Client);

            sfApiQuery.From("Accounts");
            sfApiQuery.Action("Tenants");
            sfApiQuery.ActionIds(parentid);
            sfApiQuery.SubAction("Zones");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 5
0
        /// <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>
        /// Retrieve the list of Storage Centers associated with a Connector Group
        /// </summary>
        /// <remarks>
        /// Retrieve the list of storage centers associated with a Connector Group.
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="zoneid"></param>
        /// <returns>
        /// The modified Connector Group
        /// </returns>
        public IQuery <ODataFeed <StorageCenter> > GetStorageCenters(Uri url, string zoneid)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <StorageCenter> >(Client);

            sfApiQuery.Action("Zones");
            sfApiQuery.Uri(url);
            sfApiQuery.ActionIds(zoneid);
            sfApiQuery.SubAction("StorageCenters");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Esempio n. 7
0
        /// <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);
        }
Esempio n. 8
0
        /// <summary>
        /// Get spreadsheet data
        /// </summary>
        /// <remarks>
        /// Download spreadsheet data for a report. If parameter "getSigndedUrl" is true,
        /// this endpoint returns a Download Specification object with a "url" parameter, which will point to the file's location
        /// </remarks>
        /// <param name="id"></param>
        /// <param name="getSignedUrl"></param>
        /// <returns>
        /// Excel Formatted Report Results or Download Specification
        /// </returns>
        public IQuery <DownloadSpecification> DownloadData(string id, bool getSignedUrl = false)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <DownloadSpecification>(Client);

            sfApiQuery.From("Reports");
            sfApiQuery.Action("Records");
            sfApiQuery.ActionIds(id);
            sfApiQuery.SubAction("DownloadData");
            sfApiQuery.QueryString("getSignedUrl", getSignedUrl);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Esempio n. 9
0
        /// <summary>
        /// Download Items from a Share for a Recipient
        /// </summary>
        /// <example>
        /// GET https://account.sf-api.com/sf/v3/Shares(shareid)/Recipients(aliasid)/DownloadWithAlias?id=itemid
        /// GET https://account.sf-api.com/sf/v3/Shares(shareid)/Recipients(aliasid)/DownloadWithAlias(itemid)
        /// </example>
        /// <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 user informaion ( Email, First Name, Last Name and Company), make sure
        /// to create an Recipient (alias)To download Shares that require authentication, make sure this request is authenticated.
        /// Anyone can download files from anonymous shares.You can also download individual Items in the Share. Use the Shares(id)/Recipients(aliasid)/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="aliasid"></param>
        /// <param name="itemId"></param>
        /// <param name="redirect"></param>
        /// <returns>
        /// Redirects the caller (302) to the download address for the share contents.
        /// </returns>
        public IQuery <Stream> DownloadWithAlias(Uri shareUrl, string aliasid, string itemId = null, bool redirect = true)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Stream>(Client);

            sfApiQuery.Action("Recipients");
            sfApiQuery.Uri(shareUrl);
            sfApiQuery.ActionIds(aliasid);
            sfApiQuery.SubAction("DownloadWithAlias");
            sfApiQuery.QueryString("id", itemId);
            sfApiQuery.QueryString("redirect", redirect);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Esempio n. 10
0
        /// <summary>
        /// Get Thumbnail of a Share Item
        /// </summary>
        /// <remarks>
        /// Retrieve a thumbnail link for the specified Item in the Share.
        /// </remarks>
        /// <param name="shareUrl"></param>
        /// <param name="itemid"></param>
        /// <param name="size"></param>
        /// <param name="redirect"></param>
        /// <returns>
        /// A 302 redirection to the Thumbnail link
        /// </returns>
        public IQuery <Stream> Thumbnail(Uri shareUrl, string itemid, int size = 75, bool redirect = false)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Stream>(Client);

            sfApiQuery.Action("Items");
            sfApiQuery.Uri(shareUrl);
            sfApiQuery.ActionIds(itemid);
            sfApiQuery.SubAction("Thumbnail");
            sfApiQuery.QueryString("size", size);
            sfApiQuery.QueryString("redirect", redirect);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Esempio n. 11
0
        /// <summary>
        /// Get list of multi-tenant zones assigned to a tenant.
        /// </summary>
        /// <param name="parentid"></param>
        /// <returns>
        /// List of multi-tenant zones assigned to the tenant
        /// </returns>
        public IQuery<ODataFeed<Zone>> GetZones(string parentid)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Zone>>(Client);
		    sfApiQuery.From("Accounts");
		    sfApiQuery.Action("Tenants");
            sfApiQuery.ActionIds(parentid);
            sfApiQuery.SubAction("Zones");
            sfApiQuery.HttpMethod = "GET";	
		    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;
        }
Esempio n. 13
0
 /// <summary>
 /// Download Items from a Share for a Recipient
 /// </summary>
 /// <example>
 /// GET https://account.sf-api.com/sf/v3/Shares(shareid)/Recipients(aliasid)/DownloadWithAlias?id=itemid
 /// GET https://account.sf-api.com/sf/v3/Shares(shareid)/Recipients(aliasid)/DownloadWithAlias(itemid)
 /// </example>
 /// <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 user informaion ( Email, First Name, Last Name and Company), make sure
 /// to create an Recipient (alias)To download Shares that require authentication, make sure this request is authenticated.
 /// Anyone can download files from anonymous shares.You can also download individual Items in the Share. Use the Shares(id)/Recipients(aliasid)/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="aliasid"></param>
 /// <param name="itemId"></param>
 /// <param name="redirect"></param>
 /// <returns>
 /// Redirects the caller (302) to the download address for the share contents.
 /// </returns>
 public IQuery<Stream> DownloadWithAlias(Uri shareUrl, string aliasid, string itemId = null, bool redirect = true)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Stream>(Client);
     sfApiQuery.Action("Recipients");
     sfApiQuery.Uri(shareUrl);
     sfApiQuery.ActionIds(aliasid);
     sfApiQuery.SubAction("DownloadWithAlias");
     sfApiQuery.QueryString("id", itemId);
     sfApiQuery.QueryString("redirect", redirect);
     sfApiQuery.HttpMethod = "GET";
     return sfApiQuery;
 }
        /// <summary>
        /// Adds a Connector Group to a Storage Center
        /// </summary>
        /// <example>
        /// {
        /// "Id":"storageCenterId"
        /// }
        /// </example>
        /// <remarks>
        /// Associate a Connector Group with a Storage Center. The Connector Group has to be
        /// associated with the Storage Center Zone.
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="zoneid"></param>
        /// <returns>
        /// The modified Connector Group
        /// </returns>
        public IQuery<ODataFeed<StorageCenter>> CreateStorageCenters(Uri url, string zoneid, StorageCenter storageCenter)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<StorageCenter>>(Client);
		    sfApiQuery.Action("Zones");
            sfApiQuery.Uri(url);
            sfApiQuery.ActionIds(zoneid);
            sfApiQuery.SubAction("StorageCenters");
            sfApiQuery.Body = storageCenter;
            sfApiQuery.HttpMethod = "POST";	
		    return sfApiQuery;
        }
Esempio n. 15
0
        /// <summary>
        /// Download Multiple Items from a Share for a Recipient
        /// </summary>
        /// <example>
        /// ["id1","id2",...]
        /// </example>
        /// <remarks>
        /// Download Multiple Items from a Share for a Recipient. The download will contain a ZIP archive containing all
        /// files and folders in the share, named Files.zip.To download Shares that require user informaion ( Email, First Name, Last Name and Company), make sure
        /// to create an Recipient (alias) and pass in the alaisId.To download Shares that require authentication, make sure this request is authenticated.
        /// Anyone can download files from anonymous shares.
        /// </remarks>
        /// <param name="shareUrl"></param>
        /// <param name="aliasid"></param>
        /// <param name="ids"></param>
        /// <param name="redirect"></param>
        /// <returns>
        /// Redirects the caller (302) to the download address for the share contents.
        /// </returns>
        public IQuery<Stream> BulkDownload(Uri shareUrl, string aliasid, IEnumerable<string> ids, bool redirect = true)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Stream>(Client);
		    sfApiQuery.Action("Recipients");
            sfApiQuery.Uri(shareUrl);
            sfApiQuery.ActionIds(aliasid);
            sfApiQuery.SubAction("BulkDownload");
            sfApiQuery.QueryString("redirect", redirect);
            sfApiQuery.Body = ids;
            sfApiQuery.HttpMethod = "POST";	
		    return sfApiQuery;
        }
Esempio n. 16
0
        /// <summary>
        /// Get Sent Message Content by Share
        /// </summary>
        /// <remarks>
        /// Returns sent message content.
        /// </remarks>
        /// <param name="shareUrl"></param>
        /// <param name="aliasId"></param>
        /// <returns>
        /// Sent Message Content
        /// </returns>
        public IQuery<Stream> Message(Uri shareUrl, string aliasId)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Stream>(Client);
		    sfApiQuery.Action("Recipients");
            sfApiQuery.Uri(shareUrl);
            sfApiQuery.ActionIds(aliasId);
            sfApiQuery.SubAction("Message");
            sfApiQuery.HttpMethod = "GET";	
		    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;
        }
Esempio n. 18
0
 /// <summary>
 /// Get List of Protocol Links of a Share item
 /// </summary>
 /// <param name="shareUrl"></param>
 /// <param name="itemid"></param>
 /// <param name="platform"></param>
 /// <returns>
 /// A list of protocol links depending on the input parameter 'platform', 404 (Not Found) if not supported by the item
 /// </returns>
 public IQuery<ODataFeed<ItemProtocolLink>> ProtocolLinks(Uri shareUrl, string itemid, PreviewPlatform platform)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<ItemProtocolLink>>(Client);
     sfApiQuery.Action("Items");
     sfApiQuery.Uri(shareUrl);
     sfApiQuery.ActionIds(itemid);
     sfApiQuery.SubAction("ProtocolLinks", platform);
     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;
        }
Esempio n. 20
0
 /// <summary>
 /// Get Thumbnail of a Share Item
 /// </summary>
 /// <remarks>
 /// Retrieve a thumbnail link for the specified Item in the Share.
 /// </remarks>
 /// <param name="shareUrl"></param>
 /// <param name="itemid"></param>
 /// <param name="size"></param>
 /// <param name="redirect"></param>
 /// <returns>
 /// A 302 redirection to the Thumbnail link
 /// </returns>
 public IQuery<Stream> Thumbnail(Uri shareUrl, string itemid, int size = 75, bool redirect = false)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Stream>(Client);
     sfApiQuery.Action("Items");
     sfApiQuery.Uri(shareUrl);
     sfApiQuery.ActionIds(itemid);
     sfApiQuery.SubAction("Thumbnail");
     sfApiQuery.QueryString("size", size);
     sfApiQuery.QueryString("redirect", redirect);
     sfApiQuery.HttpMethod = "GET";
     return sfApiQuery;
 }