# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: steammessages_cloud.steamclient.proto
# plugin: python-betterproto
# Last updated 21/12/2022

from dataclasses import dataclass

import betterproto

from .msg import UnifiedMessage


class EProtoExecutionSite(betterproto.Enum):
    Unknown = 0
    SteamClient = 2


class EPublishedFileStorageSystem(betterproto.Enum):
    Invalid = 0
    LegacyCloud = 1
    Depot = 2
    UGCCloud = 3


class ECloudStoragePersistState(betterproto.Enum):
    Persisted = 0
    Forgotten = 1
    Deleted = 2


class ECloudPendingRemoteOperation(betterproto.Enum):
    NONE = 0
    AppSessionActive = 1
    UploadInProgress = 2
    UploadPending = 3
    AppSessionSuspended = 4


class ClientLogUploadCheckNotification(UnifiedMessage, um_name="Cloud.ClientLogUploadCheck"):
    client_id: int = betterproto.uint64_field(1)


class ClientLogUploadCompleteNotification(UnifiedMessage, um_name="Cloud.ClientLogUploadComplete"):
    client_id: int = betterproto.uint64_field(1)
    request_id: int = betterproto.uint64_field(2)


class GetUploadServerInfoRequest(UnifiedMessage, um_name="Cloud.GetUploadServerInfo"):
    appid: int = betterproto.uint32_field(1)


class GetUploadServerInfoResponse(UnifiedMessage, um_name="Cloud.GetUploadServerInfo"):
    server_url: str = betterproto.string_field(1)


class BeginHttpUploadRequest(UnifiedMessage, um_name="Cloud.BeginHTTPUpload"):
    appid: int = betterproto.uint32_field(1)
    file_size: int = betterproto.uint32_field(2)
    filename: str = betterproto.string_field(3)
    file_sha: str = betterproto.string_field(4)
    is_public: bool = betterproto.bool_field(5)
    platforms_to_sync: list[str] = betterproto.string_field(6)
    request_headers_names: list[str] = betterproto.string_field(7)
    request_headers_values: list[str] = betterproto.string_field(8)
    upload_batch_id: int = betterproto.uint64_field(9)


class BeginHttpUploadResponse(UnifiedMessage, um_name="Cloud.BeginHTTPUpload"):
    ugcid: int = betterproto.fixed64_field(1)
    timestamp: int = betterproto.fixed32_field(2)
    url_host: str = betterproto.string_field(3)
    url_path: str = betterproto.string_field(4)
    use_https: bool = betterproto.bool_field(5)
    request_headers: dict[str, str] = betterproto.map_field(6, betterproto.TYPE_STRING, betterproto.TYPE_STRING)


class CommitHttpUploadRequest(UnifiedMessage, um_name="Cloud.CommitHTTPUpload"):
    transfer_succeeded: bool = betterproto.bool_field(1)
    appid: int = betterproto.uint32_field(2)
    file_sha: str = betterproto.string_field(3)
    filename: str = betterproto.string_field(4)


class CommitHttpUploadResponse(UnifiedMessage, um_name="Cloud.CommitHTTPUpload"):
    file_committed: bool = betterproto.bool_field(1)


class BeginUgcUploadRequest(UnifiedMessage, um_name="Cloud.BeginUGCUpload"):
    appid: int = betterproto.uint32_field(1)
    file_size: int = betterproto.uint32_field(2)
    filename: str = betterproto.string_field(3)
    file_sha: str = betterproto.string_field(4)
    content_type: str = betterproto.string_field(5)


class BeginUgcUploadResponse(UnifiedMessage, um_name="Cloud.BeginUGCUpload"):
    storage_system: EPublishedFileStorageSystem = betterproto.enum_field(1)
    ugcid: int = betterproto.fixed64_field(2)
    timestamp: int = betterproto.fixed32_field(3)
    url_host: str = betterproto.string_field(4)
    url_path: str = betterproto.string_field(5)
    use_https: bool = betterproto.bool_field(6)
    request_headers: dict[str, str] = betterproto.map_field(7, betterproto.TYPE_STRING, betterproto.TYPE_STRING)


class CommitUgcUploadRequest(UnifiedMessage, um_name="Cloud.CommitUGCUpload"):
    transfer_succeeded: bool = betterproto.bool_field(1)
    appid: int = betterproto.uint32_field(2)
    ugcid: int = betterproto.fixed64_field(3)


class CommitUgcUploadResponse(UnifiedMessage, um_name="Cloud.CommitUGCUpload"):
    file_committed: bool = betterproto.bool_field(1)


