本文整理汇总了C#中ShareFile.Api.Client.Requests.ShareFile.Api.Client.Requests.Query.SubAction方法的典型用法代码示例。如果您正苦于以下问题:C# ShareFile.Api.Client.Requests.Query.SubAction方法的具体用法?C# ShareFile.Api.Client.Requests.Query.SubAction怎么用?C# ShareFile.Api.Client.Requests.Query.SubAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShareFile.Api.Client.Requests.ShareFile.Api.Client.Requests.Query
的用法示例。
在下文中一共展示了ShareFile.Api.Client.Requests.Query.SubAction方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BulkSet
/// <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":"[email protected]" },
/// "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;
}
示例2: GetMetadata
/// <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;
}
示例3: CreateMetadata
/// <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;
}
示例4: Thumbnail
/// <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;
}
示例5: GetZones
/// <summary>
/// Get list of multi-tenant zones assigned to a tenant.
/// </summary>
/// <param name="parentid"></param>
/// <returns>
/// List of multi-tenant zones assigned to the tenant
/// </returns>
public IQuery<ODataFeed<Zone>> GetZones(string parentid)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<Zone>>(Client);
sfApiQuery.From("Accounts");
sfApiQuery.Action("Tenants");
sfApiQuery.ActionIds(parentid);
sfApiQuery.SubAction("Zones");
sfApiQuery.HttpMethod = "GET";
return sfApiQuery;
}
示例6: ProtocolLinks
/// <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;
}
示例7: DownloadWithAlias
/// <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;
}
示例8: CreateStorageCenters
/// <summary>
/// Adds a Connector Group to a Storage Center
/// </summary>
/// <example>
/// {
/// "Id":"storageCenterId"
/// }
/// </example>
/// <remarks>
/// Associate a Connector Group with a Storage Center. The Connector Group has to be
/// associated with the Storage Center Zone.
/// </remarks>
/// <param name="url"></param>
/// <param name="zoneid"></param>
/// <returns>
/// The modified Connector Group
/// </returns>
public IQuery<ODataFeed<StorageCenter>> CreateStorageCenters(Uri url, string zoneid, StorageCenter storageCenter)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<ODataFeed<StorageCenter>>(Client);
sfApiQuery.Action("Zones");
sfApiQuery.Uri(url);
sfApiQuery.ActionIds(zoneid);
sfApiQuery.SubAction("StorageCenters");
sfApiQuery.Body = storageCenter;
sfApiQuery.HttpMethod = "POST";
return sfApiQuery;
}
示例9: 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;
}
示例10: Message
/// <summary>
/// Get Sent Message Content by Share
/// </summary>
/// <remarks>
/// Returns sent message content.
/// </remarks>
/// <param name="shareUrl"></param>
/// <param name="aliasId"></param>
/// <returns>
/// Sent Message Content
/// </returns>
public IQuery<Stream> Message(Uri shareUrl, string aliasId)
{
var sfApiQuery = new ShareFile.Api.Client.Requests.Query<Stream>(Client);
sfApiQuery.Action("Recipients");
sfApiQuery.Uri(shareUrl);
sfApiQuery.ActionIds(aliasId);
sfApiQuery.SubAction("Message");
sfApiQuery.HttpMethod = "GET";
return sfApiQuery;
}