本文整理汇总了C#中ShareFile.Api.Client.Requests.ShareFile.Api.Client.Requests.Query.QueryString方法的典型用法代码示例。如果您正苦于以下问题:C# ShareFile.Api.Client.Requests.Query.QueryString方法的具体用法?C# ShareFile.Api.Client.Requests.Query.QueryString怎么用?C# ShareFile.Api.Client.Requests.Query.QueryString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShareFile.Api.Client.Requests.ShareFile.Api.Client.Requests.Query
的用法示例。
在下文中一共展示了ShareFile.Api.Client.Requests.Query.QueryString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BulkDownload
/// <summary>
/// Download Multiple Items from a Share for a Recipient
/// </summary>
/// <example>
/// ["id1","id2",...]
/// </example>
/// <remarks>
/// Download Multiple Items from a Share for a Recipient. The download will contain a ZIP archive containing all
/// files and folders in the share, named Files.zip.To download Shares that require user informaion ( Email, First Name, Last Name and Company), make sure
/// to create an Recipient (alias) and pass in the alaisId.To download Shares that require authentication, make sure this request is authenticated.
/// Anyone can download files from anonymous shares.
/// </remarks>
/// <param name="shareUrl"></param>
/// <param name="aliasid"></param>
/// <param name="ids"></param>
/// <param name="redirect"></param>
/// <returns>
/// Redirects the caller (302) to the download address for the share contents.
/// </returns>
public IQuery<Stream> BulkDownload(Uri shareUrl, string aliasid, IEnumerable<string> ids, bool redirect = true)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Stream>(Client);
sfApiQuery.Action("Recipients");
sfApiQuery.Uri(shareUrl);
sfApiQuery.ActionIds(aliasid);
sfApiQuery.SubAction("BulkDownload");
sfApiQuery.QueryString("redirect", redirect);
sfApiQuery.Body = ids;
sfApiQuery.HttpMethod = "POST";
return sfApiQuery;
}
示例2: CreateTenants
/// <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;
}
示例3: UpdateByItem
/// <summary>
/// Update AccessControl
/// </summary>
/// <example>
/// {
/// "Principal":{"Email":"[email protected]"},
/// "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;
}
示例4: FindSubdomain
/// <summary>
/// Find Subdomain
/// </summary>
/// <example>
/// {
/// "UsernameShort":"usernameShort",
/// "Password":"pass",
/// "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;
}
示例5: Get
/// <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;
}
示例6: GetAddressBook
/// <summary>
/// Get Account AddressBooks
/// </summary>
/// <remarks>
/// Retrieves an address book from the account.
/// Address Books are the contacts of Eployees and Clients, maintained on a personal or
/// account-wide basis (shared).
/// </remarks>
/// <param name="type"></param>
/// <param name="searchTerm"></param>
/// <returns>
/// A Feed of Contact objects representing the Address Book retrieved
/// </returns>
public IQuery<ODataFeed<Contact>> GetAddressBook(string type = "personal", string searchTerm = "")
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Contact>>(Client);
sfApiQuery.From("Accounts");
sfApiQuery.Action("AddressBook");
sfApiQuery.QueryString("type", type);
sfApiQuery.QueryString("searchTerm", searchTerm);
sfApiQuery.HttpMethod = "GET";
return sfApiQuery;
}
示例7: UpdateSSO
/// <summary>
/// Update Account Single Sign-On Configuration
/// </summary>
/// <example>
/// {
/// "LogoutUrl":"",
/// "LoginUrl":"https://idp.com/signin",
/// "IPRestrictions":"+all",
/// "ForceSSO":true,
/// "EntityID":"http://account.sf-api.com/saml/info",
/// "SFEntityID":"http://idp.com/saml/info",
/// "SPInitatedAuthContext":"exact",
/// "SPInitatedAuthMethod":"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
/// }
/// </example>
/// <remarks>
/// Modifies the Single Sign-on Configuration for this account.
/// </remarks>
/// <param name="sso"></param>
/// <param name="provider"></param>
public IQuery<SSOAccountProvider> UpdateSSO(SSOAccountProvider sso, string provider = "saml")
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<SSOAccountProvider>(Client);
sfApiQuery.From("Accounts");
sfApiQuery.Action("SSO");
sfApiQuery.QueryString("provider", provider);
sfApiQuery.Body = sso;
sfApiQuery.HttpMethod = "PATCH";
return sfApiQuery;
}
示例8: MakePrimary
/// <summary>
/// set email address as the primary email address for CURRENT user
/// </summary>
/// <param name="email"></param>
/// <returns>
/// User
/// </returns>
public IQuery<User> MakePrimary(string email)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<User>(Client);
sfApiQuery.From("Users");
sfApiQuery.Action("MakePrimary");
sfApiQuery.QueryString("email", email);
sfApiQuery.HttpMethod = "POST";
return sfApiQuery;
}
示例9: ResetPassword
/// <summary>
/// Reset Password
/// </summary>
/// <example>
/// {
/// "NewPassword":"new password",
/// "OldPassword":"old password"
/// }
/// {
/// "NewPassword":"new password",
/// "OldPassword":"old password"
/// }
/// </example>
/// <remarks>
/// Resets a user password. A user can reset his own password providing the old and new
/// passwords. Administrators can issue this call without providing the old password.
/// </remarks>
/// <param name="url"></param>
/// <param name="properties"></param>
/// <param name="notify"></param>
/// <returns>
/// The modified user record
/// </returns>
public IQuery<User> ResetPassword(Uri url, ODataObject properties, bool notify = false)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<User>(Client);
sfApiQuery.Action("ResetPassword");
sfApiQuery.Uri(url);
sfApiQuery.QueryString("notify", notify);
sfApiQuery.Body = properties;
sfApiQuery.HttpMethod = "POST";
return sfApiQuery;
}
示例10: DeleteEmailAddress
/// <summary>
/// delete the email address from user
/// </summary>
/// <param name="email"></param>
/// <returns>
/// User
/// </returns>
public IQuery<User> DeleteEmailAddress(string email)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<User>(Client);
sfApiQuery.From("Users");
sfApiQuery.Action("DeleteEmailAddress");
sfApiQuery.QueryString("email", email);
sfApiQuery.HttpMethod = "POST";
return sfApiQuery;
}
示例11: Get
/// <summary>
/// Get User
/// </summary>
/// <remarks>
/// Retrieve a single user, by ID or email, or the currently authenticated user.
/// </remarks>
/// <param name="id"></param>
/// <param name="emailAddress"></param>
/// <returns>
/// the requested User object
/// </returns>
public IQuery<User> Get(string id = null, string emailAddress = null)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<User>(Client);
sfApiQuery.From("Users");
sfApiQuery.QueryString("id", id);
sfApiQuery.QueryString("emailAddress", emailAddress);
sfApiQuery.HttpMethod = "GET";
return sfApiQuery;
}
示例12: CreateAccountUser
/// <summary>
/// Create Employee
/// </summary>
/// <example>
/// {
/// "Email":"[email protected]",
/// "FirstName":"Name",
/// "LastName":"Last Name",
/// "Company":"Company",
/// "Password":"password",
/// "StorageQuotaLimitGB":50,
/// "Preferences":
/// {
/// "CanResetPassword":true,
/// "CanViewMySettings":true
/// },
/// "DefaultZone":
/// {
/// "Id":"zoneid"
/// },
/// "IsAdministrator": false,
/// "CanCreateFolders": false,
/// "CanUseFileBox": true,
/// "CanManageUsers": false,
/// "Roles": [
/// "CanChangePassword", "CanManageMySettings",
/// "CanUseFileBox, "CanManageUsers, "CanCreateFolders, "CanUseDropBox, "CanSelectFolderZone,
/// "AdminAccountPolicies", "AdminBilling", "AdminBranding", "AdminChangePlan", "AdminFileBoxAccess",
/// "AdminManageEmployees", "AdminRemoteUploadForms", "AdminReporting", "AdminSharedDistGroups",
/// "AdminSharedAddressBook", "AdminViewReceipts", "AdminDelegate", "AdminManageFolderTemplates",
/// "AdminEmailMessages", "AdminSSO", "AdminSuperGroup", "AdminZones", "AdminCreateSharedGroups", "AdminConnectors"
/// ]
/// }
/// </example>
/// <remarks>
/// Creates a new Employee User (AccountUser) and associates it to an Account
/// The following parameters from the input object are used: Email, FirstName, LastName, Company,
/// DefaultZone, Password, IsEmployee, IsAdministrator, CanCreateFolders, CanUseFileBox, CanManageUsers,
/// Preferences.CanResetPassword and Preferences.CanViewMySettings.
/// Other parameters are ignoredStorageQuotaLimitGB parameter is optional. If not specified or equal to -1 the account default storage quota value will be set for the User.
/// </remarks>
/// <param name="user"></param>
/// <param name="pushCreatorDefaultSettings"></param>
/// <param name="addshared"></param>
/// <param name="notify"></param>
/// <param name="ifNecessary"></param>
/// <returns>
/// The new employee user
/// </returns>
public IQuery<User> CreateAccountUser(AccountUser user, bool pushCreatorDefaultSettings = false, bool addshared = false, bool notify = false, bool ifNecessary = false)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<User>(Client);
sfApiQuery.From("Users");
sfApiQuery.Action("AccountUser");
sfApiQuery.QueryString("pushCreatorDefaultSettings", pushCreatorDefaultSettings);
sfApiQuery.QueryString("addshared", addshared);
sfApiQuery.QueryString("notify", notify);
sfApiQuery.QueryString("ifNecessary", ifNecessary);
sfApiQuery.Body = user;
sfApiQuery.HttpMethod = "POST";
return sfApiQuery;
}
示例13: ByProvider
/// <summary>
/// Get the Connector Group by Provider
/// </summary>
/// <param name="provider"></param>
/// <returns>
/// A single ConnectorGroup matching the query
/// </returns>
public IQuery<ConnectorGroup> ByProvider(string provider)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ConnectorGroup>(Client);
sfApiQuery.From("ConnectorGroups");
sfApiQuery.Action("ByProvider");
sfApiQuery.QueryString("provider", provider);
sfApiQuery.HttpMethod = "GET";
return sfApiQuery;
}
示例14: Login
/// <summary>
/// Login
/// </summary>
/// <remarks>
/// API clients can provide ShareFile Authentication directly to any API operation using OAuth (Bearer).
/// However, the client must know that the provided authentication type is supported on the API endpoint; and that SAML is not configured.
///
/// This API provides a generic authentication routine for clients. It will challenge for ShareFile credentials
/// passing all supported authentication methods; redirect to the SAML IDP if configured to do so; and handle
/// certain HTTP headers, like device registration.
///
/// If the client is already authenticated, the Session object is returned. If the client is not authenticated, and
/// the account is not configured for SAML, then the API will challenge for a local authentication. If the account
/// is configured for SAML, then the client will be redirected to the SAML IDP using the SAML passive flow - authentication
/// will be performed at the IDP domain instead. The IDP callback will be on the API Acs, which will return a Session
/// object if authentication is accepted.
///
/// The following HTTP Headers are also processed in this request, and stored with the Session object:
/// X-SFAPI-Tool: Tool string (user-agent equivalent for ShareFile)X-SFAPI-ToolVersion: Tool Version stringX-SFAPI-UserInitiated: true or false, indicates whether this is an interactive login, or re-authentication
/// initiated by the ToolX-SFAPI-DeviceId: Device Identifier. If set to 'register', a new DeviceID will be generated. This will
/// either create or associate an existing DeviceID to this session - indicates user is logging in using this DeviceX-SFAPI-DeviceName: Device Name. Only required/used when a registration process occurs.
/// </remarks>
/// <param name="authmethod"></param>
/// <param name="authcomparison"></param>
/// <returns>
/// A Session object, if authentication is successful
/// </returns>
public IQuery<Session> Login(string authmethod = null, string authcomparison = null)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Session>(Client);
sfApiQuery.From("Sessions");
sfApiQuery.Action("Login");
sfApiQuery.QueryString("authmethod", authmethod);
sfApiQuery.QueryString("authcomparison", authcomparison);
sfApiQuery.HttpMethod = "GET";
return sfApiQuery;
}
示例15: Upload
/// <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);
//.........这里部分代码省略.........