class GetFileDetailsRequest(UnifiedMessage, um_name="Cloud.GetFileDetails"):
    ugcid: int = betterproto.uint64_field(1)
    appid: int = betterproto.uint32_field(2)


@dataclass(eq=False, repr=False)
class UserFile(betterproto.Message):
    appid: int = betterproto.uint32_field(1)
    ugcid: int = betterproto.uint64_field(2)
    filename: str = betterproto.string_field(3)
    timestamp: int = betterproto.uint64_field(4)
    file_size: int = betterproto.uint32_field(5)
    url: str = betterproto.string_field(6)
    steamid_creator: int = betterproto.fixed64_field(7)
    flags: int = betterproto.uint32_field(8)
    platforms_to_sync: list[str] = betterproto.string_field(9)
    file_sha: str = betterproto.string_field(10)


class GetFileDetailsResponse(UnifiedMessage, um_name="Cloud.GetFileDetails"):
    details: UserFile = betterproto.message_field(1)


class EnumerateUserFilesRequest(UnifiedMessage, um_name="Cloud.EnumerateUserFiles"):
    appid: int = betterproto.uint32_field(1)
    extended_details: bool = betterproto.bool_field(2)
    count: int = betterproto.uint32_field(3)
    start_index: int = betterproto.uint32_field(4)


class EnumerateUserFilesResponse(UnifiedMessage, um_name="Cloud.EnumerateUserFiles"):
    files: list[UserFile] = betterproto.message_field(1)
    total_files: int = betterproto.uint32_field(2)


class DeleteRequest(UnifiedMessage, um_name="Cloud.Delete"):
    filename: str = betterproto.string_field(1)
    appid: int = betterproto.uint32_field(2)
    upload_batch_id: int = betterproto.uint64_field(3)


class DeleteResponse(UnifiedMessage, um_name="Cloud.Delete"):
    pass


class GetClientEncryptionKeyRequest(UnifiedMessage, um_name="Cloud.GetClientEncryptionKey"):
    pass


class GetClientEncryptionKeyResponse(UnifiedMessage, um_name="Cloud.GetClientEncryptionKey"):
    key: bytes = betterproto.bytes_field(1)
    crc: int = betterproto.int32_field(2)


class CdnReportNotification(UnifiedMessage, um_name="Cloud.CDNReport"):
    steamid: int = betterproto.fixed64_field(1)
    url: str = betterproto.string_field(2)
    success: bool = betterproto.bool_field(3)
    http_status_code: int = betterproto.uint32_field(4)
    expected_bytes: int = betterproto.uint64_field(5)
    received_bytes: int = betterproto.uint64_field(6)
    duration: int = betterproto.uint32_field(7)


class ExternalStorageTransferReportNotification(UnifiedMessage, um_name="Cloud.ExternalStorageTransferReport"):
    host: str = betterproto.string_field(1)
    path: str = betterproto.string_field(2)
    is_upload: bool = betterproto.bool_field(3)
    success: bool = betterproto.bool_field(4)
    http_status_code: int = betterproto.uint32_field(5)
    bytes_expected: int = betterproto.uint64_field(6)
    bytes_actual: int = betterproto.uint64_field(7)
    duration_ms: int = betterproto.uint32_field(8)
    cellid: int = betterproto.uint32_field(9)
    proxied: bool = betterproto.bool_field(10)
    ipv6_local: bool = betterproto.bool_field(11)
    ipv6_remote: bool = betterproto.bool_field(12)
    time_to_connect_ms: int = betterproto.uint32_field(13)
    time_to_send_req_ms: int = betterproto.uint32_field(14)
    time_to_first_byte_ms: int = betterproto.uint32_field(15)
    time_to_last_byte_ms: int = betterproto.uint32_field(16)


class BeginAppUploadBatchRequest(UnifiedMessage, um_name="Cloud.BeginAppUploadBatch"):
    appid: int = betterproto.uint32_field(1)
    machine_name: str = betterproto.string_field(2)
    files_to_upload: list[str] = betterproto.string_field(3)
    files_to_delete: list[str] = betterproto.string_field(4)
    client_id: int = betterproto.uint64_field(5)
    app_build_id: int = betterproto.uint64_field(6)


class BeginAppUploadBatchResponse(UnifiedMessage, um_name="Cloud.BeginAppUploadBatch"):
    batch_id: int = betterproto.uint64_field(1)
    app_change_number: int = betterproto.uint64_field(4)


class CompleteAppUploadBatchNotification(UnifiedMessage, um_name="Cloud.CompleteAppUploadBatch"):
    appid: int = betterproto.uint32_field(1)
    batch_id: int = betterproto.uint64_field(2)
    batch_eresult: int = betterproto.uint32_field(3)


