class B2::Client

Defined in:

b2.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(account_id : String = ENV["B2_ACCOUNT_ID"], application_key : String = ENV["B2_APPLICATION_KEY"]) #

[View source]

Instance Method Detail

def authorisation : AuthoriseAccountResponse #

[View source]
def authorisation? : AuthoriseAccountResponse | Nil #

[View source]
def authorise_account #

[View source]
def call(method, uri, type : SuccessType.class, headers = HTTP::Headers.new, body : String | Nil = nil, auth = true) forall SuccessType #

[View source]
def call?(method, uri, type : SuccessType.class, headers = HTTP::Headers.new, body : String | Nil = nil, auth = true) forall SuccessType #

[View source]
def create_bucket(name, type = BucketType::AllPrivate, bucket_info = nil, lifecycle_rules : Array(LifecycleRule) | Nil = nil) #

[View source]
def delete_bucket(bucket_id : String) #

[View source]
def delete_bucket(bucket : Bucket) #

[View source]
def delete_file_version(file_name : String, file_id : String) #

[View source]
def delete_file_version(file : File) #

[View source]
def download_file_by_name(bucket : String, name : String, &) : FileDownloadMetadata #

[View source]
def download_file_by_name(bucket : Bucket, name : String, &) #

[View source]
def get_upload_url(bucket_id : String) #

[View source]
def get_upload_url(bucket : Bucket) #

[View source]
def upload_file(bucket, file_name, size = nil, sha1_hash = nil, content_type = "b2/x-auto", by_parts = nil, &) : File #

[View source]
def upload_file(bucket, file_name, data : String | Bytes, sha1_hash = nil, content_type = "b2/x-auto") #

[View source]