Table of Contents

Class StorageBucketApi

Namespace
Supabase.Storage
Assembly
Supabase.Storage.dll
public class StorageBucketApi : IStorageBucketApi<Bucket>, IGettableHeaders
Inheritance
StorageBucketApi
Implements
IGettableHeaders
Derived
Inherited Members

Constructors

StorageBucketApi(string, ClientOptions?, Dictionary<string, string>?)

protected StorageBucketApi(string url, ClientOptions? options, Dictionary<string, string>? headers = null)

Parameters

url string
options ClientOptions
headers Dictionary<string, string>

StorageBucketApi(string, Dictionary<string, string>?)

protected StorageBucketApi(string url, Dictionary<string, string>? headers = null)

Parameters

url string
headers Dictionary<string, string>

Properties

GetHeaders

Function that can be set to return dynamic headers.

Headers specified in the constructor will ALWAYS take precendece over headers returned by this function.

public Func<Dictionary<string, string>>? GetHeaders { get; set; }

Property Value

Func<Dictionary<string, string>>

Headers

public Dictionary<string, string> Headers { get; set; }

Property Value

Dictionary<string, string>

Options

public ClientOptions Options { get; protected set; }

Property Value

ClientOptions

Url

protected string Url { get; set; }

Property Value

string

Methods

CreateBucket(string, BucketUpsertOptions?)

Creates a new Storage bucket

public Task<string> CreateBucket(string id, BucketUpsertOptions? options = null)

Parameters

id string
options BucketUpsertOptions

Returns

Task<string>

Bucket Id

DeleteBucket(string)

Deletes an existing bucket. A bucket can't be deleted with existing objects inside it. You must first EmptyBucket(string)

public Task<GenericResponse?> DeleteBucket(string id)

Parameters

id string

Returns

Task<GenericResponse>

EmptyBucket(string)

Removes all objects inside a single bucket.

public Task<GenericResponse?> EmptyBucket(string id)

Parameters

id string

Returns

Task<GenericResponse>

GetBucket(string)

Retrieves the details of an existing Storage bucket.

public Task<Bucket?> GetBucket(string id)

Parameters

id string

Returns

Task<Bucket>

ListBuckets()

Retrieves the details of all Storage buckets within an existing product.

public Task<List<Bucket>?> ListBuckets()

Returns

Task<List<Bucket>>

UpdateBucket(string, BucketUpsertOptions?)

Updates a Storage bucket

public Task<Bucket?> UpdateBucket(string id, BucketUpsertOptions? options = null)

Parameters

id string
options BucketUpsertOptions

Returns

Task<Bucket>