Data classes

class b2sdk.v1.FileVersionInfo(id_, file_name, size, content_type, content_sha1, file_info, upload_timestamp, action, content_md5=None, server_side_encryption: Optional[b2sdk.encryption.setting.EncryptionSetting] = None, file_retention: Optional[b2sdk.file_lock.FileRetentionSetting] = None, legal_hold: Optional[b2sdk.file_lock.LegalHold] = None, api: Optional[b2sdk.v1.api.B2Api] = None)[source]
LS_ENTRY_TEMPLATE = '%83s  %6s  %10s  %8s  %9d  %s'
id_
file_name
size
content_type
content_sha1
content_md5
file_info
upload_timestamp
action
server_side_encryption
legal_hold
file_retention
mod_time_millis
property api
format_ls_entry()[source]
classmethod format_folder_ls_entry(name)[source]
as_dict()

represents the object as a dict which looks almost exactly like the raw api output for upload/list

class b2sdk.v1.FileIdAndName(file_id: str, file_name: str)[source]

A structure which represents a B2 cloud file with just file_name and fileId attributes.

Used to return data from calls to b2_delete_file_version and b2_cancel_large_file.

classmethod from_cancel_or_delete_response(response)[source]
as_dict()[source]

represents the object as a dict which looks almost exactly like the raw api output for delete_file_version

__dict__ = mappingproxy({'__module__': 'b2sdk.file_version', '__doc__': '\n    A structure which represents a B2 cloud file with just `file_name` and `fileId` attributes.\n\n    Used to return data from calls to b2_delete_file_version and b2_cancel_large_file.\n    ', '__init__': <function FileIdAndName.__init__>, 'from_cancel_or_delete_response': <classmethod object>, 'as_dict': <function FileIdAndName.as_dict>, '__eq__': <function FileIdAndName.__eq__>, '__repr__': <function FileIdAndName.__repr__>, '__dict__': <attribute '__dict__' of 'FileIdAndName' objects>, '__weakref__': <attribute '__weakref__' of 'FileIdAndName' objects>, '__hash__': None, '__annotations__': {}})
class b2sdk.v1.UnfinishedLargeFile[source]

A structure which represents a version of a file (in B2 cloud).

Variables
  • file_id (str) – fileId

  • file_name (str) – full file name (with path)

  • account_id (str) – account ID

  • bucket_id (str) – bucket ID

  • content_type (str) – RFC 822 content type, for example "application/octet-stream"

  • file_info (dict) – file info dict

class b2sdk.v1.Part(file_id, part_number, content_length, content_sha1)[source]

A structure which represents a part of a large file upload.

Variables
  • file_id (str) – fileId

  • part_number (int) – part number, starting with 1

  • content_length (str) – content length, in bytes

  • content_sha1 (str) – checksum