예제 #1
0
        /// <summary>
        /// Upload File to Request Share
        /// </summary>
        /// <example>
        /// POST https://account.sf-api.com/sf/v3/Shares(id)/Upload2
        /// {
        /// "Method":"Method",
        /// "Raw": false,
        /// "FileName":"FileName"
        /// "FileLength": length
        /// }
        /// </example>
        /// <remarks>
        /// Prepares the links for uploading files to the target Share.
        /// This method returns an Upload Specification object. The fields are
        /// populated based on the upload method, provider, and resume parameters passed to the
        /// upload call.
        /// The Method determines how the URLs must be called.
        ///
        /// Standard uploads use a single HTTP POST message to the ChunkUri address provided in
        /// the response. All other fields will be empty. Standard uploads do not support Resume.
        ///
        /// Streamed uploads use multiple HTTP POST calls to the ChunkUri address. The client must
        /// append the parameters index, offset and hash to the end of the ChunkUri address. Index
        /// is a sequential number representing the data block (zero-based); Offset represents the
        /// byte offset for the block; and hash contains the MD5 hash of the block. The last HTTP
        /// POST must also contain finish=true parameter.
        ///
        /// Threaded uploads use multiple HTTP POST calls to ChunkUri, and can have a number of
        /// threads issuing blocks in parallel. Clients must append index, offset and hash to
        /// the end of ChunkUri, as explained in Streamed. After all chunks were sent, the client
        /// must call the FinishUri provided in this spec.
        ///
        /// For all uploaders, the contents of the POST Body can either be "raw", if the "Raw" parameter
        /// was provided to the Uploader, or use MIME multi-part form encoding otherwise. Raw uploads
        /// simply put the block content in the POST body - Content-Length specifies the size. Multi-part
        /// form encoding has to pass the File as a Form parameter named "File1".
        ///
        /// For streamed and threaded, if Resume options were provided to the Upload call, then the
        /// fields IsResume, ResumeIndex, ResumeOffset and ResumeFileHash MAY be populated. If they are,
        /// it indicates that the server has identified a partial upload with that specification, and is
        /// ready to resume on the provided parameters. The clients can then verify the ResumeFileHash to
        /// ensure the file has not been modified; and continue issuing ChunkUri calls from the ResumeIndex
        /// ResumeOffset parameters. If the client decides to restart, it should simply ignore the resume
        /// parameters and send the blocks from Index 0.
        ///
        /// For all uploaders: the result code for the HTTP POST calls to Chunk and Finish Uri can either
        /// be a 401 - indicating authentication is required; 4xx/5xx indicating some kind of error; or
        /// 200 with a Content Body of format 'ERROR:message'. Successful calls will return either a 200
        /// response with no Body, or with Body of format 'OK'.
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="method"></param>
        /// <param name="raw"></param>
        /// <param name="fileName"></param>
        /// <param name="fileSize"></param>
        /// <param name="batchId"></param>
        /// <param name="batchLast"></param>
        /// <param name="canResume"></param>
        /// <param name="startOver"></param>
        /// <param name="unzip"></param>
        /// <param name="tool"></param>
        /// <param name="overwrite"></param>
        /// <param name="title"></param>
        /// <param name="details"></param>
        /// <param name="isSend"></param>
        /// <param name="sendGuid"></param>
        /// <param name="opid"></param>
        /// <param name="threadCount"></param>
        /// <param name="responseFormat"></param>
        /// <param name="notify"></param>
        /// <returns>
        /// an Upload Specification element, containing the links for uploading, and the parameters for resume.
        /// The caller must know the protocol for sending the prepare, chunk and finish URLs returned in the spec; as well as
        /// negotiate the resume upload.
        /// </returns>
        public IQuery <UploadSpecification> Upload(Uri url, UploadMethod method = UploadMethod.Standard, bool raw = false, string fileName = null, long fileSize = 0, string batchId = null, bool batchLast = false, bool canResume = false, bool startOver = false, bool unzip = false, string tool = "apiv3", bool overwrite = false, string title = null, string details = null, bool isSend = false, string sendGuid = null, string opid = null, int threadCount = 4, string responseFormat = "json", bool notify = false, DateTime?clientCreatedDateUTC = null, DateTime?clientModifiedDateUTC = null, int?expirationDays = null)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <UploadSpecification>(Client);

            sfApiQuery.Action("Upload");
            sfApiQuery.Uri(url);
            sfApiQuery.QueryString("method", method);
            sfApiQuery.QueryString("raw", raw);
            sfApiQuery.QueryString("fileName", fileName);
            sfApiQuery.QueryString("fileSize", fileSize);
            sfApiQuery.QueryString("batchId", batchId);
            sfApiQuery.QueryString("batchLast", batchLast);
            sfApiQuery.QueryString("canResume", canResume);
            sfApiQuery.QueryString("startOver", startOver);
            sfApiQuery.QueryString("unzip", unzip);
            sfApiQuery.QueryString("tool", tool);
            sfApiQuery.QueryString("overwrite", overwrite);
            sfApiQuery.QueryString("title", title);
            sfApiQuery.QueryString("details", details);
            sfApiQuery.QueryString("isSend", isSend);
            sfApiQuery.QueryString("sendGuid", sendGuid);
            sfApiQuery.QueryString("opid", opid);
            sfApiQuery.QueryString("threadCount", threadCount);
            sfApiQuery.QueryString("responseFormat", responseFormat);
            sfApiQuery.QueryString("notify", notify);
            sfApiQuery.QueryString("clientCreatedDateUTC", clientCreatedDateUTC);
            sfApiQuery.QueryString("clientModifiedDateUTC", clientModifiedDateUTC);
            sfApiQuery.QueryString("expirationDays", expirationDays);
            sfApiQuery.HttpMethod = "POST";
            return(sfApiQuery);
        }
        /// <summary>
        /// Get FavoriteFolder
        /// </summary>
        /// <remarks>
        /// Retrieve a single Favorite Folder from a give user
        /// </remarks>
        /// <returns>
        /// The selected Favorite Folder
        /// </returns>
        public IQuery <FavoriteFolder> Get(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <FavoriteFolder>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #3
0
        /// <summary>
        /// Gets a WebhookSubscription based on id
        /// </summary>
        /// <param name="url"></param>
        /// <returns>
        /// WebhookSubscription
        /// </returns>
        public IQuery <WebhookSubscription> Get(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <WebhookSubscription>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
        /// <summary>
        /// Get AccessControl by ID
        /// </summary>
        /// <remarks>
        /// Retrieves a single Access Control entry for a given Item and Principal
        /// </remarks>
        /// <returns>
        /// A single AccessControl object matching the query
        /// </returns>
        public IQuery <AccessControl> Get(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <AccessControl>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #5
0
        public IQuery <ConnectedApp> Get(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ConnectedApp>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #6
0
        /// <summary>
        /// Get AsyncOperation by ID
        /// </summary>
        /// <remarks>
        /// Retrieve a single Async Op record by ID
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// A single Async Operation record
        /// </returns>
        public IQuery <AsyncOperation> Get(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <AsyncOperation>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #7
0
        public IQuery <RemoteUpload> Get(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <RemoteUpload>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #8
0
        /// <summary>
        /// Get Devices for given User
        /// </summary>
        /// <param name="parentUrl"></param>
        /// <returns>
        /// List of Devices
        /// </returns>
        public IQuery <ODataFeed <DeviceUser> > GetByUser(Uri parentUrl)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <DeviceUser> >(Client);

            sfApiQuery.Action("Devices");
            sfApiQuery.Uri(parentUrl);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #9
0
        /// <summary>
        /// Get a protocol link to view a workflow in a web browser.
        /// </summary>
        /// <remarks>
        /// Only the latest version of each major browser is supported.
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// A ItemProtocolLink set for the Workflow
        /// </returns>
        public IQuery <ItemProtocolLink> GetLink(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ItemProtocolLink>(Client);

            sfApiQuery.Action("Link");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #10
0
        /// <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);
        }
예제 #11
0
        /// <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);
        }
예제 #12
0
        /// <summary>
        /// Get List of Zones
        /// </summary>
        /// <remarks>
        /// Retrieve the list of Zones accessible to the authenticated user
        /// This method will concatenate the list of private zones in the user's account and the
        /// list of public zones accessible to this account. Any user can see the list of zones.
        /// </remarks>
        /// <param name="services"></param>
        /// <param name="includeDisabled"></param>
        /// <returns>
        /// The list of public and private zones accessible to this user
        /// </returns>
        public IQuery <Zone> Get(Uri url, bool secret = false)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Zone>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.QueryString("secret", secret);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #13
0
        /// <summary>
        /// Changes the state of an AsyncOperation
        /// </summary>
        /// <example>
        /// { "State": "..." }
        /// </example>
        /// <remarks>
        /// Only the State parameter is updated, other fields are ignored
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="newAsyncOp"></param>
        /// <returns>
        /// The modified Async Operation
        /// </returns>
        public IQuery <AsyncOperation> Patch(Uri url, AsyncOperation newAsyncOp)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <AsyncOperation>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.Body       = newAsyncOp;
            sfApiQuery.HttpMethod = "PUT";
            return(sfApiQuery);
        }
예제 #14
0
        /// <summary>
        /// Cancel AsyncOperation
        /// </summary>
        /// <remarks>
        /// Cancels a single Async operation record
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// The modified Async Operation record
        /// </returns>
        public IQuery <AsyncOperation> Cancel(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <AsyncOperation>(Client);

            sfApiQuery.Action("Cancel");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "POST";
            return(sfApiQuery);
        }
예제 #15
0
        /// <summary>
        /// Get EncryptedEmail by Share Id
        /// </summary>
        /// <remarks>
        /// Gets the EncryptedEmail associated with the Share.
        /// </remarks>
        /// <param name="shareUrl"></param>
        /// <returns>
        /// Associated EncryptedEmail
        /// </returns>
        public IQuery <EncryptedEmail> GetEncryptedEmailByShare(Uri shareUrl)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <EncryptedEmail>(Client);

            sfApiQuery.Action("EncryptedEmail");
            sfApiQuery.Uri(shareUrl);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #16
0
        /// <summary>
        /// Get User Preferences
        /// </summary>
        /// <remarks>
        /// Retrieves the User preferences record - all user-selected prefernces, such as timezone,
        /// time format, sort preferences, etc.
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// the user selected preferences
        /// </returns>
        public IQuery <UserPreferences> GetPreferences(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <UserPreferences>(Client);

            sfApiQuery.Action("Preferences");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #17
0
        /// <summary>
        /// Patch Storage Center
        /// </summary>
        /// <example>
        /// {
        /// "ExternalAddress":"https://server/",
        /// "Version":"4.12.20",
        /// "HostName":"hostname" }
        /// </example>
        /// <param name="url"></param>
        /// <param name="sc"></param>
        /// <returns>
        /// Modified Storage Center
        /// </returns>
        public IQuery <StorageCenter> Update(Uri url, StorageCenter sc)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <StorageCenter>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.Body       = sc;
            sfApiQuery.HttpMethod = "PATCH";
            return(sfApiQuery);
        }
예제 #18
0
        /// <summary>
        /// Get Group Contacts
        /// </summary>
        /// <remarks>
        /// Retrieves the Contacts navigation property of a Group
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// A feed of Contacts representing the members of the Group
        /// </returns>
        public IQuery <ODataFeed <Contact> > GetContacts(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <Contact> >(Client);

            sfApiQuery.Action("Contacts");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #19
0
        /// <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>
        /// Get Item as Favorite Folder
        /// </summary>
        /// <remarks>
        /// Retrieves a Favorite Folder representation of a given parent Item
        /// </remarks>
        /// <param name="parentUrl"></param>
        /// <returns>
        /// The specified Favorite Folder if it belongs to the specified parent Item
        /// </returns>
        public IQuery <FavoriteFolder> GetFavoriteFolderByItem(Uri parentUrl)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <FavoriteFolder>(Client);

            sfApiQuery.Action("FavoriteFolder");
            sfApiQuery.Uri(parentUrl);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #21
0
        /// <summary>
        /// Modify Share
        /// </summary>
        /// <example>
        /// {
        /// "Title": "New Title",
        /// "ExpirationDate": "2013-07-23",
        /// "RequireLogin": false,
        /// "Items": [ { "Id":"itemid" }, {...} ],
        /// }
        /// </example>
        /// <remarks>
        /// Modifies an existing Share. If Items are specified they are added to the share.
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="share"></param>
        /// <returns>
        /// The modified Share
        /// </returns>
        public IQuery <Share> Update(Uri url, Share share)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Share>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.Body       = share;
            sfApiQuery.HttpMethod = "PATCH";
            return(sfApiQuery);
        }
예제 #22
0
        /// <summary>
        /// Get User Security
        /// </summary>
        /// <remarks>
        /// Retrieve the user security record - current state of the user regarding
        /// security and password settings.
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// the user security status
        /// </returns>
        public IQuery <UserSecurity> GetSecurity(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <UserSecurity>(Client);

            sfApiQuery.Action("Security");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #23
0
        /// <summary>
        /// Update Group
        /// </summary>
        /// <example>
        /// {
        /// "Name":"Name",
        /// "IsShared":true,
        /// }
        /// </example>
        /// <remarks>
        /// Updates an existing group.
        /// This operation will ignore the provided clients list. Use the \Contacts navigation link to
        /// add/remove elements from a group
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="group"></param>
        /// <returns>
        /// the modified group object
        /// </returns>
        public IQuery <Group> Update(Uri url, Group group)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Group>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.Body       = group;
            sfApiQuery.HttpMethod = "PATCH";
            return(sfApiQuery);
        }
예제 #24
0
        public IQuery <ODataFeed <TwoFactorAuthApp> > GetTFAByUser(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <TwoFactorAuthApp> >(Client);

            sfApiQuery.Action("TFA");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
        /// <summary>
        /// Get List of FavoriteFolders
        /// </summary>
        /// <remarks>
        /// Retrieves the list of Favorite folders for a given user.
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// A list of Favorite Folders specified by this user
        /// </returns>
        public IQuery <ODataFeed <FavoriteFolder> > GetByUser(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <FavoriteFolder> >(Client);

            sfApiQuery.Action("FavoriteFolders");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #26
0
        /// <summary>
        /// Get Apps for given User
        /// </summary>
        /// <param name="userUrl"></param>
        /// <returns>
        /// A feed of ConnectedApp objects
        /// </returns>
        public IQuery <ODataFeed <ConnectedApp> > GetByUser(Uri userUrl)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <ConnectedApp> >(Client);

            sfApiQuery.Action("Apps");
            sfApiQuery.Uri(userUrl);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #27
0
        /// <summary>
        /// Get Redirection endpoint Information
        /// </summary>
        /// <remarks>
        /// Returns the redirection endpoint for this Share.
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// The Redirection endpoint Information
        /// </returns>
        public IQuery <Redirection> GetRedirection(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Redirection>(Client);

            sfApiQuery.Action("Redirection");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #28
0
        /// <summary>
        /// Update Metadata
        /// </summary>
        /// <example>
        /// {
        /// "Value":"metadata value"
        /// }
        /// </example>
        /// <remarks>
        /// Updates a single Metadata entry that has a specified Name for a given Item. Fails if an entry with the given name doesn't exist for this Item.
        /// </remarks>
        /// <returns>
        /// The updated Metadata object
        /// </returns>
        public IQuery <Metadata> Update(Uri url, Metadata metadata)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Metadata>(Client);

            sfApiQuery.Uri(url);
            sfApiQuery.Body       = metadata;
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #29
0
        /// <summary>
        /// Get Metadata List By Item
        /// </summary>
        /// <remarks>
        /// Retrieves the Metadata List for a given Item.
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// The Metadata list of the given object ID.
        /// </returns>
        public IQuery <ODataFeed <Metadata> > GetByItem(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <Metadata> >(Client);

            sfApiQuery.Action("Metadata");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
예제 #30
0
        /// <summary>
        /// Generates a new secondary signature key for the webhook client
        /// </summary>
        /// <param name="url"></param>
        /// <returns>
        /// WebhookClient
        /// </returns>
        public IQuery <WebhookClient> GenerateSecondarySignatureKey(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <WebhookClient>(Client);

            sfApiQuery.Action("SecondarySignatureKey");
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "POST";
            return(sfApiQuery);
        }
예제 #31
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;
 }
예제 #32
0
        /// <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;
        }
예제 #33
0
        /// <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;
        }
예제 #34
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;
        }
예제 #35
0
 /// <summary>
 /// Get Recipients of a Share
 /// </summary>
 /// <remarks>
 /// Retrieve the list of Recipients in the share. Recipients represent the target users of the Share, containing
 /// access information, such as number of times that user downloaded files from the share. Each Recipient is
 /// identified by an Alias, which is an unique ID given to each user - allowing tracking of downloads for
 /// non-authenticated users.
 /// </remarks>
 /// <param name="url"></param>
 /// <returns>
 /// A feed of Share Aliases representing recipients of the Share
 /// </returns>
 public IQuery<ODataFeed<ShareAlias>> GetRecipients(Uri url)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<ShareAlias>>(Client);
     sfApiQuery.Action("Recipients");
     sfApiQuery.Uri(url);
     sfApiQuery.HttpMethod = "GET";
     return sfApiQuery;
 }
예제 #36
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;
 }
예제 #37
0
 /// <summary>
 /// Upload File to Request Share
 /// </summary>
 /// <example>
 /// POST https://account.sf-api.com/sf/v3/Shares(id)/Upload2
 /// {
 /// "Method":"Method",
 /// "Raw": false,
 /// "FileName":"FileName"
 /// "FileLength": length
 /// }
 /// </example>
 /// <remarks>
 /// Prepares the links for uploading files to the target Share.
 /// This method returns an Upload Specification object. The fields are
 /// populated based on the upload method, provider, and resume parameters passed to the
 /// upload call.
 /// The Method determines how the URLs must be called.
 /// 
 /// Standard uploads use a single HTTP POST message to the ChunkUri address provided in
 /// the response. All other fields will be empty. Standard uploads do not support Resume.
 /// 
 /// Streamed uploads use multiple HTTP POST calls to the ChunkUri address. The client must
 /// append the parameters index, offset and hash to the end of the ChunkUri address. Index
 /// is a sequential number representing the data block (zero-based); Offset represents the
 /// byte offset for the block; and hash contains the MD5 hash of the block. The last HTTP
 /// POST must also contain finish=true parameter.
 /// 
 /// Threaded uploads use multiple HTTP POST calls to ChunkUri, and can have a number of
 /// threads issuing blocks in parallel. Clients must append index, offset and hash to
 /// the end of ChunkUri, as explained in Streamed. After all chunks were sent, the client
 /// must call the FinishUri provided in this spec.
 /// 
 /// For all uploaders, the contents of the POST Body can either be "raw", if the "Raw" parameter
 /// was provided to the Uploader, or use MIME multi-part form encoding otherwise. Raw uploads
 /// simply put the block content in the POST body - Content-Length specifies the size. Multi-part
 /// form encoding has to pass the File as a Form parameter named "File1".
 /// 
 /// For streamed and threaded, if Resume options were provided to the Upload call, then the
 /// fields IsResume, ResumeIndex, ResumeOffset and ResumeFileHash MAY be populated. If they are,
 /// it indicates that the server has identified a partial upload with that specification, and is
 /// ready to resume on the provided parameters. The clients can then verify the ResumeFileHash to
 /// ensure the file has not been modified; and continue issuing ChunkUri calls from the ResumeIndex
 /// ResumeOffset parameters. If the client decides to restart, it should simply ignore the resume
 /// parameters and send the blocks from Index 0.
 /// 
 /// For all uploaders: the result code for the HTTP POST calls to Chunk and Finish Uri can either
 /// be a 401 - indicating authentication is required; 4xx/5xx indicating some kind of error; or
 /// 200 with a Content Body of format 'ERROR:message'. Successful calls will return either a 200
 /// response with no Body, or with Body of format 'OK'.
 /// </remarks>
 /// <param name="url"></param>
 /// <param name="method"></param>
 /// <param name="raw"></param>
 /// <param name="fileName"></param>
 /// <param name="fileSize"></param>
 /// <param name="batchId"></param>
 /// <param name="batchLast"></param>
 /// <param name="canResume"></param>
 /// <param name="startOver"></param>
 /// <param name="unzip"></param>
 /// <param name="tool"></param>
 /// <param name="overwrite"></param>
 /// <param name="title"></param>
 /// <param name="details"></param>
 /// <param name="isSend"></param>
 /// <param name="sendGuid"></param>
 /// <param name="opid"></param>
 /// <param name="threadCount"></param>
 /// <param name="responseFormat"></param>
 /// <param name="notify"></param>
 /// <returns>
 /// an Upload Specification element, containing the links for uploading, and the parameters for resume.
 /// The caller must know the protocol for sending the prepare, chunk and finish URLs returned in the spec; as well as
 /// negotiate the resume upload.
 /// </returns>
 public IQuery<UploadSpecification> Upload(Uri url, UploadMethod method = UploadMethod.Standard, bool raw = false, string fileName = null, long fileSize = 0, string batchId = null, bool batchLast = false, bool canResume = false, bool startOver = false, bool unzip = false, string tool = "apiv3", bool overwrite = false, string title = null, string details = null, bool isSend = false, string sendGuid = null, string opid = null, int threadCount = 4, string responseFormat = "json", bool notify = false, DateTime? clientCreatedDateUTC = null, DateTime? clientModifiedDateUTC = null, int? expirationDays = null)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<UploadSpecification>(Client);
     sfApiQuery.Action("Upload");
     sfApiQuery.Uri(url);
     sfApiQuery.QueryString("method", method);
     sfApiQuery.QueryString("raw", raw);
     sfApiQuery.QueryString("fileName", fileName);
     sfApiQuery.QueryString("fileSize", fileSize);
     sfApiQuery.QueryString("batchId", batchId);
     sfApiQuery.QueryString("batchLast", batchLast);
     sfApiQuery.QueryString("canResume", canResume);
     sfApiQuery.QueryString("startOver", startOver);
     sfApiQuery.QueryString("unzip", unzip);
     sfApiQuery.QueryString("tool", tool);
     sfApiQuery.QueryString("overwrite", overwrite);
     sfApiQuery.QueryString("title", title);
     sfApiQuery.QueryString("details", details);
     sfApiQuery.QueryString("isSend", isSend);
     sfApiQuery.QueryString("sendGuid", sendGuid);
     sfApiQuery.QueryString("opid", opid);
     sfApiQuery.QueryString("threadCount", threadCount);
     sfApiQuery.QueryString("responseFormat", responseFormat);
     sfApiQuery.QueryString("notify", notify);
     sfApiQuery.QueryString("clientCreatedDateUTC", clientCreatedDateUTC);
     sfApiQuery.QueryString("clientModifiedDateUTC", clientModifiedDateUTC);
     sfApiQuery.QueryString("expirationDays", expirationDays);
     sfApiQuery.HttpMethod = "POST";
     return sfApiQuery;
 }
예제 #38
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;
 }
