class B2::Client
- B2::Client
- Reference
- Object
Defined in:
b2.crConstructors
Instance Method Summary
- #authorisation : AuthoriseAccountResponse
- #authorisation? : AuthoriseAccountResponse | Nil
- #authorise_account
- #call(method, uri, type : SuccessType.class, headers = HTTP::Headers.new, body : String | Nil = nil, auth = true) forall SuccessType
- #call?(method, uri, type : SuccessType.class, headers = HTTP::Headers.new, body : String | Nil = nil, auth = true) forall SuccessType
- #create_bucket(name, type = BucketType::AllPrivate, bucket_info = nil, lifecycle_rules : Array(LifecycleRule) | Nil = nil)
- #delete_bucket(bucket_id : String)
- #delete_bucket(bucket : Bucket)
- #delete_file_version(file_name : String, file_id : String)
- #delete_file_version(file : File)
- #download_file_by_name(bucket : String, name : String, &) : FileDownloadMetadata
- #download_file_by_name(bucket : Bucket, name : String, &)
- #get_upload_url(bucket_id : String)
- #get_upload_url(bucket : Bucket)
- #upload_file(bucket, file_name, size = nil, sha1_hash = nil, content_type = "b2/x-auto", by_parts = nil, &) : File
- #upload_file(bucket, file_name, data : String | Bytes, sha1_hash = nil, content_type = "b2/x-auto")
Constructor Detail
def self.new(account_id : String = ENV["B2_ACCOUNT_ID"], application_key : String = ENV["B2_APPLICATION_KEY"])
#
Instance Method Detail
def call(method, uri, type : SuccessType.class, headers = HTTP::Headers.new, body : String | Nil = nil, auth = true) forall SuccessType
#
def call?(method, uri, type : SuccessType.class, headers = HTTP::Headers.new, body : String | Nil = nil, auth = true) forall SuccessType
#
def create_bucket(name, type = BucketType::AllPrivate, bucket_info = nil, lifecycle_rules : Array(LifecycleRule) | Nil = nil)
#
def upload_file(bucket, file_name, size = nil, sha1_hash = nil, content_type = "b2/x-auto", by_parts = nil, &) : File
#
def upload_file(bucket, file_name, data : String | Bytes, sha1_hash = nil, content_type = "b2/x-auto")
#