/// <summary>
        /// Get List of Capabilities
        /// </summary>
        /// <remarks>
        /// Retrieves the capability list of a given provider.
        /// The URL for ShareFile API is of the form Domain/Provider/Version/EntityThe Domain is the server presenting the provider - typically sharefile.com,
        /// but can be any other when using Storage Zones. The Provider represent the kind of data storage connected by the API. Examples
        /// are 'sf' for ShareFile; 'cifs' for CIFS; and 'sp' for SharePoint. Other providers
        /// may be created, clients must not assume any particular string.Version specifies the API version - currently at V3. Any backward incompatible
        /// changes will be performed on a different version identifier, to avoid breaking
        /// existing clients.The Capability document is used to indicate to clients that certain features
        /// are not available on a given provider - allowing the client to suppress UX controls
        /// and avoid "Not Implemented" exceptions to the end-user.
        /// </remarks>
        public IQuery<ODataFeed<Capability>> Get()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Capability>>(Client);
		    sfApiQuery.From("Capabilities");
            sfApiQuery.HttpMethod = "GET";	
		    return sfApiQuery;
        }
Example #2
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);
        }
Example #3
0
        /// <summary>
        /// Get Device Users for Current User
        /// </summary>
        /// <returns>
        /// A feed of DeviceUser objects
        /// </returns>
        public IQuery <ODataFeed <DeviceUser> > Get()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <DeviceUser> >(Client);

            sfApiQuery.From("Devices");
            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);
        }
Example #5
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);
        }
        /// <summary>
        /// Get List of Capabilities
        /// </summary>
        /// <remarks>
        /// Retrieves the capability list of a given provider.
        /// The URL for ShareFile API is of the form Domain/Provider/Version/EntityThe Domain is the server presenting the provider - typically sharefile.com,
        /// but can be any other when using Storage Zones. The Provider represent the kind of data storage connected by the API. Examples
        /// are 'sf' for ShareFile; 'cifs' for CIFS; and 'sp' for SharePoint. Other providers
        /// may be created, clients must not assume any particular string.Version specifies the API version - currently at V3. Any backward incompatible
        /// changes will be performed on a different version identifier, to avoid breaking
        /// existing clients.The Capability document is used to indicate to clients that certain features
        /// are not available on a given provider - allowing the client to suppress UX controls
        /// and avoid "Not Implemented" exceptions to the end-user.
        /// </remarks>
        public IQuery <ODataFeed <Capability> > Get()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <Capability> >(Client);

            sfApiQuery.From("Capabilities");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Example #7
0
        /// <summary>
        /// Get Folder Templates for Current Account
        /// </summary>
        /// <remarks>
        /// Returns all folder templates for the current account.
        /// </remarks>
        /// <returns>
        /// Folder templates for current account
        /// </returns>
        public IQuery <ODataFeed <FolderTemplate> > Get()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <FolderTemplate> >(Client);

            sfApiQuery.From("FolderTemplates");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Example #8
0
        public IQuery <ODataFeed <RemoteUpload> > Get()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <RemoteUpload> >(Client);

            sfApiQuery.From("RemoteUploads");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Example #9
0
        /// <summary>
        /// Gets all webhook subscriptions for the current user
        /// </summary>
        /// <returns>
        /// List of WebhookSubscription
        /// </returns>
        public IQuery <ODataFeed <WebhookSubscription> > Get()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <WebhookSubscription> >(Client);

            sfApiQuery.From("WebhookSubscriptions");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Example #10
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 Session
        /// </summary>
        /// <remarks>
        /// Retrieve the current authentication session object. If the client is not authenticated,
        /// this operation will challenge for ShareFile authentication using a 401 response. This method will
        /// not trigger the SAML authentication flow - use /Sessions/Login instead.
        /// </remarks>
        /// <returns>
        /// The current authentication Context, based on the request SF_APIAuthId Cookie
        /// </returns>
        public IQuery <Session> Get()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Session>(Client);

            sfApiQuery.From("Sessions");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Example #12
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);
        }
Example #13
0
        /// <summary>
        /// Get Apps for Current User
        /// </summary>
        /// <returns>
        /// A feed of ConnectedApp objects
        /// </returns>
        public IQuery <ODataFeed <ConnectedApp> > Get()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <ConnectedApp> >(Client);

            sfApiQuery.From("Apps");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Example #14
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);
        }
        /// <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);
        }
Example #16
0
        /// <summary>
        /// Get current Account
        /// </summary>
        /// <remarks>
        /// Retrieves information about the Account defined in the call subdomain
        /// </remarks>
        /// <returns>
        /// The subdomain account information
        /// </returns>
        public IQuery <Account> Get()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <Account>(Client);

            sfApiQuery.From("Accounts");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Example #17
0
        public IQuery <RemoteUpload> Update(RemoteUpload remoteUpload)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <RemoteUpload>(Client);

            sfApiQuery.From("RemoteUploads");
            sfApiQuery.Body       = remoteUpload;
            sfApiQuery.HttpMethod = "PATCH";
            return(sfApiQuery);
        }
Example #18
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);
        }
Example #19
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);
        }
Example #20
0
        /// <summary>
        /// Get all Two Factor Authentication Apps for the Current User
        /// </summary>
        /// <returns>
        /// A feed of TwoFactorAuthApp objects
        /// </returns>
        public IQuery <ODataFeed <TwoFactorAuthApp> > TFA()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <TwoFactorAuthApp> >(Client);

            sfApiQuery.From("Apps");
            sfApiQuery.Action("TFA");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Example #21
0
        /// <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);
        }
Example #22
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);
        }