class CompleteAppUploadBatchRequest(UnifiedMessage, um_name="Cloud.CompleteAppUploadBatchBlocking"):
    appid: int = betterproto.uint32_field(1)
    batch_id: int = betterproto.uint64_field(2)
    batch_eresult: int = betterproto.uint32_field(3)


class CompleteAppUploadBatchResponse(UnifiedMessage, um_name="Cloud.CompleteAppUploadBatchBlocking"):
    pass


class ClientBeginFileUploadRequest(UnifiedMessage, um_name="Cloud.ClientBeginFileUpload"):
    appid: int = betterproto.uint32_field(1)
    file_size: int = betterproto.uint32_field(2)
    raw_file_size: int = betterproto.uint32_field(3)
    file_sha: bytes = betterproto.bytes_field(4)
    time_stamp: int = betterproto.uint64_field(5)
    filename: str = betterproto.string_field(6)
    platforms_to_sync: int = betterproto.uint32_field(7)
    cell_id: int = betterproto.uint32_field(9)
    can_encrypt: bool = betterproto.bool_field(10)
    is_shared_file: bool = betterproto.bool_field(11)
    deprecated_realm: int = betterproto.uint32_field(12)
    upload_batch_id: int = betterproto.uint64_field(13)


@dataclass(eq=False, repr=False)
class ClientCloudFileUploadBlockDetails(betterproto.Message):
    url_host: str = betterproto.string_field(1)
    url_path: str = betterproto.string_field(2)
    use_https: bool = betterproto.bool_field(3)
    http_method: int = betterproto.int32_field(4)
    request_headers: dict[str, str] = betterproto.map_field(5, betterproto.TYPE_STRING, betterproto.TYPE_STRING)
    block_offset: int = betterproto.uint64_field(6)
    block_length: int = betterproto.uint32_field(7)
    explicit_body_data: bytes = betterproto.bytes_field(8)
    may_parallelize: bool = betterproto.bool_field(9)


class ClientBeginFileUploadResponse(UnifiedMessage, um_name="Cloud.ClientBeginFileUpload"):
    encrypt_file: bool = betterproto.bool_field(1)
    block_requests: list[ClientCloudFileUploadBlockDetails] = betterproto.message_field(2)


class ClientCommitFileUploadRequest(UnifiedMessage, um_name="Cloud.ClientCommitFileUpload"):
    transfer_succeeded: bool = betterproto.bool_field(1)
    appid: int = betterproto.uint32_field(2)
    file_sha: bytes = betterproto.bytes_field(3)
    filename: str = betterproto.string_field(4)


class ClientCommitFileUploadResponse(UnifiedMessage, um_name="Cloud.ClientCommitFileUpload"):
    file_committed: bool = betterproto.bool_field(1)


class ClientFileDownloadRequest(UnifiedMessage, um_name="Cloud.ClientFileDownload"):
    appid: int = betterproto.uint32_field(1)
    filename: str = betterproto.string_field(2)
    realm: int = betterproto.uint32_field(3)


class ClientFileDownloadResponse(UnifiedMessage, um_name="Cloud.ClientFileDownload"):
    appid: int = betterproto.uint32_field(1)
    file_size: int = betterproto.uint32_field(2)
    raw_file_size: int = betterproto.uint32_field(3)
    sha_file: bytes = betterproto.bytes_field(4)
    time_stamp: int = betterproto.uint64_field(5)
    is_explicit_delete: bool = betterproto.bool_field(6)
    url_host: str = betterproto.string_field(7)
    url_path: str = betterproto.string_field(8)
    use_https: bool = betterproto.bool_field(9)
    request_headers: dict[str, str] = betterproto.map_field(10, betterproto.TYPE_STRING, betterproto.TYPE_STRING)
    encrypted: bool = betterproto.bool_field(11)


class ClientDeleteFileRequest(UnifiedMessage, um_name="Cloud.ClientDeleteFile"):
    appid: int = betterproto.uint32_field(1)
    filename: str = betterproto.string_field(2)
    is_explicit_delete: bool = betterproto.bool_field(3)
    upload_batch_id: int = betterproto.uint64_field(4)


class ClientDeleteFileResponse(UnifiedMessage, um_name="Cloud.ClientDeleteFile"):
    pass


class ClientConflictResolutionNotification(UnifiedMessage, um_name="Cloud.ClientConflictResolution"):
    appid: int = betterproto.uint32_field(1)
    chose_local_files: bool = betterproto.bool_field(2)


class EnumerateUserAppsRequest(UnifiedMessage, um_name="Cloud.EnumerateUserApps"):
    pass