예제 #39
0
        /// <summary>
        /// Patch Storage Center
        /// </summary>
        /// <example>
        /// {
        /// "ExternalAddress":"https://server/",
        /// "Version":"4.12.20",
        /// "HostName":"hostname" }
        /// </example>
        /// <param name="url"></param>
        /// <param name="sc"></param>
        /// <returns>
        /// Modified Storage Center
        /// </returns>
        public IQuery<StorageCenter> Update(Uri url, StorageCenter sc)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<StorageCenter>(Client);
            sfApiQuery.Uri(url);
            sfApiQuery.Body = sc;
            sfApiQuery.HttpMethod = "PATCH";	
		    return sfApiQuery;
        }
예제 #40
0
 /// <summary>
 /// Get Recipient of a Share
 /// </summary>
 /// <remarks>
 /// Retrieve a single Share Recipient identified by the alias id.
 /// </remarks>
 /// <param name="parentUrl"></param>
 /// <param name="id"></param>
 /// <returns>
 /// A Share Alias representing a single recipient of the Share
 /// </returns>
 public IQuery<ShareAlias> GetRecipients(Uri parentUrl, string id)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ShareAlias>(Client);
     sfApiQuery.Action("Recipients");
     sfApiQuery.Uri(parentUrl);
     sfApiQuery.ActionIds(id);
     sfApiQuery.HttpMethod = "GET";
     return sfApiQuery;
 }