Example #23
0
        /// <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);
        }
Example #24
0
        /// <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);
        }
Example #25
0
        /// <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);
        }
Example #26
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);
        }
Example #27
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);
        }
Example #28
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);
        }
Example #29
0
        public IQuery <ODataFeed <Contact> > GetUsers()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ODataFeed <Contact> >(Client);

            sfApiQuery.From("RemoteUploads");
            sfApiQuery.Action("Users");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
Example #30
0
        public IQuery <RemoteUpload> GetPublic()
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <RemoteUpload>(Client);

            sfApiQuery.From("RemoteUploads");
            sfApiQuery.Action("Public");
            sfApiQuery.HttpMethod = "GET";
            return(sfApiQuery);
        }
        /// <summary>
        /// Create a Connector Group associated with a Zone
        /// </summary>
        /// <example>
        /// {
        /// "Zones":[
        /// "Zone": {"Id":"ZoneId"},
        /// "StorageCenter": [ { "Id":"StorageCenterId" }, { ... } ],
        /// "ApiVersionMin":"v3",
        /// "ApiVersionMax":"v3",
        /// "IconUrl":"https://domain/icons",
        /// "FormUrl":"https://domain/forms"
        /// ],
        /// "Id":"ServiceId",
        /// "Name":""Name,
        /// "Provider":"svc"
        /// }
        /// </example>
        /// <remarks>
        /// Creates a new Connector Group, or adds a Zone to an existing Connector Group if the Group is already associated
        /// with another Zone. The caller doesn't have to check if the group exists or not - just call this API passing
        /// the Service ID and the associated Zone information.
        /// </remarks>
        /// <param name="id"></param>
        /// <param name="connectorGroup"></param>
        /// <returns>
        /// the created or modified AccessControl instance
        /// </returns>
        public IQuery <ConnectorGroup> Create(ConnectorGroup connectorGroup)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query <ConnectorGroup>(Client);

            sfApiQuery.From("ConnectorGroups");
            sfApiQuery.Body       = connectorGroup;
            sfApiQuery.HttpMethod = "POST";
            return(sfApiQuery);
        }
Example #32
0
        /// <summary>
        /// Create Zone
        /// </summary>
        /// <example>
        /// {
        /// "Name":"Name",
        /// "HeartbeatTolerance":10,
        /// "ZoneServices":"StorageZone, SharepointConnector, NetworkShareConnector"
        /// }
        /// </example>
        /// <remarks>
        /// Creates a new Zone.
        /// </remarks>
        /// <returns>
        /// the created zone
        /// </returns>
        public IQuery<Zone> Create(Zone zone)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Zone>(Client);
		    sfApiQuery.From("Zones");
            sfApiQuery.Body = zone;
            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 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 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;
        }
Example #36
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;
        }
        /// <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;
        }
Example #38
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;
        }
Example #39
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<ODataFeed<Zone>> Get(ZoneService services = ZoneService.StorageZone, bool includeDisabled = false)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Zone>>(Client);
		    sfApiQuery.From("Zones");
            sfApiQuery.QueryString("services", services);
            sfApiQuery.QueryString("includeDisabled", includeDisabled);
            sfApiQuery.HttpMethod = "GET";	
		    return sfApiQuery;
        }
Example #40
0
        /// <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;
        }
Example #41
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;
        }
Example #42
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;
        }
Example #43
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;
        }
        /// <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>
        /// 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;
        }
Example #46
0
        /// <summary>
        /// Create Report
        /// </summary>
        /// <example>
        /// {
        /// "Id": "rs24f83e-b147-437e-9f28-e7d03634af42"
        /// "Title": "Usage Report",
        /// "ReportType": "Activity",
        /// "ObjectType": "Account",
        /// "ObjectId": "a024f83e-b147-437e-9f28-e7d0ef634af42",
        /// "DateOption": "Last30Days",
        /// "SaveFormat": "Excel"
        /// }
        /// </example>
        /// <remarks>
        /// Creates a new Report.
        /// </remarks>
        /// <param name="report"></param>
        /// <param name="runOnCreate"></param>
        /// <returns>
        /// the created report
        /// </returns>
        public IQuery<Report> Create(Report report, bool runOnCreate)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Report>(Client);
		    sfApiQuery.From("Reports");
            sfApiQuery.QueryString("runOnCreate", runOnCreate);
            sfApiQuery.Body = report;
            sfApiQuery.HttpMethod = "POST";	
		    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;
        }
Example #48
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;
        }
        /// <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;
        }
Example #50
0
        /// <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;
        }
Example #51
0
        /// <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;
        }
Example #52
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;
        }
Example #53
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;
        }
        /// <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;
        }
Example #55
0
        /// <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 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;
        }
Example #57
0
        /// <summary>
        /// Update Report
        /// </summary>
        /// <example>
        /// {
        /// "Title": "Usage Report",
        /// "ReportType": "Activity",
        /// "ObjectType": "Account",
        /// "ObjectId": "a024f83e-b147-437e-9f28-e7d03634af42",
        /// "DateOption": "Last30Days",
        /// "Frequency": "Once"
        /// }
        /// </example>
        /// <remarks>
        /// Updates an existing report
        /// </remarks>
        /// <param name="report"></param>
        /// <returns>
        /// the updated report
        /// </returns>
        public IQuery<Report> Update(Report report)
        {
            var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Report>(Client);
		    sfApiQuery.From("Reports");
            sfApiQuery.Body = report;
            sfApiQuery.HttpMethod = "PATCH";	
		    return sfApiQuery;
        }
Example #58
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;
        }
Example #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;
        }
Example #60
0
        /// <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;
        }