Skip to main content

Secure Share | C# SDK

Secure Share

ShareClient

Secure 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.

Response Object

Task<Response<BucketsResult>>
var response = await client.Buckets();

Delete

ShareClient.Delete(DeleteRequest)

Delete object by ID.

required parameters

DeleteRequest

Response Object

Task<Response<DeleteResult>>
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.

required parameters

FolderCreateRequest

Response Object

Task<Response<FolderCreateResult>>
var response = await client.FolderCreate(
    new FolderCreateRequest
    {
        Folder = "/path/to/new/folder"
    }
);

Get an object

ShareClient.Get(GetRequest)

Get object.

required parameters

GetRequest

Response Object

Task<Response<GetResult>>
var response = await client.Get(
    new GetRequest
    {
        ID = "pos_[...]",
        RequestTransferMethod = TransferMethod.DestURL,
    }
);

Get archive

ShareClient.GetArchive(GetArchiveRequest)

Get an archive file of multiple objects.

required parameters

GetArchiveRequest

Response Object

Task<Response<GetArchiveResult>>
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.

required parameters

UpdateRequest

Response Object

Task<Response<UpdateResult>>
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.

required parameters

ListRequest

Response Object

Task<Response<ListResult>>
var response = await client.List(new ListRequest { /* ... */ });

Upload a file

ShareClient.Put(PutRequest, FileStream)

Upload a file.

required parameters

PutRequest
FileStream

Response Object

Task<Response<PutResult>>
var response = await client.Put(
    new PutRequest
    {
        Name = "foobar",
        RequestTransferMethod = TransferMethod.Multipart
    },
    fileStream
);

Request upload URL

ShareClient.RequestUploadURL(PutRequest)

Request an upload URL.

required parameters

PutRequest

Response Object

Task<Response<AcceptedResult>>
var response = await client.RequestUploadURL(
    new PutRequest
    {
        Name = "foobar",
        RequestTransferMethod = TransferMethod.PutURL,
    }
);
ShareClient.ShareLinkCreate(ShareLinkCreateRequest)

Create a share link.

required parameters

ShareLinkCreateRequest

Response Object

Task<Response<ShareLinkCreateResult>>
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
    }
);
ShareClient.ShareLinkGet(ShareLinkGetRequest)

Get a share link.

required parameters

ShareLinkGetRequest

Response Object

Task<Response<ShareLinkGetResult>>
var response = await client.ShareLinkGet(
    new ShareLinkGetRequest
    {
        ID = "psl_[...]"
    }
);
ShareClient.ShareLinkList(ShareLinkListRequest)

Look up share links by filter options.

var response = await client.ShareLinkList(new ShareLinkListRequest());
ShareClient.ShareLinkDelete(ShareLinkDeleteRequest)

Delete share links.

required parameters

ShareLinkDeleteRequest

Response Object

Task<Response<ShareLinkDeleteResult>>
var response = await client.ShareLinkDelete(
    new ShareLinkDeleteRequest
    {
        IDs = new List<string> { "psl_[...]" },
    }
);
ShareClient.ShareLinkSend(ShareLinkSendRequest)

Send share links.

required parameters

ShareLinkSendRequest

Response Object

Task<Response<ShareLinkSendResult>>
var response = await ShareLinkSend(
    new ShareLinkSendRequest(
        new List<ShareLinkSendItem> { new("psl_[...]", "alice@example.org") },
        "bob@example.org"
    )
);