class EnumerateUserAppsResponse(UnifiedMessage, um_name="Cloud.EnumerateUserApps"):
    apps: "list[EnumerateUserAppsResponseApps]" = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class EnumerateUserAppsResponseApps(betterproto.Message):
    appid: int = betterproto.uint32_field(1)
    totalcount: int = betterproto.int32_field(2)
    totalsize: int = betterproto.int64_field(3)


class GetAppFileChangelistRequest(UnifiedMessage, um_name="Cloud.GetAppFileChangelist"):
    appid: int = betterproto.uint32_field(1)
    synced_change_number: int = betterproto.uint64_field(2)


@dataclass(eq=False, repr=False)
class AppFileInfo(betterproto.Message):
    file_name: str = betterproto.string_field(1)
    sha_file: bytes = betterproto.bytes_field(2)
    time_stamp: int = betterproto.uint64_field(3)
    raw_file_size: int = betterproto.uint32_field(4)
    persist_state: ECloudStoragePersistState = betterproto.enum_field(5)
    platforms_to_sync: int = betterproto.uint32_field(6)
    path_prefix_index: int = betterproto.uint32_field(7)
    machine_name_index: int = betterproto.uint32_field(8)


class GetAppFileChangelistResponse(UnifiedMessage, um_name="Cloud.GetAppFileChangelist"):
    current_change_number: int = betterproto.uint64_field(1)
    files: list[AppFileInfo] = betterproto.message_field(2)
    is_only_delta: bool = betterproto.bool_field(3)
    path_prefixes: list[str] = betterproto.string_field(4)
    machine_names: list[str] = betterproto.string_field(5)
    app_buildid_hwm: int = betterproto.uint64_field(6)


class AppSessionSuspendRequest(UnifiedMessage, um_name="Cloud.SuspendAppSession"):
    appid: int = betterproto.uint32_field(1)
    client_id: int = betterproto.uint64_field(2)
    machine_name: str = betterproto.string_field(3)
    cloud_sync_completed: bool = betterproto.bool_field(4)


class AppSessionSuspendResponse(UnifiedMessage, um_name="Cloud.SuspendAppSession"):
    pass


class AppSessionResumeRequest(UnifiedMessage, um_name="Cloud.ResumeAppSession"):
    appid: int = betterproto.uint32_field(1)
    client_id: int = betterproto.uint64_field(2)


class AppSessionResumeResponse(UnifiedMessage, um_name="Cloud.ResumeAppSession"):
    pass


class AppLaunchIntentRequest(UnifiedMessage, um_name="Cloud.AppLaunchIntent"):
    appid: int = betterproto.uint32_field(1)
    client_id: int = betterproto.uint64_field(2)
    machine_name: str = betterproto.string_field(3)
    ignore_pending_operations: bool = betterproto.bool_field(4)


@dataclass(eq=False, repr=False)
class PendingRemoteOperation(betterproto.Message):
    operation: ECloudPendingRemoteOperation = betterproto.enum_field(1)
    machine_name: str = betterproto.string_field(2)
    client_id: int = betterproto.uint64_field(3)
    time_last_updated: int = betterproto.uint32_field(4)


class AppLaunchIntentResponse(UnifiedMessage, um_name="Cloud.SignalAppLaunchIntent"):
    pending_remote_operations: list[PendingRemoteOperation] = betterproto.message_field(1)


class AppExitSyncDoneNotification(UnifiedMessage, um_name="Cloud.SignalAppExitSyncDone"):
    appid: int = betterproto.uint32_field(1)
    client_id: int = betterproto.uint64_field(2)
    uploads_completed: bool = betterproto.bool_field(3)


class ClientGetAppQuotaUsageRequest(UnifiedMessage, um_name="Cloud.ClientGetAppQuotaUsage"):
    appid: int = betterproto.uint32_field(1)


class ClientGetAppQuotaUsageResponse(UnifiedMessage, um_name="Cloud.ClientGetAppQuotaUsage"):
    existing_files: int = betterproto.uint32_field(1)
    existing_bytes: int = betterproto.uint64_field(2)
    max_num_files: int = betterproto.uint32_field(3)
    max_num_bytes: int = betterproto.uint64_field(4)


class AppCloudStateChangeNotification(
    UnifiedMessage, um_name="CloudClient.NotifyAppStateChange"
):  # TODO can this be used for update detection?
    appid: int = betterproto.uint32_field(1)
    app_change_number: int = betterproto.uint64_field(2)


class ClientLogUploadRequestNotification(UnifiedMessage, um_name="CloudClient.ClientLogUpload"):
    request_id: int = betterproto.uint64_field(1)
