Secure Share | C# SDK
Secure Share
ShareClientSecure Share client.
var config = new Config("pangea_token", "pangea_domain");
var builder = new ShareClient.Builder(config);
var client = builder.Build();
Buckets
ShareClient.Buckets()Get information on the accessible buckets.
var response = await client.Buckets();
Delete
ShareClient.Delete(DeleteRequest)Delete object by ID.
var response = await client.Delete(new DeleteRequest
{
ID = "abc"
});
Create a folder
ShareClient.FolderCreate(FolderCreateRequest)Create a folder, either by name or path and parent_id.
var response = await client.FolderCreate(
new FolderCreateRequest
{
Folder = "/path/to/new/folder"
}
);
Get an object
ShareClient.Get(GetRequest)Get object.
var response = await client.Get(
new GetRequest
{
ID = "pos_[...]",
RequestTransferMethod = TransferMethod.DestURL,
}
);
Get archive
ShareClient.GetArchive(GetArchiveRequest)Get an archive file of multiple objects.
var response = await client.GetArchive(
new GetArchiveRequest
{
IDs = new List<string> { "pos_[...]" },
Format = ArchiveFormat.Tar,
RequestTransferMethod = TransferMethod.DestURL,
}
);
Update a file
ShareClient.Update(UpdateRequest)Update a file.
var metadata = new Metadata() {
{ "key", "value" }
};
var response = await client.Update(
new UpdateRequest
{
ID = "pos_[...]",
Metadata = metadata
}
);
List
ShareClient.List(ListRequest)List or filter/search records.
var response = await client.List(new ListRequest { /* ... */ });
Upload a file
ShareClient.Put(PutRequest, FileStream)Upload a file.
var response = await client.Put(
new PutRequest
{
Name = "foobar",
RequestTransferMethod = TransferMethod.Multipart
},
fileStream
);
Request upload URL
ShareClient.RequestUploadURL(PutRequest)Request an upload URL.
var response = await client.RequestUploadURL(
new PutRequest
{
Name = "foobar",
RequestTransferMethod = TransferMethod.PutURL,
}
);
Create share links
ShareClient.ShareLinkCreate(ShareLinkCreateRequest)Create a share link.
var authenticators = new List<Authenticator>
{
new Authenticator(AuthenticatorType.Password, "somepassword")
};
var linkList = new List<ShareLinkCreateItem>
{
new ShareLinkCreateItem {
Targets = new List<string> { folderID },
LinkType = LinkType.Editor,
MaxAccessCount = 3,
Authenticators = authenticators,
}
};
var response = await client.ShareLinkCreate(
new ShareLinkCreateRequest
{
Links = linkList
}
);
Get share link
ShareClient.ShareLinkGet(ShareLinkGetRequest)Get a share link.
var response = await client.ShareLinkGet(
new ShareLinkGetRequest
{
ID = "psl_[...]"
}
);
List share links
ShareClient.ShareLinkList(ShareLinkListRequest)Look up share links by filter options.
var response = await client.ShareLinkList(new ShareLinkListRequest());
Delete share links
ShareClient.ShareLinkDelete(ShareLinkDeleteRequest)Delete share links.
var response = await client.ShareLinkDelete(
new ShareLinkDeleteRequest
{
IDs = new List<string> { "psl_[...]" },
}
);
Send share links
ShareClient.ShareLinkSend(ShareLinkSendRequest)Send share links.
var response = await ShareLinkSend(
new ShareLinkSendRequest(
new List<ShareLinkSendItem> { new("psl_[...]", "alice@example.org") },
"bob@example.org"
)
);