예제 #41
0
 public IQuery<ShareAlias> CreateRecipients(Uri url, string Email = null, string FirstName = null, string LastName = null, string Company = null)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ShareAlias>(Client);
     sfApiQuery.Action("Recipients");
     sfApiQuery.Uri(url);
     sfApiQuery.QueryString("Email", Email);
     sfApiQuery.QueryString("FirstName", FirstName);
     sfApiQuery.QueryString("LastName", LastName);
     sfApiQuery.QueryString("Company", Company);
     sfApiQuery.HttpMethod = "POST";
     return sfApiQuery;
 }
예제 #42
0
        /// <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;
        }
예제 #43
0
        /// <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;
        }
예제 #44
0
 /// <summary>
 /// Get Items of a Send Share
 /// </summary>
 /// <remarks>
 /// Retrieve a single Item in the Send Share
 /// </remarks>
 /// <param name="shareUrl"></param>
 /// <param name="itemid"></param>
 /// <returns>
 /// An item in the Share
 /// </returns>
 public IQuery<Item> GetItems(Uri shareUrl, string itemid)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Item>(Client);
     sfApiQuery.Action("Items");
     sfApiQuery.Uri(shareUrl);
     sfApiQuery.ActionIds(itemid);
     sfApiQuery.HttpMethod = "GET";
     return sfApiQuery;
 }
예제 #45
0
        /// <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;
        }
예제 #46
0
        /// <summary>
        /// Update Zone
        /// </summary>
        /// <example>
        /// {
        /// "Name":"Name",
        /// "HeartbeatTolerance":10,
        /// "ZoneServices":"StorageZone, SharepointConnector, NetworkShareConnector"
        /// }
        /// </example>
        /// <remarks>
        /// Updates an existing zone
        /// </remarks>
        /// <param name="url"></param>
        /// <param name="zone"></param>
        /// <returns>
        /// The modified zone
        /// </returns>
        public IQuery<Zone> Update(Uri url, Zone zone)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Zone>(Client);
            sfApiQuery.Uri(url);
            sfApiQuery.Body = zone;
            sfApiQuery.HttpMethod = "PATCH";	
		    return sfApiQuery;
        }
예제 #47
0
        /// <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;
        }
예제 #48
0
        /// <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;
        }
예제 #49
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;
        }
예제 #50
0
        /// <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;
        }
예제 #51
0
        /// <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;
        }
예제 #52
0
        /// <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;
        }
예제 #53
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;
        }
예제 #54
0
        /// <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;
        }
예제 #55
0
 /// <summary>
 /// Create Share Alias
 /// </summary>
 /// <remarks>
 /// Creates a share alias for the specified share ID and user email. If a user with the given email address does not
 /// exist it is created first.
 /// For shares requiring login an activation email is sent to the created user. If 'notify' is enabled, the user activation is
 /// included in the share notification email.
 /// </remarks>
 /// <param name="url"></param>
 /// <param name="email"></param>
 /// <param name="notify"></param>
 /// <returns>
 /// Share with the AliasID property set to the created alias ID
 /// </returns>
 public IQuery<Share> CreateAlias(Uri url, string email, bool notify = false)
 {
     var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Share>(Client);
     sfApiQuery.Action("Alias");
     sfApiQuery.Uri(url);
     sfApiQuery.QueryString("email", email);
     sfApiQuery.QueryString("notify", notify);
     sfApiQuery.HttpMethod = "POST";
     return sfApiQuery;
 }
예제 #56
0
        /// <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;
        }
예제 #57
0
        /// <summary>
        /// Get Report by ID
        /// </summary>
        /// <remarks>
        /// Returns a single report specified by id. The Records property is expandable.
        /// </remarks>
        /// <param name="url"></param>
        /// <returns>
        /// Single Report
        /// </returns>
        public IQuery<Report> Get(Uri url)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Report>(Client);
            sfApiQuery.Uri(url);
            sfApiQuery.HttpMethod = "GET";	
		    return sfApiQuery;
        }
예제 #58
0
 /// <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;
 }
예제 #59
0
        /// <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;
        }
예제 #60
0
        /// <summary>
        /// Get List of Zones
        /// </summary>
        /// <remarks>
        /// Retrieve the list of Zones accessible to the authenticated user
        /// This method will concatenate the list of private zones in the user's account and the
        /// list of public zones accessible to this account. Any user can see the list of zones.
        /// </remarks>
        /// <param name="services"></param>
        /// <param name="includeDisabled"></param>
        /// <returns>
        /// The list of public and private zones accessible to this user
        /// </returns>
        public IQuery<Zone> Get(Uri url, bool secret = false)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Zone>(Client);
            sfApiQuery.Uri(url);
            sfApiQuery.QueryString("secret", secret);
            sfApiQuery.HttpMethod = "GET";	
		    return sfApiQuery;
        }