#![allow(
    clippy::too_many_arguments,
    clippy::large_enum_variant,
    clippy::doc_markdown,
)]
pub type CopyBatchArg = RelocationBatchArgBase;
pub type FileId = String;
pub type Id = String;
pub type ListFolderCursor = String;
pub type MalformedPathError = Option<String>;
pub type Path = String;
pub type PathOrId = String;
pub type PathR = String;
pub type PathROrId = String;
pub type ReadPath = String;
pub type Rev = String;
pub type SearchV2Cursor = String;
pub type Sha256HexHash = String;
pub type SharedLinkUrl = String;
pub type WritePath = String;
pub type WritePathOrId = String;
pub fn alpha_get_metadata(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &AlphaGetMetadataArg,
) -> crate::Result<Result<Metadata, AlphaGetMetadataError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/alpha/get_metadata",
        arg,
        None)
}
pub fn alpha_upload(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &CommitInfoWithProperties,
    body: &[u8],
) -> crate::Result<Result<FileMetadata, UploadErrorWithProperties>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Upload,
        "files/alpha/upload",
        arg,
        Some(body))
}
pub fn copy_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &RelocationArg,
) -> crate::Result<Result<RelocationResult, RelocationError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/copy_v2",
        arg,
        None)
}
pub fn copy(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &RelocationArg,
) -> crate::Result<Result<Metadata, RelocationError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/copy",
        arg,
        None)
}
pub fn copy_batch_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &CopyBatchArg,
) -> crate::Result<Result<RelocationBatchV2Launch, ()>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/copy_batch_v2",
        arg,
        None)
}
pub fn copy_batch(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &RelocationBatchArg,
) -> crate::Result<Result<RelocationBatchLaunch, ()>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/copy_batch",
        arg,
        None)
}
pub fn copy_batch_check_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::dbx_async::PollArg,
) -> crate::Result<Result<RelocationBatchV2JobStatus, super::dbx_async::PollError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/copy_batch/check_v2",
        arg,
        None)
}
pub fn copy_batch_check(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::dbx_async::PollArg,
) -> crate::Result<Result<RelocationBatchJobStatus, super::dbx_async::PollError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/copy_batch/check",
        arg,
        None)
}
pub fn copy_reference_get(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &GetCopyReferenceArg,
) -> crate::Result<Result<GetCopyReferenceResult, GetCopyReferenceError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/copy_reference/get",
        arg,
        None)
}
pub fn copy_reference_save(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &SaveCopyReferenceArg,
) -> crate::Result<Result<SaveCopyReferenceResult, SaveCopyReferenceError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/copy_reference/save",
        arg,
        None)
}
pub fn create_folder_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &CreateFolderArg,
) -> crate::Result<Result<CreateFolderResult, CreateFolderError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/create_folder_v2",
        arg,
        None)
}
pub fn create_folder(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &CreateFolderArg,
) -> crate::Result<Result<FolderMetadata, CreateFolderError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/create_folder",
        arg,
        None)
}
pub fn create_folder_batch(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &CreateFolderBatchArg,
) -> crate::Result<Result<CreateFolderBatchLaunch, ()>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/create_folder_batch",
        arg,
        None)
}
pub fn create_folder_batch_check(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::dbx_async::PollArg,
) -> crate::Result<Result<CreateFolderBatchJobStatus, super::dbx_async::PollError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/create_folder_batch/check",
        arg,
        None)
}
pub fn delete_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &DeleteArg,
) -> crate::Result<Result<DeleteResult, DeleteError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/delete_v2",
        arg,
        None)
}
pub fn delete(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &DeleteArg,
) -> crate::Result<Result<Metadata, DeleteError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/delete",
        arg,
        None)
}
pub fn delete_batch(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &DeleteBatchArg,
) -> crate::Result<Result<DeleteBatchLaunch, ()>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/delete_batch",
        arg,
        None)
}
pub fn delete_batch_check(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::dbx_async::PollArg,
) -> crate::Result<Result<DeleteBatchJobStatus, super::dbx_async::PollError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/delete_batch/check",
        arg,
        None)
}
pub fn download(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &DownloadArg,
    range_start: Option<u64>,
    range_end: Option<u64>,
) -> crate::Result<Result<crate::client_trait::HttpRequestResult<FileMetadata>, DownloadError>> {
    crate::client_helpers::request_with_body(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Download,
        "files/download",
        arg,
        None,
        range_start,
        range_end)
}
pub fn download_zip(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &DownloadZipArg,
    range_start: Option<u64>,
    range_end: Option<u64>,
) -> crate::Result<Result<crate::client_trait::HttpRequestResult<DownloadZipResult>, DownloadZipError>> {
    crate::client_helpers::request_with_body(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Download,
        "files/download_zip",
        arg,
        None,
        range_start,
        range_end)
}
pub fn export(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &ExportArg,
    range_start: Option<u64>,
    range_end: Option<u64>,
) -> crate::Result<Result<crate::client_trait::HttpRequestResult<ExportResult>, ExportError>> {
    crate::client_helpers::request_with_body(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Download,
        "files/export",
        arg,
        None,
        range_start,
        range_end)
}
pub fn get_file_lock_batch(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &LockFileBatchArg,
) -> crate::Result<Result<LockFileBatchResult, LockFileError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/get_file_lock_batch",
        arg,
        None)
}
pub fn get_metadata(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &GetMetadataArg,
) -> crate::Result<Result<Metadata, GetMetadataError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/get_metadata",
        arg,
        None)
}
pub fn get_preview(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &PreviewArg,
    range_start: Option<u64>,
    range_end: Option<u64>,
) -> crate::Result<Result<crate::client_trait::HttpRequestResult<FileMetadata>, PreviewError>> {
    crate::client_helpers::request_with_body(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Download,
        "files/get_preview",
        arg,
        None,
        range_start,
        range_end)
}
pub fn get_temporary_link(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &GetTemporaryLinkArg,
) -> crate::Result<Result<GetTemporaryLinkResult, GetTemporaryLinkError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/get_temporary_link",
        arg,
        None)
}
pub fn get_temporary_upload_link(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &GetTemporaryUploadLinkArg,
) -> crate::Result<Result<GetTemporaryUploadLinkResult, ()>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/get_temporary_upload_link",
        arg,
        None)
}
pub fn get_thumbnail(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &ThumbnailArg,
    range_start: Option<u64>,
    range_end: Option<u64>,
) -> crate::Result<Result<crate::client_trait::HttpRequestResult<FileMetadata>, ThumbnailError>> {
    crate::client_helpers::request_with_body(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Download,
        "files/get_thumbnail",
        arg,
        None,
        range_start,
        range_end)
}
pub fn get_thumbnail_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &ThumbnailV2Arg,
    range_start: Option<u64>,
    range_end: Option<u64>,
) -> crate::Result<Result<crate::client_trait::HttpRequestResult<PreviewResult>, ThumbnailV2Error>> {
    crate::client_helpers::request_with_body(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Download,
        "files/get_thumbnail_v2",
        arg,
        None,
        range_start,
        range_end)
}
pub fn get_thumbnail_v2_app_auth(
    client: &impl crate::client_trait::AppAuthClient,
    arg: &ThumbnailV2Arg,
    range_start: Option<u64>,
    range_end: Option<u64>,
) -> crate::Result<Result<crate::client_trait::HttpRequestResult<PreviewResult>, ThumbnailV2Error>> {
    crate::client_helpers::request_with_body(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Download,
        "files/get_thumbnail_v2",
        arg,
        None,
        range_start,
        range_end)
}
pub fn get_thumbnail_batch(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &GetThumbnailBatchArg,
) -> crate::Result<Result<GetThumbnailBatchResult, GetThumbnailBatchError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Rpc,
        "files/get_thumbnail_batch",
        arg,
        None)
}
pub fn list_folder(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &ListFolderArg,
) -> crate::Result<Result<ListFolderResult, ListFolderError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/list_folder",
        arg,
        None)
}
pub fn list_folder_continue(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &ListFolderContinueArg,
) -> crate::Result<Result<ListFolderResult, ListFolderContinueError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/list_folder/continue",
        arg,
        None)
}
pub fn list_folder_get_latest_cursor(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &ListFolderArg,
) -> crate::Result<Result<ListFolderGetLatestCursorResult, ListFolderError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/list_folder/get_latest_cursor",
        arg,
        None)
}
pub fn list_folder_longpoll(
    client: &impl crate::client_trait::NoauthClient,
    arg: &ListFolderLongpollArg,
) -> crate::Result<Result<ListFolderLongpollResult, ListFolderLongpollError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Notify,
        crate::client_trait::Style::Rpc,
        "files/list_folder/longpoll",
        arg,
        None)
}
pub fn list_revisions(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &ListRevisionsArg,
) -> crate::Result<Result<ListRevisionsResult, ListRevisionsError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/list_revisions",
        arg,
        None)
}
pub fn lock_file_batch(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &LockFileBatchArg,
) -> crate::Result<Result<LockFileBatchResult, LockFileError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/lock_file_batch",
        arg,
        None)
}
pub fn move_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &RelocationArg,
) -> crate::Result<Result<RelocationResult, RelocationError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/move_v2",
        arg,
        None)
}
pub fn do_move(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &RelocationArg,
) -> crate::Result<Result<Metadata, RelocationError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/move",
        arg,
        None)
}
pub fn move_batch_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &MoveBatchArg,
) -> crate::Result<Result<RelocationBatchV2Launch, ()>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/move_batch_v2",
        arg,
        None)
}
pub fn move_batch(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &RelocationBatchArg,
) -> crate::Result<Result<RelocationBatchLaunch, ()>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/move_batch",
        arg,
        None)
}
pub fn move_batch_check_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::dbx_async::PollArg,
) -> crate::Result<Result<RelocationBatchV2JobStatus, super::dbx_async::PollError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/move_batch/check_v2",
        arg,
        None)
}
pub fn move_batch_check(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::dbx_async::PollArg,
) -> crate::Result<Result<RelocationBatchJobStatus, super::dbx_async::PollError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/move_batch/check",
        arg,
        None)
}
pub fn permanently_delete(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &DeleteArg,
) -> crate::Result<Result<(), DeleteError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/permanently_delete",
        arg,
        None)
}
pub fn properties_add(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::file_properties::AddPropertiesArg,
) -> crate::Result<Result<(), super::file_properties::AddPropertiesError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/properties/add",
        arg,
        None)
}
pub fn properties_overwrite(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::file_properties::OverwritePropertyGroupArg,
) -> crate::Result<Result<(), super::file_properties::InvalidPropertyGroupError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/properties/overwrite",
        arg,
        None)
}
pub fn properties_remove(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::file_properties::RemovePropertiesArg,
) -> crate::Result<Result<(), super::file_properties::RemovePropertiesError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/properties/remove",
        arg,
        None)
}
pub fn properties_template_get(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::file_properties::GetTemplateArg,
) -> crate::Result<Result<super::file_properties::GetTemplateResult, super::file_properties::TemplateError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/properties/template/get",
        arg,
        None)
}
pub fn properties_template_list(
    client: &impl crate::client_trait::UserAuthClient,
) -> crate::Result<Result<super::file_properties::ListTemplateResult, super::file_properties::TemplateError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/properties/template/list",
        &(),
        None)
}
pub fn properties_update(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::file_properties::UpdatePropertiesArg,
) -> crate::Result<Result<(), super::file_properties::UpdatePropertiesError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/properties/update",
        arg,
        None)
}
pub fn restore(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &RestoreArg,
) -> crate::Result<Result<FileMetadata, RestoreError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/restore",
        arg,
        None)
}
pub fn save_url(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &SaveUrlArg,
) -> crate::Result<Result<SaveUrlResult, SaveUrlError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/save_url",
        arg,
        None)
}
pub fn save_url_check_job_status(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::dbx_async::PollArg,
) -> crate::Result<Result<SaveUrlJobStatus, super::dbx_async::PollError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/save_url/check_job_status",
        arg,
        None)
}
pub fn search(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &SearchArg,
) -> crate::Result<Result<SearchResult, SearchError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/search",
        arg,
        None)
}
pub fn search_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &SearchV2Arg,
) -> crate::Result<Result<SearchV2Result, SearchError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/search_v2",
        arg,
        None)
}
pub fn search_continue_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &SearchV2ContinueArg,
) -> crate::Result<Result<SearchV2Result, SearchError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/search/continue_v2",
        arg,
        None)
}
pub fn unlock_file_batch(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &UnlockFileBatchArg,
) -> crate::Result<Result<LockFileBatchResult, LockFileError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/unlock_file_batch",
        arg,
        None)
}
pub fn upload(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &CommitInfo,
    body: &[u8],
) -> crate::Result<Result<FileMetadata, UploadError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Upload,
        "files/upload",
        arg,
        Some(body))
}
pub fn upload_session_append_v2(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &UploadSessionAppendArg,
    body: &[u8],
) -> crate::Result<Result<(), UploadSessionLookupError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Upload,
        "files/upload_session/append_v2",
        arg,
        Some(body))
}
pub fn upload_session_append(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &UploadSessionCursor,
    body: &[u8],
) -> crate::Result<Result<(), UploadSessionLookupError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Upload,
        "files/upload_session/append",
        arg,
        Some(body))
}
pub fn upload_session_finish(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &UploadSessionFinishArg,
    body: &[u8],
) -> crate::Result<Result<FileMetadata, UploadSessionFinishError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Upload,
        "files/upload_session/finish",
        arg,
        Some(body))
}
pub fn upload_session_finish_batch(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &UploadSessionFinishBatchArg,
) -> crate::Result<Result<UploadSessionFinishBatchLaunch, ()>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/upload_session/finish_batch",
        arg,
        None)
}
pub fn upload_session_finish_batch_check(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &super::dbx_async::PollArg,
) -> crate::Result<Result<UploadSessionFinishBatchJobStatus, super::dbx_async::PollError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Api,
        crate::client_trait::Style::Rpc,
        "files/upload_session/finish_batch/check",
        arg,
        None)
}
pub fn upload_session_start(
    client: &impl crate::client_trait::UserAuthClient,
    arg: &UploadSessionStartArg,
    body: &[u8],
) -> crate::Result<Result<UploadSessionStartResult, UploadSessionStartError>> {
    crate::client_helpers::request(
        client,
        crate::client_trait::Endpoint::Content,
        crate::client_trait::Style::Upload,
        "files/upload_session/start",
        arg,
        Some(body))
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct AlphaGetMetadataArg {
    
    pub path: ReadPath,
    
    pub include_media_info: bool,
    
    
    pub include_deleted: bool,
    
    
    pub include_has_explicit_shared_members: bool,
    
    
    pub include_property_groups: Option<super::file_properties::TemplateFilterBase>,
    
    
    pub include_property_templates: Option<Vec<super::file_properties::TemplateId>>,
}
impl AlphaGetMetadataArg {
    pub fn new(path: ReadPath) -> Self {
        AlphaGetMetadataArg {
            path,
            include_media_info: false,
            include_deleted: false,
            include_has_explicit_shared_members: false,
            include_property_groups: None,
            include_property_templates: None,
        }
    }
    pub fn with_include_media_info(mut self, value: bool) -> Self {
        self.include_media_info = value;
        self
    }
    pub fn with_include_deleted(mut self, value: bool) -> Self {
        self.include_deleted = value;
        self
    }
    pub fn with_include_has_explicit_shared_members(mut self, value: bool) -> Self {
        self.include_has_explicit_shared_members = value;
        self
    }
    pub fn with_include_property_groups(
        mut self,
        value: super::file_properties::TemplateFilterBase,
    ) -> Self {
        self.include_property_groups = Some(value);
        self
    }
    pub fn with_include_property_templates(
        mut self,
        value: Vec<super::file_properties::TemplateId>,
    ) -> Self {
        self.include_property_templates = Some(value);
        self
    }
}
const ALPHA_GET_METADATA_ARG_FIELDS: &[&str] = &["path",
                                                 "include_media_info",
                                                 "include_deleted",
                                                 "include_has_explicit_shared_members",
                                                 "include_property_groups",
                                                 "include_property_templates"];
impl AlphaGetMetadataArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<AlphaGetMetadataArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<AlphaGetMetadataArg>, V::Error> {
        let mut field_path = None;
        let mut field_include_media_info = None;
        let mut field_include_deleted = None;
        let mut field_include_has_explicit_shared_members = None;
        let mut field_include_property_groups = None;
        let mut field_include_property_templates = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "include_media_info" => {
                    if field_include_media_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_media_info"));
                    }
                    field_include_media_info = Some(map.next_value()?);
                }
                "include_deleted" => {
                    if field_include_deleted.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_deleted"));
                    }
                    field_include_deleted = Some(map.next_value()?);
                }
                "include_has_explicit_shared_members" => {
                    if field_include_has_explicit_shared_members.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_has_explicit_shared_members"));
                    }
                    field_include_has_explicit_shared_members = Some(map.next_value()?);
                }
                "include_property_groups" => {
                    if field_include_property_groups.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_property_groups"));
                    }
                    field_include_property_groups = Some(map.next_value()?);
                }
                "include_property_templates" => {
                    if field_include_property_templates.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_property_templates"));
                    }
                    field_include_property_templates = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = AlphaGetMetadataArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            include_media_info: field_include_media_info.unwrap_or(false),
            include_deleted: field_include_deleted.unwrap_or(false),
            include_has_explicit_shared_members: field_include_has_explicit_shared_members.unwrap_or(false),
            include_property_groups: field_include_property_groups,
            include_property_templates: field_include_property_templates,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("include_media_info", &self.include_media_info)?;
        s.serialize_field("include_deleted", &self.include_deleted)?;
        s.serialize_field("include_has_explicit_shared_members", &self.include_has_explicit_shared_members)?;
        s.serialize_field("include_property_groups", &self.include_property_groups)?;
        s.serialize_field("include_property_templates", &self.include_property_templates)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for AlphaGetMetadataArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = AlphaGetMetadataArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a AlphaGetMetadataArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                AlphaGetMetadataArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("AlphaGetMetadataArg", ALPHA_GET_METADATA_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for AlphaGetMetadataArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("AlphaGetMetadataArg", 6)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum AlphaGetMetadataError {
    Path(LookupError),
    PropertiesError(super::file_properties::LookUpPropertiesError),
}
impl<'de> ::serde::de::Deserialize<'de> for AlphaGetMetadataError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = AlphaGetMetadataError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a AlphaGetMetadataError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(AlphaGetMetadataError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "properties_error" => {
                        match map.next_key()? {
                            Some("properties_error") => Ok(AlphaGetMetadataError::PropertiesError(map.next_value()?)),
                            None => Err(de::Error::missing_field("properties_error")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "properties_error"];
        deserializer.deserialize_struct("AlphaGetMetadataError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for AlphaGetMetadataError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            AlphaGetMetadataError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("AlphaGetMetadataError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            AlphaGetMetadataError::PropertiesError(ref x) => {
                
                let mut s = serializer.serialize_struct("AlphaGetMetadataError", 2)?;
                s.serialize_field(".tag", "properties_error")?;
                s.serialize_field("properties_error", x)?;
                s.end()
            }
        }
    }
}
impl ::std::error::Error for AlphaGetMetadataError {
    fn description(&self) -> &str {
        "AlphaGetMetadataError"
    }
}
impl ::std::fmt::Display for AlphaGetMetadataError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct CommitInfo {
    
    pub path: WritePathOrId,
    
    pub mode: WriteMode,
    
    
    pub autorename: bool,
    
    
    
    
    pub client_modified: Option<super::common::DropboxTimestamp>,
    
    
    
    pub mute: bool,
    
    pub property_groups: Option<Vec<super::file_properties::PropertyGroup>>,
    
    
    
    
    
    pub strict_conflict: bool,
}
impl CommitInfo {
    pub fn new(path: WritePathOrId) -> Self {
        CommitInfo {
            path,
            mode: WriteMode::Add,
            autorename: false,
            client_modified: None,
            mute: false,
            property_groups: None,
            strict_conflict: false,
        }
    }
    pub fn with_mode(mut self, value: WriteMode) -> Self {
        self.mode = value;
        self
    }
    pub fn with_autorename(mut self, value: bool) -> Self {
        self.autorename = value;
        self
    }
    pub fn with_client_modified(mut self, value: super::common::DropboxTimestamp) -> Self {
        self.client_modified = Some(value);
        self
    }
    pub fn with_mute(mut self, value: bool) -> Self {
        self.mute = value;
        self
    }
    pub fn with_property_groups(
        mut self,
        value: Vec<super::file_properties::PropertyGroup>,
    ) -> Self {
        self.property_groups = Some(value);
        self
    }
    pub fn with_strict_conflict(mut self, value: bool) -> Self {
        self.strict_conflict = value;
        self
    }
}
const COMMIT_INFO_FIELDS: &[&str] = &["path",
                                      "mode",
                                      "autorename",
                                      "client_modified",
                                      "mute",
                                      "property_groups",
                                      "strict_conflict"];
impl CommitInfo {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<CommitInfo, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<CommitInfo>, V::Error> {
        let mut field_path = None;
        let mut field_mode = None;
        let mut field_autorename = None;
        let mut field_client_modified = None;
        let mut field_mute = None;
        let mut field_property_groups = None;
        let mut field_strict_conflict = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "mode" => {
                    if field_mode.is_some() {
                        return Err(::serde::de::Error::duplicate_field("mode"));
                    }
                    field_mode = Some(map.next_value()?);
                }
                "autorename" => {
                    if field_autorename.is_some() {
                        return Err(::serde::de::Error::duplicate_field("autorename"));
                    }
                    field_autorename = Some(map.next_value()?);
                }
                "client_modified" => {
                    if field_client_modified.is_some() {
                        return Err(::serde::de::Error::duplicate_field("client_modified"));
                    }
                    field_client_modified = Some(map.next_value()?);
                }
                "mute" => {
                    if field_mute.is_some() {
                        return Err(::serde::de::Error::duplicate_field("mute"));
                    }
                    field_mute = Some(map.next_value()?);
                }
                "property_groups" => {
                    if field_property_groups.is_some() {
                        return Err(::serde::de::Error::duplicate_field("property_groups"));
                    }
                    field_property_groups = Some(map.next_value()?);
                }
                "strict_conflict" => {
                    if field_strict_conflict.is_some() {
                        return Err(::serde::de::Error::duplicate_field("strict_conflict"));
                    }
                    field_strict_conflict = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = CommitInfo {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            mode: field_mode.unwrap_or(WriteMode::Add),
            autorename: field_autorename.unwrap_or(false),
            client_modified: field_client_modified,
            mute: field_mute.unwrap_or(false),
            property_groups: field_property_groups,
            strict_conflict: field_strict_conflict.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("mode", &self.mode)?;
        s.serialize_field("autorename", &self.autorename)?;
        s.serialize_field("client_modified", &self.client_modified)?;
        s.serialize_field("mute", &self.mute)?;
        s.serialize_field("property_groups", &self.property_groups)?;
        s.serialize_field("strict_conflict", &self.strict_conflict)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for CommitInfo {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = CommitInfo;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CommitInfo struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                CommitInfo::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("CommitInfo", COMMIT_INFO_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for CommitInfo {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("CommitInfo", 7)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct CommitInfoWithProperties {
    
    pub path: WritePathOrId,
    
    pub mode: WriteMode,
    
    
    pub autorename: bool,
    
    
    
    
    pub client_modified: Option<super::common::DropboxTimestamp>,
    
    
    
    pub mute: bool,
    
    pub property_groups: Option<Vec<super::file_properties::PropertyGroup>>,
    
    
    
    
    
    pub strict_conflict: bool,
}
impl CommitInfoWithProperties {
    pub fn new(path: WritePathOrId) -> Self {
        CommitInfoWithProperties {
            path,
            mode: WriteMode::Add,
            autorename: false,
            client_modified: None,
            mute: false,
            property_groups: None,
            strict_conflict: false,
        }
    }
    pub fn with_mode(mut self, value: WriteMode) -> Self {
        self.mode = value;
        self
    }
    pub fn with_autorename(mut self, value: bool) -> Self {
        self.autorename = value;
        self
    }
    pub fn with_client_modified(mut self, value: super::common::DropboxTimestamp) -> Self {
        self.client_modified = Some(value);
        self
    }
    pub fn with_mute(mut self, value: bool) -> Self {
        self.mute = value;
        self
    }
    pub fn with_property_groups(
        mut self,
        value: Vec<super::file_properties::PropertyGroup>,
    ) -> Self {
        self.property_groups = Some(value);
        self
    }
    pub fn with_strict_conflict(mut self, value: bool) -> Self {
        self.strict_conflict = value;
        self
    }
}
const COMMIT_INFO_WITH_PROPERTIES_FIELDS: &[&str] = &["path",
                                                      "mode",
                                                      "autorename",
                                                      "client_modified",
                                                      "mute",
                                                      "property_groups",
                                                      "strict_conflict"];
impl CommitInfoWithProperties {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<CommitInfoWithProperties, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<CommitInfoWithProperties>, V::Error> {
        let mut field_path = None;
        let mut field_mode = None;
        let mut field_autorename = None;
        let mut field_client_modified = None;
        let mut field_mute = None;
        let mut field_property_groups = None;
        let mut field_strict_conflict = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "mode" => {
                    if field_mode.is_some() {
                        return Err(::serde::de::Error::duplicate_field("mode"));
                    }
                    field_mode = Some(map.next_value()?);
                }
                "autorename" => {
                    if field_autorename.is_some() {
                        return Err(::serde::de::Error::duplicate_field("autorename"));
                    }
                    field_autorename = Some(map.next_value()?);
                }
                "client_modified" => {
                    if field_client_modified.is_some() {
                        return Err(::serde::de::Error::duplicate_field("client_modified"));
                    }
                    field_client_modified = Some(map.next_value()?);
                }
                "mute" => {
                    if field_mute.is_some() {
                        return Err(::serde::de::Error::duplicate_field("mute"));
                    }
                    field_mute = Some(map.next_value()?);
                }
                "property_groups" => {
                    if field_property_groups.is_some() {
                        return Err(::serde::de::Error::duplicate_field("property_groups"));
                    }
                    field_property_groups = Some(map.next_value()?);
                }
                "strict_conflict" => {
                    if field_strict_conflict.is_some() {
                        return Err(::serde::de::Error::duplicate_field("strict_conflict"));
                    }
                    field_strict_conflict = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = CommitInfoWithProperties {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            mode: field_mode.unwrap_or(WriteMode::Add),
            autorename: field_autorename.unwrap_or(false),
            client_modified: field_client_modified,
            mute: field_mute.unwrap_or(false),
            property_groups: field_property_groups,
            strict_conflict: field_strict_conflict.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("mode", &self.mode)?;
        s.serialize_field("autorename", &self.autorename)?;
        s.serialize_field("client_modified", &self.client_modified)?;
        s.serialize_field("mute", &self.mute)?;
        s.serialize_field("property_groups", &self.property_groups)?;
        s.serialize_field("strict_conflict", &self.strict_conflict)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for CommitInfoWithProperties {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = CommitInfoWithProperties;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CommitInfoWithProperties struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                CommitInfoWithProperties::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("CommitInfoWithProperties", COMMIT_INFO_WITH_PROPERTIES_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for CommitInfoWithProperties {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("CommitInfoWithProperties", 7)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ContentSyncSetting {
    
    pub id: FileId,
    
    pub sync_setting: SyncSetting,
}
impl ContentSyncSetting {
    pub fn new(id: FileId, sync_setting: SyncSetting) -> Self {
        ContentSyncSetting {
            id,
            sync_setting,
        }
    }
}
const CONTENT_SYNC_SETTING_FIELDS: &[&str] = &["id",
                                               "sync_setting"];
impl ContentSyncSetting {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ContentSyncSetting, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ContentSyncSetting>, V::Error> {
        let mut field_id = None;
        let mut field_sync_setting = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "id" => {
                    if field_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("id"));
                    }
                    field_id = Some(map.next_value()?);
                }
                "sync_setting" => {
                    if field_sync_setting.is_some() {
                        return Err(::serde::de::Error::duplicate_field("sync_setting"));
                    }
                    field_sync_setting = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ContentSyncSetting {
            id: field_id.ok_or_else(|| ::serde::de::Error::missing_field("id"))?,
            sync_setting: field_sync_setting.ok_or_else(|| ::serde::de::Error::missing_field("sync_setting"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("id", &self.id)?;
        s.serialize_field("sync_setting", &self.sync_setting)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ContentSyncSetting {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ContentSyncSetting;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ContentSyncSetting struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ContentSyncSetting::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ContentSyncSetting", CONTENT_SYNC_SETTING_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ContentSyncSetting {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ContentSyncSetting", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ContentSyncSettingArg {
    
    pub id: FileId,
    
    pub sync_setting: SyncSettingArg,
}
impl ContentSyncSettingArg {
    pub fn new(id: FileId, sync_setting: SyncSettingArg) -> Self {
        ContentSyncSettingArg {
            id,
            sync_setting,
        }
    }
}
const CONTENT_SYNC_SETTING_ARG_FIELDS: &[&str] = &["id",
                                                   "sync_setting"];
impl ContentSyncSettingArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ContentSyncSettingArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ContentSyncSettingArg>, V::Error> {
        let mut field_id = None;
        let mut field_sync_setting = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "id" => {
                    if field_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("id"));
                    }
                    field_id = Some(map.next_value()?);
                }
                "sync_setting" => {
                    if field_sync_setting.is_some() {
                        return Err(::serde::de::Error::duplicate_field("sync_setting"));
                    }
                    field_sync_setting = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ContentSyncSettingArg {
            id: field_id.ok_or_else(|| ::serde::de::Error::missing_field("id"))?,
            sync_setting: field_sync_setting.ok_or_else(|| ::serde::de::Error::missing_field("sync_setting"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("id", &self.id)?;
        s.serialize_field("sync_setting", &self.sync_setting)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ContentSyncSettingArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ContentSyncSettingArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ContentSyncSettingArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ContentSyncSettingArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ContentSyncSettingArg", CONTENT_SYNC_SETTING_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ContentSyncSettingArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ContentSyncSettingArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct CreateFolderArg {
    
    pub path: WritePath,
    
    
    pub autorename: bool,
}
impl CreateFolderArg {
    pub fn new(path: WritePath) -> Self {
        CreateFolderArg {
            path,
            autorename: false,
        }
    }
    pub fn with_autorename(mut self, value: bool) -> Self {
        self.autorename = value;
        self
    }
}
const CREATE_FOLDER_ARG_FIELDS: &[&str] = &["path",
                                            "autorename"];
impl CreateFolderArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<CreateFolderArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<CreateFolderArg>, V::Error> {
        let mut field_path = None;
        let mut field_autorename = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "autorename" => {
                    if field_autorename.is_some() {
                        return Err(::serde::de::Error::duplicate_field("autorename"));
                    }
                    field_autorename = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = CreateFolderArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            autorename: field_autorename.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("autorename", &self.autorename)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = CreateFolderArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                CreateFolderArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("CreateFolderArg", CREATE_FOLDER_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("CreateFolderArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct CreateFolderBatchArg {
    
    
    pub paths: Vec<WritePath>,
    
    
    pub autorename: bool,
    
    pub force_async: bool,
}
impl CreateFolderBatchArg {
    pub fn new(paths: Vec<WritePath>) -> Self {
        CreateFolderBatchArg {
            paths,
            autorename: false,
            force_async: false,
        }
    }
    pub fn with_autorename(mut self, value: bool) -> Self {
        self.autorename = value;
        self
    }
    pub fn with_force_async(mut self, value: bool) -> Self {
        self.force_async = value;
        self
    }
}
const CREATE_FOLDER_BATCH_ARG_FIELDS: &[&str] = &["paths",
                                                  "autorename",
                                                  "force_async"];
impl CreateFolderBatchArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<CreateFolderBatchArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<CreateFolderBatchArg>, V::Error> {
        let mut field_paths = None;
        let mut field_autorename = None;
        let mut field_force_async = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "paths" => {
                    if field_paths.is_some() {
                        return Err(::serde::de::Error::duplicate_field("paths"));
                    }
                    field_paths = Some(map.next_value()?);
                }
                "autorename" => {
                    if field_autorename.is_some() {
                        return Err(::serde::de::Error::duplicate_field("autorename"));
                    }
                    field_autorename = Some(map.next_value()?);
                }
                "force_async" => {
                    if field_force_async.is_some() {
                        return Err(::serde::de::Error::duplicate_field("force_async"));
                    }
                    field_force_async = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = CreateFolderBatchArg {
            paths: field_paths.ok_or_else(|| ::serde::de::Error::missing_field("paths"))?,
            autorename: field_autorename.unwrap_or(false),
            force_async: field_force_async.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("paths", &self.paths)?;
        s.serialize_field("autorename", &self.autorename)?;
        s.serialize_field("force_async", &self.force_async)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderBatchArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = CreateFolderBatchArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderBatchArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                CreateFolderBatchArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("CreateFolderBatchArg", CREATE_FOLDER_BATCH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderBatchArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("CreateFolderBatchArg", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum CreateFolderBatchError {
    
    TooManyFiles,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderBatchError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = CreateFolderBatchError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderBatchError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "too_many_files" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(CreateFolderBatchError::TooManyFiles)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(CreateFolderBatchError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["too_many_files",
                                    "other"];
        deserializer.deserialize_struct("CreateFolderBatchError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderBatchError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            CreateFolderBatchError::TooManyFiles => {
                
                let mut s = serializer.serialize_struct("CreateFolderBatchError", 1)?;
                s.serialize_field(".tag", "too_many_files")?;
                s.end()
            }
            CreateFolderBatchError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for CreateFolderBatchError {
    fn description(&self) -> &str {
        "CreateFolderBatchError"
    }
}
impl ::std::fmt::Display for CreateFolderBatchError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum CreateFolderBatchJobStatus {
    
    InProgress,
    
    Complete(CreateFolderBatchResult),
    
    Failed(CreateFolderBatchError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderBatchJobStatus {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = CreateFolderBatchJobStatus;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderBatchJobStatus structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "in_progress" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(CreateFolderBatchJobStatus::InProgress)
                    }
                    "complete" => Ok(CreateFolderBatchJobStatus::Complete(CreateFolderBatchResult::internal_deserialize(map)?)),
                    "failed" => {
                        match map.next_key()? {
                            Some("failed") => Ok(CreateFolderBatchJobStatus::Failed(map.next_value()?)),
                            None => Err(de::Error::missing_field("failed")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(CreateFolderBatchJobStatus::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["in_progress",
                                    "complete",
                                    "failed",
                                    "other"];
        deserializer.deserialize_struct("CreateFolderBatchJobStatus", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderBatchJobStatus {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            CreateFolderBatchJobStatus::InProgress => {
                
                let mut s = serializer.serialize_struct("CreateFolderBatchJobStatus", 1)?;
                s.serialize_field(".tag", "in_progress")?;
                s.end()
            }
            CreateFolderBatchJobStatus::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("CreateFolderBatchJobStatus", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            CreateFolderBatchJobStatus::Failed(ref x) => {
                
                let mut s = serializer.serialize_struct("CreateFolderBatchJobStatus", 2)?;
                s.serialize_field(".tag", "failed")?;
                s.serialize_field("failed", x)?;
                s.end()
            }
            CreateFolderBatchJobStatus::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum CreateFolderBatchLaunch {
    
    
    AsyncJobId(super::dbx_async::AsyncJobId),
    Complete(CreateFolderBatchResult),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderBatchLaunch {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = CreateFolderBatchLaunch;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderBatchLaunch structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "async_job_id" => {
                        match map.next_key()? {
                            Some("async_job_id") => Ok(CreateFolderBatchLaunch::AsyncJobId(map.next_value()?)),
                            None => Err(de::Error::missing_field("async_job_id")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "complete" => Ok(CreateFolderBatchLaunch::Complete(CreateFolderBatchResult::internal_deserialize(map)?)),
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(CreateFolderBatchLaunch::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["async_job_id",
                                    "complete",
                                    "other"];
        deserializer.deserialize_struct("CreateFolderBatchLaunch", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderBatchLaunch {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            CreateFolderBatchLaunch::AsyncJobId(ref x) => {
                
                let mut s = serializer.serialize_struct("CreateFolderBatchLaunch", 2)?;
                s.serialize_field(".tag", "async_job_id")?;
                s.serialize_field("async_job_id", x)?;
                s.end()
            }
            CreateFolderBatchLaunch::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("CreateFolderBatchLaunch", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            CreateFolderBatchLaunch::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct CreateFolderBatchResult {
    
    
    pub entries: Vec<CreateFolderBatchResultEntry>,
}
impl CreateFolderBatchResult {
    pub fn new(entries: Vec<CreateFolderBatchResultEntry>) -> Self {
        CreateFolderBatchResult {
            entries,
        }
    }
}
const CREATE_FOLDER_BATCH_RESULT_FIELDS: &[&str] = &["entries"];
impl CreateFolderBatchResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<CreateFolderBatchResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<CreateFolderBatchResult>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = CreateFolderBatchResult {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderBatchResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = CreateFolderBatchResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderBatchResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                CreateFolderBatchResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("CreateFolderBatchResult", CREATE_FOLDER_BATCH_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderBatchResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("CreateFolderBatchResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum CreateFolderBatchResultEntry {
    Success(CreateFolderEntryResult),
    Failure(CreateFolderEntryError),
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderBatchResultEntry {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = CreateFolderBatchResultEntry;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderBatchResultEntry structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "success" => Ok(CreateFolderBatchResultEntry::Success(CreateFolderEntryResult::internal_deserialize(map)?)),
                    "failure" => {
                        match map.next_key()? {
                            Some("failure") => Ok(CreateFolderBatchResultEntry::Failure(map.next_value()?)),
                            None => Err(de::Error::missing_field("failure")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["success",
                                    "failure"];
        deserializer.deserialize_struct("CreateFolderBatchResultEntry", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderBatchResultEntry {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            CreateFolderBatchResultEntry::Success(ref x) => {
                
                let mut s = serializer.serialize_struct("CreateFolderBatchResultEntry", 2)?;
                s.serialize_field(".tag", "success")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            CreateFolderBatchResultEntry::Failure(ref x) => {
                
                let mut s = serializer.serialize_struct("CreateFolderBatchResultEntry", 2)?;
                s.serialize_field(".tag", "failure")?;
                s.serialize_field("failure", x)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum CreateFolderEntryError {
    Path(WriteError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderEntryError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = CreateFolderEntryError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderEntryError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(CreateFolderEntryError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(CreateFolderEntryError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "other"];
        deserializer.deserialize_struct("CreateFolderEntryError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderEntryError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            CreateFolderEntryError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("CreateFolderEntryError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            CreateFolderEntryError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for CreateFolderEntryError {
    fn description(&self) -> &str {
        "CreateFolderEntryError"
    }
}
impl ::std::fmt::Display for CreateFolderEntryError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct CreateFolderEntryResult {
    
    pub metadata: FolderMetadata,
}
impl CreateFolderEntryResult {
    pub fn new(metadata: FolderMetadata) -> Self {
        CreateFolderEntryResult {
            metadata,
        }
    }
}
const CREATE_FOLDER_ENTRY_RESULT_FIELDS: &[&str] = &["metadata"];
impl CreateFolderEntryResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<CreateFolderEntryResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<CreateFolderEntryResult>, V::Error> {
        let mut field_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = CreateFolderEntryResult {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderEntryResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = CreateFolderEntryResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderEntryResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                CreateFolderEntryResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("CreateFolderEntryResult", CREATE_FOLDER_ENTRY_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderEntryResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("CreateFolderEntryResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum CreateFolderError {
    Path(WriteError),
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = CreateFolderError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(CreateFolderError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["path"];
        deserializer.deserialize_struct("CreateFolderError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            CreateFolderError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("CreateFolderError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
        }
    }
}
impl ::std::error::Error for CreateFolderError {
    fn description(&self) -> &str {
        "CreateFolderError"
    }
}
impl ::std::fmt::Display for CreateFolderError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct CreateFolderResult {
    
    pub metadata: FolderMetadata,
}
impl CreateFolderResult {
    pub fn new(metadata: FolderMetadata) -> Self {
        CreateFolderResult {
            metadata,
        }
    }
}
const CREATE_FOLDER_RESULT_FIELDS: &[&str] = &["metadata"];
impl CreateFolderResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<CreateFolderResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<CreateFolderResult>, V::Error> {
        let mut field_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = CreateFolderResult {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for CreateFolderResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = CreateFolderResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a CreateFolderResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                CreateFolderResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("CreateFolderResult", CREATE_FOLDER_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for CreateFolderResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("CreateFolderResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct DeleteArg {
    
    pub path: WritePathOrId,
    
    
    pub parent_rev: Option<Rev>,
}
impl DeleteArg {
    pub fn new(path: WritePathOrId) -> Self {
        DeleteArg {
            path,
            parent_rev: None,
        }
    }
    pub fn with_parent_rev(mut self, value: Rev) -> Self {
        self.parent_rev = Some(value);
        self
    }
}
const DELETE_ARG_FIELDS: &[&str] = &["path",
                                     "parent_rev"];
impl DeleteArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<DeleteArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<DeleteArg>, V::Error> {
        let mut field_path = None;
        let mut field_parent_rev = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "parent_rev" => {
                    if field_parent_rev.is_some() {
                        return Err(::serde::de::Error::duplicate_field("parent_rev"));
                    }
                    field_parent_rev = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = DeleteArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            parent_rev: field_parent_rev,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("parent_rev", &self.parent_rev)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = DeleteArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                DeleteArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("DeleteArg", DELETE_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("DeleteArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct DeleteBatchArg {
    pub entries: Vec<DeleteArg>,
}
impl DeleteBatchArg {
    pub fn new(entries: Vec<DeleteArg>) -> Self {
        DeleteBatchArg {
            entries,
        }
    }
}
const DELETE_BATCH_ARG_FIELDS: &[&str] = &["entries"];
impl DeleteBatchArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<DeleteBatchArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<DeleteBatchArg>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = DeleteBatchArg {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteBatchArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = DeleteBatchArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteBatchArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                DeleteBatchArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("DeleteBatchArg", DELETE_BATCH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteBatchArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("DeleteBatchArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum DeleteBatchError {
    
    
    
    TooManyWriteOperations,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteBatchError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = DeleteBatchError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteBatchError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "too_many_write_operations" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DeleteBatchError::TooManyWriteOperations)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DeleteBatchError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["too_many_write_operations",
                                    "other"];
        deserializer.deserialize_struct("DeleteBatchError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteBatchError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            DeleteBatchError::TooManyWriteOperations => {
                
                let mut s = serializer.serialize_struct("DeleteBatchError", 1)?;
                s.serialize_field(".tag", "too_many_write_operations")?;
                s.end()
            }
            DeleteBatchError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for DeleteBatchError {
    fn description(&self) -> &str {
        "DeleteBatchError"
    }
}
impl ::std::fmt::Display for DeleteBatchError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum DeleteBatchJobStatus {
    
    InProgress,
    
    Complete(DeleteBatchResult),
    
    Failed(DeleteBatchError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteBatchJobStatus {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = DeleteBatchJobStatus;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteBatchJobStatus structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "in_progress" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DeleteBatchJobStatus::InProgress)
                    }
                    "complete" => Ok(DeleteBatchJobStatus::Complete(DeleteBatchResult::internal_deserialize(map)?)),
                    "failed" => {
                        match map.next_key()? {
                            Some("failed") => Ok(DeleteBatchJobStatus::Failed(map.next_value()?)),
                            None => Err(de::Error::missing_field("failed")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DeleteBatchJobStatus::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["in_progress",
                                    "complete",
                                    "failed",
                                    "other"];
        deserializer.deserialize_struct("DeleteBatchJobStatus", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteBatchJobStatus {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            DeleteBatchJobStatus::InProgress => {
                
                let mut s = serializer.serialize_struct("DeleteBatchJobStatus", 1)?;
                s.serialize_field(".tag", "in_progress")?;
                s.end()
            }
            DeleteBatchJobStatus::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("DeleteBatchJobStatus", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            DeleteBatchJobStatus::Failed(ref x) => {
                
                let mut s = serializer.serialize_struct("DeleteBatchJobStatus", 2)?;
                s.serialize_field(".tag", "failed")?;
                s.serialize_field("failed", x)?;
                s.end()
            }
            DeleteBatchJobStatus::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum DeleteBatchLaunch {
    
    
    AsyncJobId(super::dbx_async::AsyncJobId),
    Complete(DeleteBatchResult),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteBatchLaunch {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = DeleteBatchLaunch;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteBatchLaunch structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "async_job_id" => {
                        match map.next_key()? {
                            Some("async_job_id") => Ok(DeleteBatchLaunch::AsyncJobId(map.next_value()?)),
                            None => Err(de::Error::missing_field("async_job_id")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "complete" => Ok(DeleteBatchLaunch::Complete(DeleteBatchResult::internal_deserialize(map)?)),
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DeleteBatchLaunch::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["async_job_id",
                                    "complete",
                                    "other"];
        deserializer.deserialize_struct("DeleteBatchLaunch", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteBatchLaunch {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            DeleteBatchLaunch::AsyncJobId(ref x) => {
                
                let mut s = serializer.serialize_struct("DeleteBatchLaunch", 2)?;
                s.serialize_field(".tag", "async_job_id")?;
                s.serialize_field("async_job_id", x)?;
                s.end()
            }
            DeleteBatchLaunch::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("DeleteBatchLaunch", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            DeleteBatchLaunch::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct DeleteBatchResult {
    
    
    pub entries: Vec<DeleteBatchResultEntry>,
}
impl DeleteBatchResult {
    pub fn new(entries: Vec<DeleteBatchResultEntry>) -> Self {
        DeleteBatchResult {
            entries,
        }
    }
}
const DELETE_BATCH_RESULT_FIELDS: &[&str] = &["entries"];
impl DeleteBatchResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<DeleteBatchResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<DeleteBatchResult>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = DeleteBatchResult {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteBatchResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = DeleteBatchResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteBatchResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                DeleteBatchResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("DeleteBatchResult", DELETE_BATCH_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteBatchResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("DeleteBatchResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct DeleteBatchResultData {
    
    pub metadata: Metadata,
}
impl DeleteBatchResultData {
    pub fn new(metadata: Metadata) -> Self {
        DeleteBatchResultData {
            metadata,
        }
    }
}
const DELETE_BATCH_RESULT_DATA_FIELDS: &[&str] = &["metadata"];
impl DeleteBatchResultData {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<DeleteBatchResultData, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<DeleteBatchResultData>, V::Error> {
        let mut field_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = DeleteBatchResultData {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteBatchResultData {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = DeleteBatchResultData;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteBatchResultData struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                DeleteBatchResultData::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("DeleteBatchResultData", DELETE_BATCH_RESULT_DATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteBatchResultData {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("DeleteBatchResultData", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum DeleteBatchResultEntry {
    Success(DeleteBatchResultData),
    Failure(DeleteError),
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteBatchResultEntry {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = DeleteBatchResultEntry;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteBatchResultEntry structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "success" => Ok(DeleteBatchResultEntry::Success(DeleteBatchResultData::internal_deserialize(map)?)),
                    "failure" => {
                        match map.next_key()? {
                            Some("failure") => Ok(DeleteBatchResultEntry::Failure(map.next_value()?)),
                            None => Err(de::Error::missing_field("failure")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["success",
                                    "failure"];
        deserializer.deserialize_struct("DeleteBatchResultEntry", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteBatchResultEntry {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            DeleteBatchResultEntry::Success(ref x) => {
                
                let mut s = serializer.serialize_struct("DeleteBatchResultEntry", 2)?;
                s.serialize_field(".tag", "success")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            DeleteBatchResultEntry::Failure(ref x) => {
                
                let mut s = serializer.serialize_struct("DeleteBatchResultEntry", 2)?;
                s.serialize_field(".tag", "failure")?;
                s.serialize_field("failure", x)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum DeleteError {
    PathLookup(LookupError),
    PathWrite(WriteError),
    
    TooManyWriteOperations,
    
    TooManyFiles,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = DeleteError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path_lookup" => {
                        match map.next_key()? {
                            Some("path_lookup") => Ok(DeleteError::PathLookup(map.next_value()?)),
                            None => Err(de::Error::missing_field("path_lookup")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "path_write" => {
                        match map.next_key()? {
                            Some("path_write") => Ok(DeleteError::PathWrite(map.next_value()?)),
                            None => Err(de::Error::missing_field("path_write")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "too_many_write_operations" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DeleteError::TooManyWriteOperations)
                    }
                    "too_many_files" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DeleteError::TooManyFiles)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DeleteError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path_lookup",
                                    "path_write",
                                    "too_many_write_operations",
                                    "too_many_files",
                                    "other"];
        deserializer.deserialize_struct("DeleteError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            DeleteError::PathLookup(ref x) => {
                
                let mut s = serializer.serialize_struct("DeleteError", 2)?;
                s.serialize_field(".tag", "path_lookup")?;
                s.serialize_field("path_lookup", x)?;
                s.end()
            }
            DeleteError::PathWrite(ref x) => {
                
                let mut s = serializer.serialize_struct("DeleteError", 2)?;
                s.serialize_field(".tag", "path_write")?;
                s.serialize_field("path_write", x)?;
                s.end()
            }
            DeleteError::TooManyWriteOperations => {
                
                let mut s = serializer.serialize_struct("DeleteError", 1)?;
                s.serialize_field(".tag", "too_many_write_operations")?;
                s.end()
            }
            DeleteError::TooManyFiles => {
                
                let mut s = serializer.serialize_struct("DeleteError", 1)?;
                s.serialize_field(".tag", "too_many_files")?;
                s.end()
            }
            DeleteError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for DeleteError {
    fn description(&self) -> &str {
        "DeleteError"
    }
}
impl ::std::fmt::Display for DeleteError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct DeleteResult {
    
    pub metadata: Metadata,
}
impl DeleteResult {
    pub fn new(metadata: Metadata) -> Self {
        DeleteResult {
            metadata,
        }
    }
}
const DELETE_RESULT_FIELDS: &[&str] = &["metadata"];
impl DeleteResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<DeleteResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<DeleteResult>, V::Error> {
        let mut field_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = DeleteResult {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for DeleteResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = DeleteResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeleteResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                DeleteResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("DeleteResult", DELETE_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for DeleteResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("DeleteResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct DeletedMetadata {
    
    pub name: String,
    
    
    pub path_lower: Option<String>,
    
    
    
    
    
    
    pub path_display: Option<String>,
    
    
    pub parent_shared_folder_id: Option<super::common::SharedFolderId>,
}
impl DeletedMetadata {
    pub fn new(name: String) -> Self {
        DeletedMetadata {
            name,
            path_lower: None,
            path_display: None,
            parent_shared_folder_id: None,
        }
    }
    pub fn with_path_lower(mut self, value: String) -> Self {
        self.path_lower = Some(value);
        self
    }
    pub fn with_path_display(mut self, value: String) -> Self {
        self.path_display = Some(value);
        self
    }
    pub fn with_parent_shared_folder_id(mut self, value: super::common::SharedFolderId) -> Self {
        self.parent_shared_folder_id = Some(value);
        self
    }
}
const DELETED_METADATA_FIELDS: &[&str] = &["name",
                                           "path_lower",
                                           "path_display",
                                           "parent_shared_folder_id"];
impl DeletedMetadata {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<DeletedMetadata, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<DeletedMetadata>, V::Error> {
        let mut field_name = None;
        let mut field_path_lower = None;
        let mut field_path_display = None;
        let mut field_parent_shared_folder_id = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "name" => {
                    if field_name.is_some() {
                        return Err(::serde::de::Error::duplicate_field("name"));
                    }
                    field_name = Some(map.next_value()?);
                }
                "path_lower" => {
                    if field_path_lower.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path_lower"));
                    }
                    field_path_lower = Some(map.next_value()?);
                }
                "path_display" => {
                    if field_path_display.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path_display"));
                    }
                    field_path_display = Some(map.next_value()?);
                }
                "parent_shared_folder_id" => {
                    if field_parent_shared_folder_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("parent_shared_folder_id"));
                    }
                    field_parent_shared_folder_id = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = DeletedMetadata {
            name: field_name.ok_or_else(|| ::serde::de::Error::missing_field("name"))?,
            path_lower: field_path_lower,
            path_display: field_path_display,
            parent_shared_folder_id: field_parent_shared_folder_id,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("name", &self.name)?;
        s.serialize_field("path_lower", &self.path_lower)?;
        s.serialize_field("path_display", &self.path_display)?;
        s.serialize_field("parent_shared_folder_id", &self.parent_shared_folder_id)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for DeletedMetadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = DeletedMetadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DeletedMetadata struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                DeletedMetadata::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("DeletedMetadata", DELETED_METADATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for DeletedMetadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("DeletedMetadata", 4)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct Dimensions {
    
    pub height: u64,
    
    pub width: u64,
}
impl Dimensions {
    pub fn new(height: u64, width: u64) -> Self {
        Dimensions {
            height,
            width,
        }
    }
}
const DIMENSIONS_FIELDS: &[&str] = &["height",
                                     "width"];
impl Dimensions {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<Dimensions, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<Dimensions>, V::Error> {
        let mut field_height = None;
        let mut field_width = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "height" => {
                    if field_height.is_some() {
                        return Err(::serde::de::Error::duplicate_field("height"));
                    }
                    field_height = Some(map.next_value()?);
                }
                "width" => {
                    if field_width.is_some() {
                        return Err(::serde::de::Error::duplicate_field("width"));
                    }
                    field_width = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = Dimensions {
            height: field_height.ok_or_else(|| ::serde::de::Error::missing_field("height"))?,
            width: field_width.ok_or_else(|| ::serde::de::Error::missing_field("width"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("height", &self.height)?;
        s.serialize_field("width", &self.width)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for Dimensions {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = Dimensions;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a Dimensions struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                Dimensions::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("Dimensions", DIMENSIONS_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for Dimensions {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("Dimensions", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct DownloadArg {
    
    pub path: ReadPath,
    
    pub rev: Option<Rev>,
}
impl DownloadArg {
    pub fn new(path: ReadPath) -> Self {
        DownloadArg {
            path,
            rev: None,
        }
    }
    pub fn with_rev(mut self, value: Rev) -> Self {
        self.rev = Some(value);
        self
    }
}
const DOWNLOAD_ARG_FIELDS: &[&str] = &["path",
                                       "rev"];
impl DownloadArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<DownloadArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<DownloadArg>, V::Error> {
        let mut field_path = None;
        let mut field_rev = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "rev" => {
                    if field_rev.is_some() {
                        return Err(::serde::de::Error::duplicate_field("rev"));
                    }
                    field_rev = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = DownloadArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            rev: field_rev,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("rev", &self.rev)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for DownloadArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = DownloadArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DownloadArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                DownloadArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("DownloadArg", DOWNLOAD_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for DownloadArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("DownloadArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum DownloadError {
    Path(LookupError),
    
    UnsupportedFile,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for DownloadError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = DownloadError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DownloadError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(DownloadError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "unsupported_file" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DownloadError::UnsupportedFile)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DownloadError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "unsupported_file",
                                    "other"];
        deserializer.deserialize_struct("DownloadError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for DownloadError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            DownloadError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("DownloadError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            DownloadError::UnsupportedFile => {
                
                let mut s = serializer.serialize_struct("DownloadError", 1)?;
                s.serialize_field(".tag", "unsupported_file")?;
                s.end()
            }
            DownloadError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for DownloadError {
    fn description(&self) -> &str {
        "DownloadError"
    }
}
impl ::std::fmt::Display for DownloadError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct DownloadZipArg {
    
    pub path: ReadPath,
}
impl DownloadZipArg {
    pub fn new(path: ReadPath) -> Self {
        DownloadZipArg {
            path,
        }
    }
}
const DOWNLOAD_ZIP_ARG_FIELDS: &[&str] = &["path"];
impl DownloadZipArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<DownloadZipArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<DownloadZipArg>, V::Error> {
        let mut field_path = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = DownloadZipArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for DownloadZipArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = DownloadZipArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DownloadZipArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                DownloadZipArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("DownloadZipArg", DOWNLOAD_ZIP_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for DownloadZipArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("DownloadZipArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum DownloadZipError {
    Path(LookupError),
    
    TooLarge,
    
    TooManyFiles,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for DownloadZipError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = DownloadZipError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DownloadZipError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(DownloadZipError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "too_large" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DownloadZipError::TooLarge)
                    }
                    "too_many_files" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DownloadZipError::TooManyFiles)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(DownloadZipError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "too_large",
                                    "too_many_files",
                                    "other"];
        deserializer.deserialize_struct("DownloadZipError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for DownloadZipError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            DownloadZipError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("DownloadZipError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            DownloadZipError::TooLarge => {
                
                let mut s = serializer.serialize_struct("DownloadZipError", 1)?;
                s.serialize_field(".tag", "too_large")?;
                s.end()
            }
            DownloadZipError::TooManyFiles => {
                
                let mut s = serializer.serialize_struct("DownloadZipError", 1)?;
                s.serialize_field(".tag", "too_many_files")?;
                s.end()
            }
            DownloadZipError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for DownloadZipError {
    fn description(&self) -> &str {
        "DownloadZipError"
    }
}
impl ::std::fmt::Display for DownloadZipError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct DownloadZipResult {
    pub metadata: FolderMetadata,
}
impl DownloadZipResult {
    pub fn new(metadata: FolderMetadata) -> Self {
        DownloadZipResult {
            metadata,
        }
    }
}
const DOWNLOAD_ZIP_RESULT_FIELDS: &[&str] = &["metadata"];
impl DownloadZipResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<DownloadZipResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<DownloadZipResult>, V::Error> {
        let mut field_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = DownloadZipResult {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for DownloadZipResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = DownloadZipResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a DownloadZipResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                DownloadZipResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("DownloadZipResult", DOWNLOAD_ZIP_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for DownloadZipResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("DownloadZipResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ExportArg {
    
    pub path: ReadPath,
}
impl ExportArg {
    pub fn new(path: ReadPath) -> Self {
        ExportArg {
            path,
        }
    }
}
const EXPORT_ARG_FIELDS: &[&str] = &["path"];
impl ExportArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ExportArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ExportArg>, V::Error> {
        let mut field_path = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ExportArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ExportArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ExportArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ExportArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ExportArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ExportArg", EXPORT_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ExportArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ExportArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum ExportError {
    Path(LookupError),
    
    NonExportable,
    
    RetryError,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for ExportError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ExportError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ExportError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(ExportError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "non_exportable" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ExportError::NonExportable)
                    }
                    "retry_error" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ExportError::RetryError)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ExportError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "non_exportable",
                                    "retry_error",
                                    "other"];
        deserializer.deserialize_struct("ExportError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ExportError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ExportError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("ExportError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            ExportError::NonExportable => {
                
                let mut s = serializer.serialize_struct("ExportError", 1)?;
                s.serialize_field(".tag", "non_exportable")?;
                s.end()
            }
            ExportError::RetryError => {
                
                let mut s = serializer.serialize_struct("ExportError", 1)?;
                s.serialize_field(".tag", "retry_error")?;
                s.end()
            }
            ExportError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for ExportError {
    fn description(&self) -> &str {
        "ExportError"
    }
}
impl ::std::fmt::Display for ExportError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ExportInfo {
    
    pub export_as: Option<String>,
}
impl Default for ExportInfo {
    fn default() -> Self {
        ExportInfo {
            export_as: None,
        }
    }
}
impl ExportInfo {
    pub fn with_export_as(mut self, value: String) -> Self {
        self.export_as = Some(value);
        self
    }
}
const EXPORT_INFO_FIELDS: &[&str] = &["export_as"];
impl ExportInfo {
    
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
    ) -> Result<ExportInfo, V::Error> {
        let mut field_export_as = None;
        while let Some(key) = map.next_key::<&str>()? {
            match key {
                "export_as" => {
                    if field_export_as.is_some() {
                        return Err(::serde::de::Error::duplicate_field("export_as"));
                    }
                    field_export_as = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        let result = ExportInfo {
            export_as: field_export_as,
        };
        Ok(result)
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("export_as", &self.export_as)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ExportInfo {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ExportInfo;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ExportInfo struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ExportInfo::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ExportInfo", EXPORT_INFO_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ExportInfo {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ExportInfo", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ExportMetadata {
    
    pub name: String,
    
    pub size: u64,
    
    
    
    pub export_hash: Option<Sha256HexHash>,
}
impl ExportMetadata {
    pub fn new(name: String, size: u64) -> Self {
        ExportMetadata {
            name,
            size,
            export_hash: None,
        }
    }
    pub fn with_export_hash(mut self, value: Sha256HexHash) -> Self {
        self.export_hash = Some(value);
        self
    }
}
const EXPORT_METADATA_FIELDS: &[&str] = &["name",
                                          "size",
                                          "export_hash"];
impl ExportMetadata {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ExportMetadata, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ExportMetadata>, V::Error> {
        let mut field_name = None;
        let mut field_size = None;
        let mut field_export_hash = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "name" => {
                    if field_name.is_some() {
                        return Err(::serde::de::Error::duplicate_field("name"));
                    }
                    field_name = Some(map.next_value()?);
                }
                "size" => {
                    if field_size.is_some() {
                        return Err(::serde::de::Error::duplicate_field("size"));
                    }
                    field_size = Some(map.next_value()?);
                }
                "export_hash" => {
                    if field_export_hash.is_some() {
                        return Err(::serde::de::Error::duplicate_field("export_hash"));
                    }
                    field_export_hash = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ExportMetadata {
            name: field_name.ok_or_else(|| ::serde::de::Error::missing_field("name"))?,
            size: field_size.ok_or_else(|| ::serde::de::Error::missing_field("size"))?,
            export_hash: field_export_hash,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("name", &self.name)?;
        s.serialize_field("size", &self.size)?;
        s.serialize_field("export_hash", &self.export_hash)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ExportMetadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ExportMetadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ExportMetadata struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ExportMetadata::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ExportMetadata", EXPORT_METADATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ExportMetadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ExportMetadata", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ExportResult {
    
    pub export_metadata: ExportMetadata,
    
    pub file_metadata: FileMetadata,
}
impl ExportResult {
    pub fn new(export_metadata: ExportMetadata, file_metadata: FileMetadata) -> Self {
        ExportResult {
            export_metadata,
            file_metadata,
        }
    }
}
const EXPORT_RESULT_FIELDS: &[&str] = &["export_metadata",
                                        "file_metadata"];
impl ExportResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ExportResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ExportResult>, V::Error> {
        let mut field_export_metadata = None;
        let mut field_file_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "export_metadata" => {
                    if field_export_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("export_metadata"));
                    }
                    field_export_metadata = Some(map.next_value()?);
                }
                "file_metadata" => {
                    if field_file_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("file_metadata"));
                    }
                    field_file_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ExportResult {
            export_metadata: field_export_metadata.ok_or_else(|| ::serde::de::Error::missing_field("export_metadata"))?,
            file_metadata: field_file_metadata.ok_or_else(|| ::serde::de::Error::missing_field("file_metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("export_metadata", &self.export_metadata)?;
        s.serialize_field("file_metadata", &self.file_metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ExportResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ExportResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ExportResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ExportResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ExportResult", EXPORT_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ExportResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ExportResult", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum FileCategory {
    
    Image,
    
    Document,
    
    Pdf,
    
    Spreadsheet,
    
    Presentation,
    
    Audio,
    
    Video,
    
    Folder,
    
    Paper,
    
    Others,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for FileCategory {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = FileCategory;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FileCategory structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "image" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Image)
                    }
                    "document" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Document)
                    }
                    "pdf" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Pdf)
                    }
                    "spreadsheet" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Spreadsheet)
                    }
                    "presentation" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Presentation)
                    }
                    "audio" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Audio)
                    }
                    "video" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Video)
                    }
                    "folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Folder)
                    }
                    "paper" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Paper)
                    }
                    "others" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Others)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileCategory::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["image",
                                    "document",
                                    "pdf",
                                    "spreadsheet",
                                    "presentation",
                                    "audio",
                                    "video",
                                    "folder",
                                    "paper",
                                    "others",
                                    "other"];
        deserializer.deserialize_struct("FileCategory", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for FileCategory {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            FileCategory::Image => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "image")?;
                s.end()
            }
            FileCategory::Document => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "document")?;
                s.end()
            }
            FileCategory::Pdf => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "pdf")?;
                s.end()
            }
            FileCategory::Spreadsheet => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "spreadsheet")?;
                s.end()
            }
            FileCategory::Presentation => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "presentation")?;
                s.end()
            }
            FileCategory::Audio => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "audio")?;
                s.end()
            }
            FileCategory::Video => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "video")?;
                s.end()
            }
            FileCategory::Folder => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "folder")?;
                s.end()
            }
            FileCategory::Paper => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "paper")?;
                s.end()
            }
            FileCategory::Others => {
                
                let mut s = serializer.serialize_struct("FileCategory", 1)?;
                s.serialize_field(".tag", "others")?;
                s.end()
            }
            FileCategory::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct FileLock {
    
    pub content: FileLockContent,
}
impl FileLock {
    pub fn new(content: FileLockContent) -> Self {
        FileLock {
            content,
        }
    }
}
const FILE_LOCK_FIELDS: &[&str] = &["content"];
impl FileLock {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<FileLock, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<FileLock>, V::Error> {
        let mut field_content = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "content" => {
                    if field_content.is_some() {
                        return Err(::serde::de::Error::duplicate_field("content"));
                    }
                    field_content = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = FileLock {
            content: field_content.ok_or_else(|| ::serde::de::Error::missing_field("content"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("content", &self.content)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for FileLock {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = FileLock;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FileLock struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                FileLock::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("FileLock", FILE_LOCK_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for FileLock {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("FileLock", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum FileLockContent {
    
    Unlocked,
    
    SingleUser(SingleUserLock),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for FileLockContent {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = FileLockContent;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FileLockContent structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "unlocked" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileLockContent::Unlocked)
                    }
                    "single_user" => Ok(FileLockContent::SingleUser(SingleUserLock::internal_deserialize(map)?)),
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileLockContent::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["unlocked",
                                    "single_user",
                                    "other"];
        deserializer.deserialize_struct("FileLockContent", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for FileLockContent {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            FileLockContent::Unlocked => {
                
                let mut s = serializer.serialize_struct("FileLockContent", 1)?;
                s.serialize_field(".tag", "unlocked")?;
                s.end()
            }
            FileLockContent::SingleUser(ref x) => {
                
                let mut s = serializer.serialize_struct("FileLockContent", 4)?;
                s.serialize_field(".tag", "single_user")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            FileLockContent::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct FileLockMetadata {
    
    pub is_lockholder: Option<bool>,
    
    pub lockholder_name: Option<String>,
    
    pub lockholder_account_id: Option<super::users_common::AccountId>,
    
    pub created: Option<super::common::DropboxTimestamp>,
}
impl Default for FileLockMetadata {
    fn default() -> Self {
        FileLockMetadata {
            is_lockholder: None,
            lockholder_name: None,
            lockholder_account_id: None,
            created: None,
        }
    }
}
impl FileLockMetadata {
    pub fn with_is_lockholder(mut self, value: bool) -> Self {
        self.is_lockholder = Some(value);
        self
    }
    pub fn with_lockholder_name(mut self, value: String) -> Self {
        self.lockholder_name = Some(value);
        self
    }
    pub fn with_lockholder_account_id(mut self, value: super::users_common::AccountId) -> Self {
        self.lockholder_account_id = Some(value);
        self
    }
    pub fn with_created(mut self, value: super::common::DropboxTimestamp) -> Self {
        self.created = Some(value);
        self
    }
}
const FILE_LOCK_METADATA_FIELDS: &[&str] = &["is_lockholder",
                                             "lockholder_name",
                                             "lockholder_account_id",
                                             "created"];
impl FileLockMetadata {
    
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
    ) -> Result<FileLockMetadata, V::Error> {
        let mut field_is_lockholder = None;
        let mut field_lockholder_name = None;
        let mut field_lockholder_account_id = None;
        let mut field_created = None;
        while let Some(key) = map.next_key::<&str>()? {
            match key {
                "is_lockholder" => {
                    if field_is_lockholder.is_some() {
                        return Err(::serde::de::Error::duplicate_field("is_lockholder"));
                    }
                    field_is_lockholder = Some(map.next_value()?);
                }
                "lockholder_name" => {
                    if field_lockholder_name.is_some() {
                        return Err(::serde::de::Error::duplicate_field("lockholder_name"));
                    }
                    field_lockholder_name = Some(map.next_value()?);
                }
                "lockholder_account_id" => {
                    if field_lockholder_account_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("lockholder_account_id"));
                    }
                    field_lockholder_account_id = Some(map.next_value()?);
                }
                "created" => {
                    if field_created.is_some() {
                        return Err(::serde::de::Error::duplicate_field("created"));
                    }
                    field_created = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        let result = FileLockMetadata {
            is_lockholder: field_is_lockholder,
            lockholder_name: field_lockholder_name,
            lockholder_account_id: field_lockholder_account_id,
            created: field_created,
        };
        Ok(result)
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("is_lockholder", &self.is_lockholder)?;
        s.serialize_field("lockholder_name", &self.lockholder_name)?;
        s.serialize_field("lockholder_account_id", &self.lockholder_account_id)?;
        s.serialize_field("created", &self.created)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for FileLockMetadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = FileLockMetadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FileLockMetadata struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                FileLockMetadata::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("FileLockMetadata", FILE_LOCK_METADATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for FileLockMetadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("FileLockMetadata", 4)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct FileMetadata {
    
    pub name: String,
    
    pub id: Id,
    
    
    
    
    pub client_modified: super::common::DropboxTimestamp,
    
    pub server_modified: super::common::DropboxTimestamp,
    
    
    pub rev: Rev,
    
    pub size: u64,
    
    
    pub path_lower: Option<String>,
    
    
    
    
    
    
    pub path_display: Option<String>,
    
    
    pub parent_shared_folder_id: Option<super::common::SharedFolderId>,
    
    
    
    
    pub media_info: Option<MediaInfo>,
    
    pub symlink_info: Option<SymlinkInfo>,
    
    pub sharing_info: Option<FileSharingInfo>,
    
    pub is_downloadable: bool,
    
    
    pub export_info: Option<ExportInfo>,
    
    
    pub property_groups: Option<Vec<super::file_properties::PropertyGroup>>,
    
    
    
    
    
    pub has_explicit_shared_members: Option<bool>,
    
    
    
    pub content_hash: Option<Sha256HexHash>,
    
    pub file_lock_info: Option<FileLockMetadata>,
}
impl FileMetadata {
    pub fn new(
        name: String,
        id: Id,
        client_modified: super::common::DropboxTimestamp,
        server_modified: super::common::DropboxTimestamp,
        rev: Rev,
        size: u64,
    ) -> Self {
        FileMetadata {
            name,
            id,
            client_modified,
            server_modified,
            rev,
            size,
            path_lower: None,
            path_display: None,
            parent_shared_folder_id: None,
            media_info: None,
            symlink_info: None,
            sharing_info: None,
            is_downloadable: true,
            export_info: None,
            property_groups: None,
            has_explicit_shared_members: None,
            content_hash: None,
            file_lock_info: None,
        }
    }
    pub fn with_path_lower(mut self, value: String) -> Self {
        self.path_lower = Some(value);
        self
    }
    pub fn with_path_display(mut self, value: String) -> Self {
        self.path_display = Some(value);
        self
    }
    pub fn with_parent_shared_folder_id(mut self, value: super::common::SharedFolderId) -> Self {
        self.parent_shared_folder_id = Some(value);
        self
    }
    pub fn with_media_info(mut self, value: MediaInfo) -> Self {
        self.media_info = Some(value);
        self
    }
    pub fn with_symlink_info(mut self, value: SymlinkInfo) -> Self {
        self.symlink_info = Some(value);
        self
    }
    pub fn with_sharing_info(mut self, value: FileSharingInfo) -> Self {
        self.sharing_info = Some(value);
        self
    }
    pub fn with_is_downloadable(mut self, value: bool) -> Self {
        self.is_downloadable = value;
        self
    }
    pub fn with_export_info(mut self, value: ExportInfo) -> Self {
        self.export_info = Some(value);
        self
    }
    pub fn with_property_groups(
        mut self,
        value: Vec<super::file_properties::PropertyGroup>,
    ) -> Self {
        self.property_groups = Some(value);
        self
    }
    pub fn with_has_explicit_shared_members(mut self, value: bool) -> Self {
        self.has_explicit_shared_members = Some(value);
        self
    }
    pub fn with_content_hash(mut self, value: Sha256HexHash) -> Self {
        self.content_hash = Some(value);
        self
    }
    pub fn with_file_lock_info(mut self, value: FileLockMetadata) -> Self {
        self.file_lock_info = Some(value);
        self
    }
}
const FILE_METADATA_FIELDS: &[&str] = &["name",
                                        "id",
                                        "client_modified",
                                        "server_modified",
                                        "rev",
                                        "size",
                                        "path_lower",
                                        "path_display",
                                        "parent_shared_folder_id",
                                        "media_info",
                                        "symlink_info",
                                        "sharing_info",
                                        "is_downloadable",
                                        "export_info",
                                        "property_groups",
                                        "has_explicit_shared_members",
                                        "content_hash",
                                        "file_lock_info"];
impl FileMetadata {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<FileMetadata, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<FileMetadata>, V::Error> {
        let mut field_name = None;
        let mut field_id = None;
        let mut field_client_modified = None;
        let mut field_server_modified = None;
        let mut field_rev = None;
        let mut field_size = None;
        let mut field_path_lower = None;
        let mut field_path_display = None;
        let mut field_parent_shared_folder_id = None;
        let mut field_media_info = None;
        let mut field_symlink_info = None;
        let mut field_sharing_info = None;
        let mut field_is_downloadable = None;
        let mut field_export_info = None;
        let mut field_property_groups = None;
        let mut field_has_explicit_shared_members = None;
        let mut field_content_hash = None;
        let mut field_file_lock_info = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "name" => {
                    if field_name.is_some() {
                        return Err(::serde::de::Error::duplicate_field("name"));
                    }
                    field_name = Some(map.next_value()?);
                }
                "id" => {
                    if field_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("id"));
                    }
                    field_id = Some(map.next_value()?);
                }
                "client_modified" => {
                    if field_client_modified.is_some() {
                        return Err(::serde::de::Error::duplicate_field("client_modified"));
                    }
                    field_client_modified = Some(map.next_value()?);
                }
                "server_modified" => {
                    if field_server_modified.is_some() {
                        return Err(::serde::de::Error::duplicate_field("server_modified"));
                    }
                    field_server_modified = Some(map.next_value()?);
                }
                "rev" => {
                    if field_rev.is_some() {
                        return Err(::serde::de::Error::duplicate_field("rev"));
                    }
                    field_rev = Some(map.next_value()?);
                }
                "size" => {
                    if field_size.is_some() {
                        return Err(::serde::de::Error::duplicate_field("size"));
                    }
                    field_size = Some(map.next_value()?);
                }
                "path_lower" => {
                    if field_path_lower.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path_lower"));
                    }
                    field_path_lower = Some(map.next_value()?);
                }
                "path_display" => {
                    if field_path_display.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path_display"));
                    }
                    field_path_display = Some(map.next_value()?);
                }
                "parent_shared_folder_id" => {
                    if field_parent_shared_folder_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("parent_shared_folder_id"));
                    }
                    field_parent_shared_folder_id = Some(map.next_value()?);
                }
                "media_info" => {
                    if field_media_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("media_info"));
                    }
                    field_media_info = Some(map.next_value()?);
                }
                "symlink_info" => {
                    if field_symlink_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("symlink_info"));
                    }
                    field_symlink_info = Some(map.next_value()?);
                }
                "sharing_info" => {
                    if field_sharing_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("sharing_info"));
                    }
                    field_sharing_info = Some(map.next_value()?);
                }
                "is_downloadable" => {
                    if field_is_downloadable.is_some() {
                        return Err(::serde::de::Error::duplicate_field("is_downloadable"));
                    }
                    field_is_downloadable = Some(map.next_value()?);
                }
                "export_info" => {
                    if field_export_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("export_info"));
                    }
                    field_export_info = Some(map.next_value()?);
                }
                "property_groups" => {
                    if field_property_groups.is_some() {
                        return Err(::serde::de::Error::duplicate_field("property_groups"));
                    }
                    field_property_groups = Some(map.next_value()?);
                }
                "has_explicit_shared_members" => {
                    if field_has_explicit_shared_members.is_some() {
                        return Err(::serde::de::Error::duplicate_field("has_explicit_shared_members"));
                    }
                    field_has_explicit_shared_members = Some(map.next_value()?);
                }
                "content_hash" => {
                    if field_content_hash.is_some() {
                        return Err(::serde::de::Error::duplicate_field("content_hash"));
                    }
                    field_content_hash = Some(map.next_value()?);
                }
                "file_lock_info" => {
                    if field_file_lock_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("file_lock_info"));
                    }
                    field_file_lock_info = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = FileMetadata {
            name: field_name.ok_or_else(|| ::serde::de::Error::missing_field("name"))?,
            id: field_id.ok_or_else(|| ::serde::de::Error::missing_field("id"))?,
            client_modified: field_client_modified.ok_or_else(|| ::serde::de::Error::missing_field("client_modified"))?,
            server_modified: field_server_modified.ok_or_else(|| ::serde::de::Error::missing_field("server_modified"))?,
            rev: field_rev.ok_or_else(|| ::serde::de::Error::missing_field("rev"))?,
            size: field_size.ok_or_else(|| ::serde::de::Error::missing_field("size"))?,
            path_lower: field_path_lower,
            path_display: field_path_display,
            parent_shared_folder_id: field_parent_shared_folder_id,
            media_info: field_media_info,
            symlink_info: field_symlink_info,
            sharing_info: field_sharing_info,
            is_downloadable: field_is_downloadable.unwrap_or(true),
            export_info: field_export_info,
            property_groups: field_property_groups,
            has_explicit_shared_members: field_has_explicit_shared_members,
            content_hash: field_content_hash,
            file_lock_info: field_file_lock_info,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("name", &self.name)?;
        s.serialize_field("id", &self.id)?;
        s.serialize_field("client_modified", &self.client_modified)?;
        s.serialize_field("server_modified", &self.server_modified)?;
        s.serialize_field("rev", &self.rev)?;
        s.serialize_field("size", &self.size)?;
        s.serialize_field("path_lower", &self.path_lower)?;
        s.serialize_field("path_display", &self.path_display)?;
        s.serialize_field("parent_shared_folder_id", &self.parent_shared_folder_id)?;
        s.serialize_field("media_info", &self.media_info)?;
        s.serialize_field("symlink_info", &self.symlink_info)?;
        s.serialize_field("sharing_info", &self.sharing_info)?;
        s.serialize_field("is_downloadable", &self.is_downloadable)?;
        s.serialize_field("export_info", &self.export_info)?;
        s.serialize_field("property_groups", &self.property_groups)?;
        s.serialize_field("has_explicit_shared_members", &self.has_explicit_shared_members)?;
        s.serialize_field("content_hash", &self.content_hash)?;
        s.serialize_field("file_lock_info", &self.file_lock_info)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for FileMetadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = FileMetadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FileMetadata struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                FileMetadata::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("FileMetadata", FILE_METADATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for FileMetadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("FileMetadata", 18)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct FileOpsResult {
}
impl Default for FileOpsResult {
    fn default() -> Self {
        FileOpsResult {
        }
    }
}
const FILE_OPS_RESULT_FIELDS: &[&str] = &[];
impl FileOpsResult {
    
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
    ) -> Result<FileOpsResult, V::Error> {
        
        crate::eat_json_fields(&mut map)?;
        Ok(FileOpsResult {})
    }
}
impl<'de> ::serde::de::Deserialize<'de> for FileOpsResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = FileOpsResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FileOpsResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                FileOpsResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("FileOpsResult", FILE_OPS_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for FileOpsResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        serializer.serialize_struct("FileOpsResult", 0)?.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct FileSharingInfo {
    
    pub read_only: bool,
    
    pub parent_shared_folder_id: super::common::SharedFolderId,
    
    
    pub modified_by: Option<super::users_common::AccountId>,
}
impl FileSharingInfo {
    pub fn new(read_only: bool, parent_shared_folder_id: super::common::SharedFolderId) -> Self {
        FileSharingInfo {
            read_only,
            parent_shared_folder_id,
            modified_by: None,
        }
    }
    pub fn with_modified_by(mut self, value: super::users_common::AccountId) -> Self {
        self.modified_by = Some(value);
        self
    }
}
const FILE_SHARING_INFO_FIELDS: &[&str] = &["read_only",
                                            "parent_shared_folder_id",
                                            "modified_by"];
impl FileSharingInfo {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<FileSharingInfo, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<FileSharingInfo>, V::Error> {
        let mut field_read_only = None;
        let mut field_parent_shared_folder_id = None;
        let mut field_modified_by = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "read_only" => {
                    if field_read_only.is_some() {
                        return Err(::serde::de::Error::duplicate_field("read_only"));
                    }
                    field_read_only = Some(map.next_value()?);
                }
                "parent_shared_folder_id" => {
                    if field_parent_shared_folder_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("parent_shared_folder_id"));
                    }
                    field_parent_shared_folder_id = Some(map.next_value()?);
                }
                "modified_by" => {
                    if field_modified_by.is_some() {
                        return Err(::serde::de::Error::duplicate_field("modified_by"));
                    }
                    field_modified_by = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = FileSharingInfo {
            read_only: field_read_only.ok_or_else(|| ::serde::de::Error::missing_field("read_only"))?,
            parent_shared_folder_id: field_parent_shared_folder_id.ok_or_else(|| ::serde::de::Error::missing_field("parent_shared_folder_id"))?,
            modified_by: field_modified_by,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("read_only", &self.read_only)?;
        s.serialize_field("parent_shared_folder_id", &self.parent_shared_folder_id)?;
        s.serialize_field("modified_by", &self.modified_by)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for FileSharingInfo {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = FileSharingInfo;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FileSharingInfo struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                FileSharingInfo::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("FileSharingInfo", FILE_SHARING_INFO_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for FileSharingInfo {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("FileSharingInfo", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum FileStatus {
    Active,
    Deleted,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for FileStatus {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = FileStatus;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FileStatus structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "active" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileStatus::Active)
                    }
                    "deleted" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileStatus::Deleted)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(FileStatus::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["active",
                                    "deleted",
                                    "other"];
        deserializer.deserialize_struct("FileStatus", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for FileStatus {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            FileStatus::Active => {
                
                let mut s = serializer.serialize_struct("FileStatus", 1)?;
                s.serialize_field(".tag", "active")?;
                s.end()
            }
            FileStatus::Deleted => {
                
                let mut s = serializer.serialize_struct("FileStatus", 1)?;
                s.serialize_field(".tag", "deleted")?;
                s.end()
            }
            FileStatus::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct FolderMetadata {
    
    pub name: String,
    
    pub id: Id,
    
    
    pub path_lower: Option<String>,
    
    
    
    
    
    
    pub path_display: Option<String>,
    
    
    pub parent_shared_folder_id: Option<super::common::SharedFolderId>,
    
    pub shared_folder_id: Option<super::common::SharedFolderId>,
    
    pub sharing_info: Option<FolderSharingInfo>,
    
    
    
    pub property_groups: Option<Vec<super::file_properties::PropertyGroup>>,
}
impl FolderMetadata {
    pub fn new(name: String, id: Id) -> Self {
        FolderMetadata {
            name,
            id,
            path_lower: None,
            path_display: None,
            parent_shared_folder_id: None,
            shared_folder_id: None,
            sharing_info: None,
            property_groups: None,
        }
    }
    pub fn with_path_lower(mut self, value: String) -> Self {
        self.path_lower = Some(value);
        self
    }
    pub fn with_path_display(mut self, value: String) -> Self {
        self.path_display = Some(value);
        self
    }
    pub fn with_parent_shared_folder_id(mut self, value: super::common::SharedFolderId) -> Self {
        self.parent_shared_folder_id = Some(value);
        self
    }
    pub fn with_shared_folder_id(mut self, value: super::common::SharedFolderId) -> Self {
        self.shared_folder_id = Some(value);
        self
    }
    pub fn with_sharing_info(mut self, value: FolderSharingInfo) -> Self {
        self.sharing_info = Some(value);
        self
    }
    pub fn with_property_groups(
        mut self,
        value: Vec<super::file_properties::PropertyGroup>,
    ) -> Self {
        self.property_groups = Some(value);
        self
    }
}
const FOLDER_METADATA_FIELDS: &[&str] = &["name",
                                          "id",
                                          "path_lower",
                                          "path_display",
                                          "parent_shared_folder_id",
                                          "shared_folder_id",
                                          "sharing_info",
                                          "property_groups"];
impl FolderMetadata {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<FolderMetadata, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<FolderMetadata>, V::Error> {
        let mut field_name = None;
        let mut field_id = None;
        let mut field_path_lower = None;
        let mut field_path_display = None;
        let mut field_parent_shared_folder_id = None;
        let mut field_shared_folder_id = None;
        let mut field_sharing_info = None;
        let mut field_property_groups = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "name" => {
                    if field_name.is_some() {
                        return Err(::serde::de::Error::duplicate_field("name"));
                    }
                    field_name = Some(map.next_value()?);
                }
                "id" => {
                    if field_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("id"));
                    }
                    field_id = Some(map.next_value()?);
                }
                "path_lower" => {
                    if field_path_lower.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path_lower"));
                    }
                    field_path_lower = Some(map.next_value()?);
                }
                "path_display" => {
                    if field_path_display.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path_display"));
                    }
                    field_path_display = Some(map.next_value()?);
                }
                "parent_shared_folder_id" => {
                    if field_parent_shared_folder_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("parent_shared_folder_id"));
                    }
                    field_parent_shared_folder_id = Some(map.next_value()?);
                }
                "shared_folder_id" => {
                    if field_shared_folder_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("shared_folder_id"));
                    }
                    field_shared_folder_id = Some(map.next_value()?);
                }
                "sharing_info" => {
                    if field_sharing_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("sharing_info"));
                    }
                    field_sharing_info = Some(map.next_value()?);
                }
                "property_groups" => {
                    if field_property_groups.is_some() {
                        return Err(::serde::de::Error::duplicate_field("property_groups"));
                    }
                    field_property_groups = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = FolderMetadata {
            name: field_name.ok_or_else(|| ::serde::de::Error::missing_field("name"))?,
            id: field_id.ok_or_else(|| ::serde::de::Error::missing_field("id"))?,
            path_lower: field_path_lower,
            path_display: field_path_display,
            parent_shared_folder_id: field_parent_shared_folder_id,
            shared_folder_id: field_shared_folder_id,
            sharing_info: field_sharing_info,
            property_groups: field_property_groups,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("name", &self.name)?;
        s.serialize_field("id", &self.id)?;
        s.serialize_field("path_lower", &self.path_lower)?;
        s.serialize_field("path_display", &self.path_display)?;
        s.serialize_field("parent_shared_folder_id", &self.parent_shared_folder_id)?;
        s.serialize_field("shared_folder_id", &self.shared_folder_id)?;
        s.serialize_field("sharing_info", &self.sharing_info)?;
        s.serialize_field("property_groups", &self.property_groups)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for FolderMetadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = FolderMetadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FolderMetadata struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                FolderMetadata::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("FolderMetadata", FOLDER_METADATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for FolderMetadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("FolderMetadata", 8)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct FolderSharingInfo {
    
    pub read_only: bool,
    
    pub parent_shared_folder_id: Option<super::common::SharedFolderId>,
    
    
    pub shared_folder_id: Option<super::common::SharedFolderId>,
    
    
    
    pub traverse_only: bool,
    
    pub no_access: bool,
}
impl FolderSharingInfo {
    pub fn new(read_only: bool) -> Self {
        FolderSharingInfo {
            read_only,
            parent_shared_folder_id: None,
            shared_folder_id: None,
            traverse_only: false,
            no_access: false,
        }
    }
    pub fn with_parent_shared_folder_id(mut self, value: super::common::SharedFolderId) -> Self {
        self.parent_shared_folder_id = Some(value);
        self
    }
    pub fn with_shared_folder_id(mut self, value: super::common::SharedFolderId) -> Self {
        self.shared_folder_id = Some(value);
        self
    }
    pub fn with_traverse_only(mut self, value: bool) -> Self {
        self.traverse_only = value;
        self
    }
    pub fn with_no_access(mut self, value: bool) -> Self {
        self.no_access = value;
        self
    }
}
const FOLDER_SHARING_INFO_FIELDS: &[&str] = &["read_only",
                                              "parent_shared_folder_id",
                                              "shared_folder_id",
                                              "traverse_only",
                                              "no_access"];
impl FolderSharingInfo {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<FolderSharingInfo, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<FolderSharingInfo>, V::Error> {
        let mut field_read_only = None;
        let mut field_parent_shared_folder_id = None;
        let mut field_shared_folder_id = None;
        let mut field_traverse_only = None;
        let mut field_no_access = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "read_only" => {
                    if field_read_only.is_some() {
                        return Err(::serde::de::Error::duplicate_field("read_only"));
                    }
                    field_read_only = Some(map.next_value()?);
                }
                "parent_shared_folder_id" => {
                    if field_parent_shared_folder_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("parent_shared_folder_id"));
                    }
                    field_parent_shared_folder_id = Some(map.next_value()?);
                }
                "shared_folder_id" => {
                    if field_shared_folder_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("shared_folder_id"));
                    }
                    field_shared_folder_id = Some(map.next_value()?);
                }
                "traverse_only" => {
                    if field_traverse_only.is_some() {
                        return Err(::serde::de::Error::duplicate_field("traverse_only"));
                    }
                    field_traverse_only = Some(map.next_value()?);
                }
                "no_access" => {
                    if field_no_access.is_some() {
                        return Err(::serde::de::Error::duplicate_field("no_access"));
                    }
                    field_no_access = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = FolderSharingInfo {
            read_only: field_read_only.ok_or_else(|| ::serde::de::Error::missing_field("read_only"))?,
            parent_shared_folder_id: field_parent_shared_folder_id,
            shared_folder_id: field_shared_folder_id,
            traverse_only: field_traverse_only.unwrap_or(false),
            no_access: field_no_access.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("read_only", &self.read_only)?;
        s.serialize_field("parent_shared_folder_id", &self.parent_shared_folder_id)?;
        s.serialize_field("shared_folder_id", &self.shared_folder_id)?;
        s.serialize_field("traverse_only", &self.traverse_only)?;
        s.serialize_field("no_access", &self.no_access)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for FolderSharingInfo {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = FolderSharingInfo;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a FolderSharingInfo struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                FolderSharingInfo::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("FolderSharingInfo", FOLDER_SHARING_INFO_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for FolderSharingInfo {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("FolderSharingInfo", 5)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetCopyReferenceArg {
    
    pub path: ReadPath,
}
impl GetCopyReferenceArg {
    pub fn new(path: ReadPath) -> Self {
        GetCopyReferenceArg {
            path,
        }
    }
}
const GET_COPY_REFERENCE_ARG_FIELDS: &[&str] = &["path"];
impl GetCopyReferenceArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetCopyReferenceArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetCopyReferenceArg>, V::Error> {
        let mut field_path = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetCopyReferenceArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetCopyReferenceArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetCopyReferenceArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetCopyReferenceArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetCopyReferenceArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetCopyReferenceArg", GET_COPY_REFERENCE_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetCopyReferenceArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetCopyReferenceArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum GetCopyReferenceError {
    Path(LookupError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for GetCopyReferenceError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = GetCopyReferenceError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetCopyReferenceError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(GetCopyReferenceError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(GetCopyReferenceError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "other"];
        deserializer.deserialize_struct("GetCopyReferenceError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for GetCopyReferenceError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            GetCopyReferenceError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("GetCopyReferenceError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            GetCopyReferenceError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for GetCopyReferenceError {
    fn description(&self) -> &str {
        "GetCopyReferenceError"
    }
}
impl ::std::fmt::Display for GetCopyReferenceError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetCopyReferenceResult {
    
    pub metadata: Metadata,
    
    pub copy_reference: String,
    
    
    pub expires: super::common::DropboxTimestamp,
}
impl GetCopyReferenceResult {
    pub fn new(
        metadata: Metadata,
        copy_reference: String,
        expires: super::common::DropboxTimestamp,
    ) -> Self {
        GetCopyReferenceResult {
            metadata,
            copy_reference,
            expires,
        }
    }
}
const GET_COPY_REFERENCE_RESULT_FIELDS: &[&str] = &["metadata",
                                                    "copy_reference",
                                                    "expires"];
impl GetCopyReferenceResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetCopyReferenceResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetCopyReferenceResult>, V::Error> {
        let mut field_metadata = None;
        let mut field_copy_reference = None;
        let mut field_expires = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                "copy_reference" => {
                    if field_copy_reference.is_some() {
                        return Err(::serde::de::Error::duplicate_field("copy_reference"));
                    }
                    field_copy_reference = Some(map.next_value()?);
                }
                "expires" => {
                    if field_expires.is_some() {
                        return Err(::serde::de::Error::duplicate_field("expires"));
                    }
                    field_expires = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetCopyReferenceResult {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
            copy_reference: field_copy_reference.ok_or_else(|| ::serde::de::Error::missing_field("copy_reference"))?,
            expires: field_expires.ok_or_else(|| ::serde::de::Error::missing_field("expires"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)?;
        s.serialize_field("copy_reference", &self.copy_reference)?;
        s.serialize_field("expires", &self.expires)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetCopyReferenceResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetCopyReferenceResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetCopyReferenceResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetCopyReferenceResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetCopyReferenceResult", GET_COPY_REFERENCE_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetCopyReferenceResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetCopyReferenceResult", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetMetadataArg {
    
    pub path: ReadPath,
    
    pub include_media_info: bool,
    
    
    pub include_deleted: bool,
    
    
    pub include_has_explicit_shared_members: bool,
    
    
    pub include_property_groups: Option<super::file_properties::TemplateFilterBase>,
}
impl GetMetadataArg {
    pub fn new(path: ReadPath) -> Self {
        GetMetadataArg {
            path,
            include_media_info: false,
            include_deleted: false,
            include_has_explicit_shared_members: false,
            include_property_groups: None,
        }
    }
    pub fn with_include_media_info(mut self, value: bool) -> Self {
        self.include_media_info = value;
        self
    }
    pub fn with_include_deleted(mut self, value: bool) -> Self {
        self.include_deleted = value;
        self
    }
    pub fn with_include_has_explicit_shared_members(mut self, value: bool) -> Self {
        self.include_has_explicit_shared_members = value;
        self
    }
    pub fn with_include_property_groups(
        mut self,
        value: super::file_properties::TemplateFilterBase,
    ) -> Self {
        self.include_property_groups = Some(value);
        self
    }
}
const GET_METADATA_ARG_FIELDS: &[&str] = &["path",
                                           "include_media_info",
                                           "include_deleted",
                                           "include_has_explicit_shared_members",
                                           "include_property_groups"];
impl GetMetadataArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetMetadataArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetMetadataArg>, V::Error> {
        let mut field_path = None;
        let mut field_include_media_info = None;
        let mut field_include_deleted = None;
        let mut field_include_has_explicit_shared_members = None;
        let mut field_include_property_groups = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "include_media_info" => {
                    if field_include_media_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_media_info"));
                    }
                    field_include_media_info = Some(map.next_value()?);
                }
                "include_deleted" => {
                    if field_include_deleted.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_deleted"));
                    }
                    field_include_deleted = Some(map.next_value()?);
                }
                "include_has_explicit_shared_members" => {
                    if field_include_has_explicit_shared_members.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_has_explicit_shared_members"));
                    }
                    field_include_has_explicit_shared_members = Some(map.next_value()?);
                }
                "include_property_groups" => {
                    if field_include_property_groups.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_property_groups"));
                    }
                    field_include_property_groups = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetMetadataArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            include_media_info: field_include_media_info.unwrap_or(false),
            include_deleted: field_include_deleted.unwrap_or(false),
            include_has_explicit_shared_members: field_include_has_explicit_shared_members.unwrap_or(false),
            include_property_groups: field_include_property_groups,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("include_media_info", &self.include_media_info)?;
        s.serialize_field("include_deleted", &self.include_deleted)?;
        s.serialize_field("include_has_explicit_shared_members", &self.include_has_explicit_shared_members)?;
        s.serialize_field("include_property_groups", &self.include_property_groups)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetMetadataArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetMetadataArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetMetadataArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetMetadataArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetMetadataArg", GET_METADATA_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetMetadataArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetMetadataArg", 5)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum GetMetadataError {
    Path(LookupError),
}
impl<'de> ::serde::de::Deserialize<'de> for GetMetadataError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = GetMetadataError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetMetadataError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(GetMetadataError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["path"];
        deserializer.deserialize_struct("GetMetadataError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for GetMetadataError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            GetMetadataError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("GetMetadataError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
        }
    }
}
impl ::std::error::Error for GetMetadataError {
    fn description(&self) -> &str {
        "GetMetadataError"
    }
}
impl ::std::fmt::Display for GetMetadataError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetTemporaryLinkArg {
    
    pub path: ReadPath,
}
impl GetTemporaryLinkArg {
    pub fn new(path: ReadPath) -> Self {
        GetTemporaryLinkArg {
            path,
        }
    }
}
const GET_TEMPORARY_LINK_ARG_FIELDS: &[&str] = &["path"];
impl GetTemporaryLinkArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetTemporaryLinkArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetTemporaryLinkArg>, V::Error> {
        let mut field_path = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetTemporaryLinkArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetTemporaryLinkArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetTemporaryLinkArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetTemporaryLinkArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetTemporaryLinkArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetTemporaryLinkArg", GET_TEMPORARY_LINK_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetTemporaryLinkArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetTemporaryLinkArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum GetTemporaryLinkError {
    Path(LookupError),
    
    
    
    EmailNotVerified,
    
    UnsupportedFile,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for GetTemporaryLinkError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = GetTemporaryLinkError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetTemporaryLinkError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(GetTemporaryLinkError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "email_not_verified" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(GetTemporaryLinkError::EmailNotVerified)
                    }
                    "unsupported_file" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(GetTemporaryLinkError::UnsupportedFile)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(GetTemporaryLinkError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "email_not_verified",
                                    "unsupported_file",
                                    "other"];
        deserializer.deserialize_struct("GetTemporaryLinkError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for GetTemporaryLinkError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            GetTemporaryLinkError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("GetTemporaryLinkError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            GetTemporaryLinkError::EmailNotVerified => {
                
                let mut s = serializer.serialize_struct("GetTemporaryLinkError", 1)?;
                s.serialize_field(".tag", "email_not_verified")?;
                s.end()
            }
            GetTemporaryLinkError::UnsupportedFile => {
                
                let mut s = serializer.serialize_struct("GetTemporaryLinkError", 1)?;
                s.serialize_field(".tag", "unsupported_file")?;
                s.end()
            }
            GetTemporaryLinkError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for GetTemporaryLinkError {
    fn description(&self) -> &str {
        "GetTemporaryLinkError"
    }
}
impl ::std::fmt::Display for GetTemporaryLinkError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetTemporaryLinkResult {
    
    pub metadata: FileMetadata,
    
    pub link: String,
}
impl GetTemporaryLinkResult {
    pub fn new(metadata: FileMetadata, link: String) -> Self {
        GetTemporaryLinkResult {
            metadata,
            link,
        }
    }
}
const GET_TEMPORARY_LINK_RESULT_FIELDS: &[&str] = &["metadata",
                                                    "link"];
impl GetTemporaryLinkResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetTemporaryLinkResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetTemporaryLinkResult>, V::Error> {
        let mut field_metadata = None;
        let mut field_link = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                "link" => {
                    if field_link.is_some() {
                        return Err(::serde::de::Error::duplicate_field("link"));
                    }
                    field_link = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetTemporaryLinkResult {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
            link: field_link.ok_or_else(|| ::serde::de::Error::missing_field("link"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)?;
        s.serialize_field("link", &self.link)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetTemporaryLinkResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetTemporaryLinkResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetTemporaryLinkResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetTemporaryLinkResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetTemporaryLinkResult", GET_TEMPORARY_LINK_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetTemporaryLinkResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetTemporaryLinkResult", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetTemporaryUploadLinkArg {
    
    
    pub commit_info: CommitInfo,
    
    
    pub duration: f64,
}
impl GetTemporaryUploadLinkArg {
    pub fn new(commit_info: CommitInfo) -> Self {
        GetTemporaryUploadLinkArg {
            commit_info,
            duration: 14400.0,
        }
    }
    pub fn with_duration(mut self, value: f64) -> Self {
        self.duration = value;
        self
    }
}
const GET_TEMPORARY_UPLOAD_LINK_ARG_FIELDS: &[&str] = &["commit_info",
                                                        "duration"];
impl GetTemporaryUploadLinkArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetTemporaryUploadLinkArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetTemporaryUploadLinkArg>, V::Error> {
        let mut field_commit_info = None;
        let mut field_duration = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "commit_info" => {
                    if field_commit_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("commit_info"));
                    }
                    field_commit_info = Some(map.next_value()?);
                }
                "duration" => {
                    if field_duration.is_some() {
                        return Err(::serde::de::Error::duplicate_field("duration"));
                    }
                    field_duration = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetTemporaryUploadLinkArg {
            commit_info: field_commit_info.ok_or_else(|| ::serde::de::Error::missing_field("commit_info"))?,
            duration: field_duration.unwrap_or(14400.0),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("commit_info", &self.commit_info)?;
        s.serialize_field("duration", &self.duration)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetTemporaryUploadLinkArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetTemporaryUploadLinkArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetTemporaryUploadLinkArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetTemporaryUploadLinkArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetTemporaryUploadLinkArg", GET_TEMPORARY_UPLOAD_LINK_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetTemporaryUploadLinkArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetTemporaryUploadLinkArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetTemporaryUploadLinkResult {
    
    pub link: String,
}
impl GetTemporaryUploadLinkResult {
    pub fn new(link: String) -> Self {
        GetTemporaryUploadLinkResult {
            link,
        }
    }
}
const GET_TEMPORARY_UPLOAD_LINK_RESULT_FIELDS: &[&str] = &["link"];
impl GetTemporaryUploadLinkResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetTemporaryUploadLinkResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetTemporaryUploadLinkResult>, V::Error> {
        let mut field_link = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "link" => {
                    if field_link.is_some() {
                        return Err(::serde::de::Error::duplicate_field("link"));
                    }
                    field_link = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetTemporaryUploadLinkResult {
            link: field_link.ok_or_else(|| ::serde::de::Error::missing_field("link"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("link", &self.link)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetTemporaryUploadLinkResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetTemporaryUploadLinkResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetTemporaryUploadLinkResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetTemporaryUploadLinkResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetTemporaryUploadLinkResult", GET_TEMPORARY_UPLOAD_LINK_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetTemporaryUploadLinkResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetTemporaryUploadLinkResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetThumbnailBatchArg {
    
    pub entries: Vec<ThumbnailArg>,
}
impl GetThumbnailBatchArg {
    pub fn new(entries: Vec<ThumbnailArg>) -> Self {
        GetThumbnailBatchArg {
            entries,
        }
    }
}
const GET_THUMBNAIL_BATCH_ARG_FIELDS: &[&str] = &["entries"];
impl GetThumbnailBatchArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetThumbnailBatchArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetThumbnailBatchArg>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetThumbnailBatchArg {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetThumbnailBatchArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetThumbnailBatchArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetThumbnailBatchArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetThumbnailBatchArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetThumbnailBatchArg", GET_THUMBNAIL_BATCH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetThumbnailBatchArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetThumbnailBatchArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum GetThumbnailBatchError {
    
    TooManyFiles,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for GetThumbnailBatchError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = GetThumbnailBatchError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetThumbnailBatchError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "too_many_files" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(GetThumbnailBatchError::TooManyFiles)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(GetThumbnailBatchError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["too_many_files",
                                    "other"];
        deserializer.deserialize_struct("GetThumbnailBatchError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for GetThumbnailBatchError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            GetThumbnailBatchError::TooManyFiles => {
                
                let mut s = serializer.serialize_struct("GetThumbnailBatchError", 1)?;
                s.serialize_field(".tag", "too_many_files")?;
                s.end()
            }
            GetThumbnailBatchError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for GetThumbnailBatchError {
    fn description(&self) -> &str {
        "GetThumbnailBatchError"
    }
}
impl ::std::fmt::Display for GetThumbnailBatchError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetThumbnailBatchResult {
    
    pub entries: Vec<GetThumbnailBatchResultEntry>,
}
impl GetThumbnailBatchResult {
    pub fn new(entries: Vec<GetThumbnailBatchResultEntry>) -> Self {
        GetThumbnailBatchResult {
            entries,
        }
    }
}
const GET_THUMBNAIL_BATCH_RESULT_FIELDS: &[&str] = &["entries"];
impl GetThumbnailBatchResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetThumbnailBatchResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetThumbnailBatchResult>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetThumbnailBatchResult {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetThumbnailBatchResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetThumbnailBatchResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetThumbnailBatchResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetThumbnailBatchResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetThumbnailBatchResult", GET_THUMBNAIL_BATCH_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetThumbnailBatchResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetThumbnailBatchResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GetThumbnailBatchResultData {
    pub metadata: FileMetadata,
    
    pub thumbnail: String,
}
impl GetThumbnailBatchResultData {
    pub fn new(metadata: FileMetadata, thumbnail: String) -> Self {
        GetThumbnailBatchResultData {
            metadata,
            thumbnail,
        }
    }
}
const GET_THUMBNAIL_BATCH_RESULT_DATA_FIELDS: &[&str] = &["metadata",
                                                          "thumbnail"];
impl GetThumbnailBatchResultData {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GetThumbnailBatchResultData, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GetThumbnailBatchResultData>, V::Error> {
        let mut field_metadata = None;
        let mut field_thumbnail = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                "thumbnail" => {
                    if field_thumbnail.is_some() {
                        return Err(::serde::de::Error::duplicate_field("thumbnail"));
                    }
                    field_thumbnail = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GetThumbnailBatchResultData {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
            thumbnail: field_thumbnail.ok_or_else(|| ::serde::de::Error::missing_field("thumbnail"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)?;
        s.serialize_field("thumbnail", &self.thumbnail)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GetThumbnailBatchResultData {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GetThumbnailBatchResultData;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetThumbnailBatchResultData struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GetThumbnailBatchResultData::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GetThumbnailBatchResultData", GET_THUMBNAIL_BATCH_RESULT_DATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GetThumbnailBatchResultData {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GetThumbnailBatchResultData", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum GetThumbnailBatchResultEntry {
    Success(GetThumbnailBatchResultData),
    
    Failure(ThumbnailError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for GetThumbnailBatchResultEntry {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = GetThumbnailBatchResultEntry;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GetThumbnailBatchResultEntry structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "success" => Ok(GetThumbnailBatchResultEntry::Success(GetThumbnailBatchResultData::internal_deserialize(map)?)),
                    "failure" => {
                        match map.next_key()? {
                            Some("failure") => Ok(GetThumbnailBatchResultEntry::Failure(map.next_value()?)),
                            None => Err(de::Error::missing_field("failure")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(GetThumbnailBatchResultEntry::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["success",
                                    "failure",
                                    "other"];
        deserializer.deserialize_struct("GetThumbnailBatchResultEntry", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for GetThumbnailBatchResultEntry {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            GetThumbnailBatchResultEntry::Success(ref x) => {
                
                let mut s = serializer.serialize_struct("GetThumbnailBatchResultEntry", 3)?;
                s.serialize_field(".tag", "success")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            GetThumbnailBatchResultEntry::Failure(ref x) => {
                
                let mut s = serializer.serialize_struct("GetThumbnailBatchResultEntry", 2)?;
                s.serialize_field(".tag", "failure")?;
                s.serialize_field("failure", x)?;
                s.end()
            }
            GetThumbnailBatchResultEntry::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct GpsCoordinates {
    
    pub latitude: f64,
    
    pub longitude: f64,
}
impl GpsCoordinates {
    pub fn new(latitude: f64, longitude: f64) -> Self {
        GpsCoordinates {
            latitude,
            longitude,
        }
    }
}
const GPS_COORDINATES_FIELDS: &[&str] = &["latitude",
                                          "longitude"];
impl GpsCoordinates {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<GpsCoordinates, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<GpsCoordinates>, V::Error> {
        let mut field_latitude = None;
        let mut field_longitude = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "latitude" => {
                    if field_latitude.is_some() {
                        return Err(::serde::de::Error::duplicate_field("latitude"));
                    }
                    field_latitude = Some(map.next_value()?);
                }
                "longitude" => {
                    if field_longitude.is_some() {
                        return Err(::serde::de::Error::duplicate_field("longitude"));
                    }
                    field_longitude = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = GpsCoordinates {
            latitude: field_latitude.ok_or_else(|| ::serde::de::Error::missing_field("latitude"))?,
            longitude: field_longitude.ok_or_else(|| ::serde::de::Error::missing_field("longitude"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("latitude", &self.latitude)?;
        s.serialize_field("longitude", &self.longitude)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for GpsCoordinates {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = GpsCoordinates;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a GpsCoordinates struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                GpsCoordinates::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("GpsCoordinates", GPS_COORDINATES_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for GpsCoordinates {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("GpsCoordinates", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct HighlightSpan {
    
    pub highlight_str: String,
    
    pub is_highlighted: bool,
}
impl HighlightSpan {
    pub fn new(highlight_str: String, is_highlighted: bool) -> Self {
        HighlightSpan {
            highlight_str,
            is_highlighted,
        }
    }
}
const HIGHLIGHT_SPAN_FIELDS: &[&str] = &["highlight_str",
                                         "is_highlighted"];
impl HighlightSpan {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<HighlightSpan, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<HighlightSpan>, V::Error> {
        let mut field_highlight_str = None;
        let mut field_is_highlighted = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "highlight_str" => {
                    if field_highlight_str.is_some() {
                        return Err(::serde::de::Error::duplicate_field("highlight_str"));
                    }
                    field_highlight_str = Some(map.next_value()?);
                }
                "is_highlighted" => {
                    if field_is_highlighted.is_some() {
                        return Err(::serde::de::Error::duplicate_field("is_highlighted"));
                    }
                    field_is_highlighted = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = HighlightSpan {
            highlight_str: field_highlight_str.ok_or_else(|| ::serde::de::Error::missing_field("highlight_str"))?,
            is_highlighted: field_is_highlighted.ok_or_else(|| ::serde::de::Error::missing_field("is_highlighted"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("highlight_str", &self.highlight_str)?;
        s.serialize_field("is_highlighted", &self.is_highlighted)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for HighlightSpan {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = HighlightSpan;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a HighlightSpan struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                HighlightSpan::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("HighlightSpan", HIGHLIGHT_SPAN_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for HighlightSpan {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("HighlightSpan", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ListFolderArg {
    
    pub path: PathROrId,
    
    
    pub recursive: bool,
    
    
    pub include_media_info: bool,
    
    
    pub include_deleted: bool,
    
    
    pub include_has_explicit_shared_members: bool,
    
    
    pub include_mounted_folders: bool,
    
    
    pub limit: Option<u32>,
    
    
    
    pub shared_link: Option<SharedLink>,
    
    
    pub include_property_groups: Option<super::file_properties::TemplateFilterBase>,
    
    pub include_non_downloadable_files: bool,
}
impl ListFolderArg {
    pub fn new(path: PathROrId) -> Self {
        ListFolderArg {
            path,
            recursive: false,
            include_media_info: false,
            include_deleted: false,
            include_has_explicit_shared_members: false,
            include_mounted_folders: true,
            limit: None,
            shared_link: None,
            include_property_groups: None,
            include_non_downloadable_files: true,
        }
    }
    pub fn with_recursive(mut self, value: bool) -> Self {
        self.recursive = value;
        self
    }
    pub fn with_include_media_info(mut self, value: bool) -> Self {
        self.include_media_info = value;
        self
    }
    pub fn with_include_deleted(mut self, value: bool) -> Self {
        self.include_deleted = value;
        self
    }
    pub fn with_include_has_explicit_shared_members(mut self, value: bool) -> Self {
        self.include_has_explicit_shared_members = value;
        self
    }
    pub fn with_include_mounted_folders(mut self, value: bool) -> Self {
        self.include_mounted_folders = value;
        self
    }
    pub fn with_limit(mut self, value: u32) -> Self {
        self.limit = Some(value);
        self
    }
    pub fn with_shared_link(mut self, value: SharedLink) -> Self {
        self.shared_link = Some(value);
        self
    }
    pub fn with_include_property_groups(
        mut self,
        value: super::file_properties::TemplateFilterBase,
    ) -> Self {
        self.include_property_groups = Some(value);
        self
    }
    pub fn with_include_non_downloadable_files(mut self, value: bool) -> Self {
        self.include_non_downloadable_files = value;
        self
    }
}
const LIST_FOLDER_ARG_FIELDS: &[&str] = &["path",
                                          "recursive",
                                          "include_media_info",
                                          "include_deleted",
                                          "include_has_explicit_shared_members",
                                          "include_mounted_folders",
                                          "limit",
                                          "shared_link",
                                          "include_property_groups",
                                          "include_non_downloadable_files"];
impl ListFolderArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ListFolderArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ListFolderArg>, V::Error> {
        let mut field_path = None;
        let mut field_recursive = None;
        let mut field_include_media_info = None;
        let mut field_include_deleted = None;
        let mut field_include_has_explicit_shared_members = None;
        let mut field_include_mounted_folders = None;
        let mut field_limit = None;
        let mut field_shared_link = None;
        let mut field_include_property_groups = None;
        let mut field_include_non_downloadable_files = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "recursive" => {
                    if field_recursive.is_some() {
                        return Err(::serde::de::Error::duplicate_field("recursive"));
                    }
                    field_recursive = Some(map.next_value()?);
                }
                "include_media_info" => {
                    if field_include_media_info.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_media_info"));
                    }
                    field_include_media_info = Some(map.next_value()?);
                }
                "include_deleted" => {
                    if field_include_deleted.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_deleted"));
                    }
                    field_include_deleted = Some(map.next_value()?);
                }
                "include_has_explicit_shared_members" => {
                    if field_include_has_explicit_shared_members.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_has_explicit_shared_members"));
                    }
                    field_include_has_explicit_shared_members = Some(map.next_value()?);
                }
                "include_mounted_folders" => {
                    if field_include_mounted_folders.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_mounted_folders"));
                    }
                    field_include_mounted_folders = Some(map.next_value()?);
                }
                "limit" => {
                    if field_limit.is_some() {
                        return Err(::serde::de::Error::duplicate_field("limit"));
                    }
                    field_limit = Some(map.next_value()?);
                }
                "shared_link" => {
                    if field_shared_link.is_some() {
                        return Err(::serde::de::Error::duplicate_field("shared_link"));
                    }
                    field_shared_link = Some(map.next_value()?);
                }
                "include_property_groups" => {
                    if field_include_property_groups.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_property_groups"));
                    }
                    field_include_property_groups = Some(map.next_value()?);
                }
                "include_non_downloadable_files" => {
                    if field_include_non_downloadable_files.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_non_downloadable_files"));
                    }
                    field_include_non_downloadable_files = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ListFolderArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            recursive: field_recursive.unwrap_or(false),
            include_media_info: field_include_media_info.unwrap_or(false),
            include_deleted: field_include_deleted.unwrap_or(false),
            include_has_explicit_shared_members: field_include_has_explicit_shared_members.unwrap_or(false),
            include_mounted_folders: field_include_mounted_folders.unwrap_or(true),
            limit: field_limit,
            shared_link: field_shared_link,
            include_property_groups: field_include_property_groups,
            include_non_downloadable_files: field_include_non_downloadable_files.unwrap_or(true),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("recursive", &self.recursive)?;
        s.serialize_field("include_media_info", &self.include_media_info)?;
        s.serialize_field("include_deleted", &self.include_deleted)?;
        s.serialize_field("include_has_explicit_shared_members", &self.include_has_explicit_shared_members)?;
        s.serialize_field("include_mounted_folders", &self.include_mounted_folders)?;
        s.serialize_field("limit", &self.limit)?;
        s.serialize_field("shared_link", &self.shared_link)?;
        s.serialize_field("include_property_groups", &self.include_property_groups)?;
        s.serialize_field("include_non_downloadable_files", &self.include_non_downloadable_files)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ListFolderArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ListFolderArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListFolderArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ListFolderArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ListFolderArg", LIST_FOLDER_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ListFolderArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ListFolderArg", 10)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ListFolderContinueArg {
    
    
    pub cursor: ListFolderCursor,
}
impl ListFolderContinueArg {
    pub fn new(cursor: ListFolderCursor) -> Self {
        ListFolderContinueArg {
            cursor,
        }
    }
}
const LIST_FOLDER_CONTINUE_ARG_FIELDS: &[&str] = &["cursor"];
impl ListFolderContinueArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ListFolderContinueArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ListFolderContinueArg>, V::Error> {
        let mut field_cursor = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "cursor" => {
                    if field_cursor.is_some() {
                        return Err(::serde::de::Error::duplicate_field("cursor"));
                    }
                    field_cursor = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ListFolderContinueArg {
            cursor: field_cursor.ok_or_else(|| ::serde::de::Error::missing_field("cursor"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("cursor", &self.cursor)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ListFolderContinueArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ListFolderContinueArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListFolderContinueArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ListFolderContinueArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ListFolderContinueArg", LIST_FOLDER_CONTINUE_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ListFolderContinueArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ListFolderContinueArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum ListFolderContinueError {
    Path(LookupError),
    
    
    Reset,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for ListFolderContinueError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ListFolderContinueError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListFolderContinueError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(ListFolderContinueError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "reset" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ListFolderContinueError::Reset)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ListFolderContinueError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "reset",
                                    "other"];
        deserializer.deserialize_struct("ListFolderContinueError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ListFolderContinueError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ListFolderContinueError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("ListFolderContinueError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            ListFolderContinueError::Reset => {
                
                let mut s = serializer.serialize_struct("ListFolderContinueError", 1)?;
                s.serialize_field(".tag", "reset")?;
                s.end()
            }
            ListFolderContinueError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for ListFolderContinueError {
    fn description(&self) -> &str {
        "ListFolderContinueError"
    }
}
impl ::std::fmt::Display for ListFolderContinueError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum ListFolderError {
    Path(LookupError),
    TemplateError(super::file_properties::TemplateError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for ListFolderError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ListFolderError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListFolderError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(ListFolderError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "template_error" => {
                        match map.next_key()? {
                            Some("template_error") => Ok(ListFolderError::TemplateError(map.next_value()?)),
                            None => Err(de::Error::missing_field("template_error")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ListFolderError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "template_error",
                                    "other"];
        deserializer.deserialize_struct("ListFolderError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ListFolderError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ListFolderError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("ListFolderError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            ListFolderError::TemplateError(ref x) => {
                
                let mut s = serializer.serialize_struct("ListFolderError", 2)?;
                s.serialize_field(".tag", "template_error")?;
                s.serialize_field("template_error", x)?;
                s.end()
            }
            ListFolderError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for ListFolderError {
    fn description(&self) -> &str {
        "ListFolderError"
    }
}
impl ::std::fmt::Display for ListFolderError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ListFolderGetLatestCursorResult {
    
    
    pub cursor: ListFolderCursor,
}
impl ListFolderGetLatestCursorResult {
    pub fn new(cursor: ListFolderCursor) -> Self {
        ListFolderGetLatestCursorResult {
            cursor,
        }
    }
}
const LIST_FOLDER_GET_LATEST_CURSOR_RESULT_FIELDS: &[&str] = &["cursor"];
impl ListFolderGetLatestCursorResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ListFolderGetLatestCursorResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ListFolderGetLatestCursorResult>, V::Error> {
        let mut field_cursor = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "cursor" => {
                    if field_cursor.is_some() {
                        return Err(::serde::de::Error::duplicate_field("cursor"));
                    }
                    field_cursor = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ListFolderGetLatestCursorResult {
            cursor: field_cursor.ok_or_else(|| ::serde::de::Error::missing_field("cursor"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("cursor", &self.cursor)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ListFolderGetLatestCursorResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ListFolderGetLatestCursorResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListFolderGetLatestCursorResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ListFolderGetLatestCursorResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ListFolderGetLatestCursorResult", LIST_FOLDER_GET_LATEST_CURSOR_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ListFolderGetLatestCursorResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ListFolderGetLatestCursorResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ListFolderLongpollArg {
    
    
    
    pub cursor: ListFolderCursor,
    
    
    
    pub timeout: u64,
}
impl ListFolderLongpollArg {
    pub fn new(cursor: ListFolderCursor) -> Self {
        ListFolderLongpollArg {
            cursor,
            timeout: 30,
        }
    }
    pub fn with_timeout(mut self, value: u64) -> Self {
        self.timeout = value;
        self
    }
}
const LIST_FOLDER_LONGPOLL_ARG_FIELDS: &[&str] = &["cursor",
                                                   "timeout"];
impl ListFolderLongpollArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ListFolderLongpollArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ListFolderLongpollArg>, V::Error> {
        let mut field_cursor = None;
        let mut field_timeout = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "cursor" => {
                    if field_cursor.is_some() {
                        return Err(::serde::de::Error::duplicate_field("cursor"));
                    }
                    field_cursor = Some(map.next_value()?);
                }
                "timeout" => {
                    if field_timeout.is_some() {
                        return Err(::serde::de::Error::duplicate_field("timeout"));
                    }
                    field_timeout = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ListFolderLongpollArg {
            cursor: field_cursor.ok_or_else(|| ::serde::de::Error::missing_field("cursor"))?,
            timeout: field_timeout.unwrap_or(30),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("cursor", &self.cursor)?;
        s.serialize_field("timeout", &self.timeout)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ListFolderLongpollArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ListFolderLongpollArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListFolderLongpollArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ListFolderLongpollArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ListFolderLongpollArg", LIST_FOLDER_LONGPOLL_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ListFolderLongpollArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ListFolderLongpollArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum ListFolderLongpollError {
    
    
    Reset,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for ListFolderLongpollError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ListFolderLongpollError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListFolderLongpollError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "reset" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ListFolderLongpollError::Reset)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ListFolderLongpollError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["reset",
                                    "other"];
        deserializer.deserialize_struct("ListFolderLongpollError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ListFolderLongpollError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ListFolderLongpollError::Reset => {
                
                let mut s = serializer.serialize_struct("ListFolderLongpollError", 1)?;
                s.serialize_field(".tag", "reset")?;
                s.end()
            }
            ListFolderLongpollError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for ListFolderLongpollError {
    fn description(&self) -> &str {
        "ListFolderLongpollError"
    }
}
impl ::std::fmt::Display for ListFolderLongpollError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ListFolderLongpollResult {
    
    
    pub changes: bool,
    
    
    pub backoff: Option<u64>,
}
impl ListFolderLongpollResult {
    pub fn new(changes: bool) -> Self {
        ListFolderLongpollResult {
            changes,
            backoff: None,
        }
    }
    pub fn with_backoff(mut self, value: u64) -> Self {
        self.backoff = Some(value);
        self
    }
}
const LIST_FOLDER_LONGPOLL_RESULT_FIELDS: &[&str] = &["changes",
                                                      "backoff"];
impl ListFolderLongpollResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ListFolderLongpollResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ListFolderLongpollResult>, V::Error> {
        let mut field_changes = None;
        let mut field_backoff = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "changes" => {
                    if field_changes.is_some() {
                        return Err(::serde::de::Error::duplicate_field("changes"));
                    }
                    field_changes = Some(map.next_value()?);
                }
                "backoff" => {
                    if field_backoff.is_some() {
                        return Err(::serde::de::Error::duplicate_field("backoff"));
                    }
                    field_backoff = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ListFolderLongpollResult {
            changes: field_changes.ok_or_else(|| ::serde::de::Error::missing_field("changes"))?,
            backoff: field_backoff,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("changes", &self.changes)?;
        s.serialize_field("backoff", &self.backoff)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ListFolderLongpollResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ListFolderLongpollResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListFolderLongpollResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ListFolderLongpollResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ListFolderLongpollResult", LIST_FOLDER_LONGPOLL_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ListFolderLongpollResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ListFolderLongpollResult", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ListFolderResult {
    
    pub entries: Vec<Metadata>,
    
    
    pub cursor: ListFolderCursor,
    
    
    pub has_more: bool,
}
impl ListFolderResult {
    pub fn new(entries: Vec<Metadata>, cursor: ListFolderCursor, has_more: bool) -> Self {
        ListFolderResult {
            entries,
            cursor,
            has_more,
        }
    }
}
const LIST_FOLDER_RESULT_FIELDS: &[&str] = &["entries",
                                             "cursor",
                                             "has_more"];
impl ListFolderResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ListFolderResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ListFolderResult>, V::Error> {
        let mut field_entries = None;
        let mut field_cursor = None;
        let mut field_has_more = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                "cursor" => {
                    if field_cursor.is_some() {
                        return Err(::serde::de::Error::duplicate_field("cursor"));
                    }
                    field_cursor = Some(map.next_value()?);
                }
                "has_more" => {
                    if field_has_more.is_some() {
                        return Err(::serde::de::Error::duplicate_field("has_more"));
                    }
                    field_has_more = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ListFolderResult {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
            cursor: field_cursor.ok_or_else(|| ::serde::de::Error::missing_field("cursor"))?,
            has_more: field_has_more.ok_or_else(|| ::serde::de::Error::missing_field("has_more"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)?;
        s.serialize_field("cursor", &self.cursor)?;
        s.serialize_field("has_more", &self.has_more)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ListFolderResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ListFolderResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListFolderResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ListFolderResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ListFolderResult", LIST_FOLDER_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ListFolderResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ListFolderResult", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ListRevisionsArg {
    
    pub path: PathOrId,
    
    pub mode: ListRevisionsMode,
    
    pub limit: u64,
}
impl ListRevisionsArg {
    pub fn new(path: PathOrId) -> Self {
        ListRevisionsArg {
            path,
            mode: ListRevisionsMode::Path,
            limit: 10,
        }
    }
    pub fn with_mode(mut self, value: ListRevisionsMode) -> Self {
        self.mode = value;
        self
    }
    pub fn with_limit(mut self, value: u64) -> Self {
        self.limit = value;
        self
    }
}
const LIST_REVISIONS_ARG_FIELDS: &[&str] = &["path",
                                             "mode",
                                             "limit"];
impl ListRevisionsArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ListRevisionsArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ListRevisionsArg>, V::Error> {
        let mut field_path = None;
        let mut field_mode = None;
        let mut field_limit = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "mode" => {
                    if field_mode.is_some() {
                        return Err(::serde::de::Error::duplicate_field("mode"));
                    }
                    field_mode = Some(map.next_value()?);
                }
                "limit" => {
                    if field_limit.is_some() {
                        return Err(::serde::de::Error::duplicate_field("limit"));
                    }
                    field_limit = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ListRevisionsArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            mode: field_mode.unwrap_or(ListRevisionsMode::Path),
            limit: field_limit.unwrap_or(10),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("mode", &self.mode)?;
        s.serialize_field("limit", &self.limit)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ListRevisionsArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ListRevisionsArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListRevisionsArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ListRevisionsArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ListRevisionsArg", LIST_REVISIONS_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ListRevisionsArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ListRevisionsArg", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum ListRevisionsError {
    Path(LookupError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for ListRevisionsError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ListRevisionsError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListRevisionsError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(ListRevisionsError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ListRevisionsError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "other"];
        deserializer.deserialize_struct("ListRevisionsError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ListRevisionsError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ListRevisionsError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("ListRevisionsError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            ListRevisionsError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for ListRevisionsError {
    fn description(&self) -> &str {
        "ListRevisionsError"
    }
}
impl ::std::fmt::Display for ListRevisionsError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum ListRevisionsMode {
    
    
    Path,
    
    
    Id,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for ListRevisionsMode {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ListRevisionsMode;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListRevisionsMode structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ListRevisionsMode::Path)
                    }
                    "id" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ListRevisionsMode::Id)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ListRevisionsMode::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "id",
                                    "other"];
        deserializer.deserialize_struct("ListRevisionsMode", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ListRevisionsMode {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ListRevisionsMode::Path => {
                
                let mut s = serializer.serialize_struct("ListRevisionsMode", 1)?;
                s.serialize_field(".tag", "path")?;
                s.end()
            }
            ListRevisionsMode::Id => {
                
                let mut s = serializer.serialize_struct("ListRevisionsMode", 1)?;
                s.serialize_field(".tag", "id")?;
                s.end()
            }
            ListRevisionsMode::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ListRevisionsResult {
    
    pub is_deleted: bool,
    
    pub entries: Vec<FileMetadata>,
    
    pub server_deleted: Option<super::common::DropboxTimestamp>,
}
impl ListRevisionsResult {
    pub fn new(is_deleted: bool, entries: Vec<FileMetadata>) -> Self {
        ListRevisionsResult {
            is_deleted,
            entries,
            server_deleted: None,
        }
    }
    pub fn with_server_deleted(mut self, value: super::common::DropboxTimestamp) -> Self {
        self.server_deleted = Some(value);
        self
    }
}
const LIST_REVISIONS_RESULT_FIELDS: &[&str] = &["is_deleted",
                                                "entries",
                                                "server_deleted"];
impl ListRevisionsResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ListRevisionsResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ListRevisionsResult>, V::Error> {
        let mut field_is_deleted = None;
        let mut field_entries = None;
        let mut field_server_deleted = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "is_deleted" => {
                    if field_is_deleted.is_some() {
                        return Err(::serde::de::Error::duplicate_field("is_deleted"));
                    }
                    field_is_deleted = Some(map.next_value()?);
                }
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                "server_deleted" => {
                    if field_server_deleted.is_some() {
                        return Err(::serde::de::Error::duplicate_field("server_deleted"));
                    }
                    field_server_deleted = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ListRevisionsResult {
            is_deleted: field_is_deleted.ok_or_else(|| ::serde::de::Error::missing_field("is_deleted"))?,
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
            server_deleted: field_server_deleted,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("is_deleted", &self.is_deleted)?;
        s.serialize_field("entries", &self.entries)?;
        s.serialize_field("server_deleted", &self.server_deleted)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ListRevisionsResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ListRevisionsResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ListRevisionsResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ListRevisionsResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ListRevisionsResult", LIST_REVISIONS_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ListRevisionsResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ListRevisionsResult", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct LockConflictError {
    
    pub lock: FileLock,
}
impl LockConflictError {
    pub fn new(lock: FileLock) -> Self {
        LockConflictError {
            lock,
        }
    }
}
const LOCK_CONFLICT_ERROR_FIELDS: &[&str] = &["lock"];
impl LockConflictError {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<LockConflictError, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<LockConflictError>, V::Error> {
        let mut field_lock = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "lock" => {
                    if field_lock.is_some() {
                        return Err(::serde::de::Error::duplicate_field("lock"));
                    }
                    field_lock = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = LockConflictError {
            lock: field_lock.ok_or_else(|| ::serde::de::Error::missing_field("lock"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("lock", &self.lock)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for LockConflictError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = LockConflictError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a LockConflictError struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                LockConflictError::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("LockConflictError", LOCK_CONFLICT_ERROR_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for LockConflictError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("LockConflictError", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct LockFileArg {
    
    pub path: WritePathOrId,
}
impl LockFileArg {
    pub fn new(path: WritePathOrId) -> Self {
        LockFileArg {
            path,
        }
    }
}
const LOCK_FILE_ARG_FIELDS: &[&str] = &["path"];
impl LockFileArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<LockFileArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<LockFileArg>, V::Error> {
        let mut field_path = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = LockFileArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for LockFileArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = LockFileArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a LockFileArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                LockFileArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("LockFileArg", LOCK_FILE_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for LockFileArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("LockFileArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct LockFileBatchArg {
    
    
    pub entries: Vec<LockFileArg>,
}
impl LockFileBatchArg {
    pub fn new(entries: Vec<LockFileArg>) -> Self {
        LockFileBatchArg {
            entries,
        }
    }
}
const LOCK_FILE_BATCH_ARG_FIELDS: &[&str] = &["entries"];
impl LockFileBatchArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<LockFileBatchArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<LockFileBatchArg>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = LockFileBatchArg {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for LockFileBatchArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = LockFileBatchArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a LockFileBatchArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                LockFileBatchArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("LockFileBatchArg", LOCK_FILE_BATCH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for LockFileBatchArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("LockFileBatchArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct LockFileBatchResult {
    
    
    pub entries: Vec<LockFileResultEntry>,
}
impl LockFileBatchResult {
    pub fn new(entries: Vec<LockFileResultEntry>) -> Self {
        LockFileBatchResult {
            entries,
        }
    }
}
const LOCK_FILE_BATCH_RESULT_FIELDS: &[&str] = &["entries"];
impl LockFileBatchResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<LockFileBatchResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<LockFileBatchResult>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = LockFileBatchResult {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for LockFileBatchResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = LockFileBatchResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a LockFileBatchResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                LockFileBatchResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("LockFileBatchResult", LOCK_FILE_BATCH_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for LockFileBatchResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("LockFileBatchResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum LockFileError {
    
    PathLookup(LookupError),
    
    TooManyWriteOperations,
    
    TooManyFiles,
    
    NoWritePermission,
    
    CannotBeLocked,
    
    FileNotShared,
    
    LockConflict(LockConflictError),
    
    
    InternalError,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for LockFileError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = LockFileError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a LockFileError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path_lookup" => {
                        match map.next_key()? {
                            Some("path_lookup") => Ok(LockFileError::PathLookup(map.next_value()?)),
                            None => Err(de::Error::missing_field("path_lookup")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "too_many_write_operations" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LockFileError::TooManyWriteOperations)
                    }
                    "too_many_files" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LockFileError::TooManyFiles)
                    }
                    "no_write_permission" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LockFileError::NoWritePermission)
                    }
                    "cannot_be_locked" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LockFileError::CannotBeLocked)
                    }
                    "file_not_shared" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LockFileError::FileNotShared)
                    }
                    "lock_conflict" => Ok(LockFileError::LockConflict(LockConflictError::internal_deserialize(map)?)),
                    "internal_error" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LockFileError::InternalError)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LockFileError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path_lookup",
                                    "too_many_write_operations",
                                    "too_many_files",
                                    "no_write_permission",
                                    "cannot_be_locked",
                                    "file_not_shared",
                                    "lock_conflict",
                                    "internal_error",
                                    "other"];
        deserializer.deserialize_struct("LockFileError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for LockFileError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            LockFileError::PathLookup(ref x) => {
                
                let mut s = serializer.serialize_struct("LockFileError", 2)?;
                s.serialize_field(".tag", "path_lookup")?;
                s.serialize_field("path_lookup", x)?;
                s.end()
            }
            LockFileError::TooManyWriteOperations => {
                
                let mut s = serializer.serialize_struct("LockFileError", 1)?;
                s.serialize_field(".tag", "too_many_write_operations")?;
                s.end()
            }
            LockFileError::TooManyFiles => {
                
                let mut s = serializer.serialize_struct("LockFileError", 1)?;
                s.serialize_field(".tag", "too_many_files")?;
                s.end()
            }
            LockFileError::NoWritePermission => {
                
                let mut s = serializer.serialize_struct("LockFileError", 1)?;
                s.serialize_field(".tag", "no_write_permission")?;
                s.end()
            }
            LockFileError::CannotBeLocked => {
                
                let mut s = serializer.serialize_struct("LockFileError", 1)?;
                s.serialize_field(".tag", "cannot_be_locked")?;
                s.end()
            }
            LockFileError::FileNotShared => {
                
                let mut s = serializer.serialize_struct("LockFileError", 1)?;
                s.serialize_field(".tag", "file_not_shared")?;
                s.end()
            }
            LockFileError::LockConflict(ref x) => {
                
                let mut s = serializer.serialize_struct("LockFileError", 2)?;
                s.serialize_field(".tag", "lock_conflict")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            LockFileError::InternalError => {
                
                let mut s = serializer.serialize_struct("LockFileError", 1)?;
                s.serialize_field(".tag", "internal_error")?;
                s.end()
            }
            LockFileError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for LockFileError {
    fn description(&self) -> &str {
        "LockFileError"
    }
}
impl ::std::fmt::Display for LockFileError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct LockFileResult {
    
    pub metadata: Metadata,
    
    pub lock: FileLock,
}
impl LockFileResult {
    pub fn new(metadata: Metadata, lock: FileLock) -> Self {
        LockFileResult {
            metadata,
            lock,
        }
    }
}
const LOCK_FILE_RESULT_FIELDS: &[&str] = &["metadata",
                                           "lock"];
impl LockFileResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<LockFileResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<LockFileResult>, V::Error> {
        let mut field_metadata = None;
        let mut field_lock = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                "lock" => {
                    if field_lock.is_some() {
                        return Err(::serde::de::Error::duplicate_field("lock"));
                    }
                    field_lock = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = LockFileResult {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
            lock: field_lock.ok_or_else(|| ::serde::de::Error::missing_field("lock"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)?;
        s.serialize_field("lock", &self.lock)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for LockFileResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = LockFileResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a LockFileResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                LockFileResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("LockFileResult", LOCK_FILE_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for LockFileResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("LockFileResult", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum LockFileResultEntry {
    Success(LockFileResult),
    Failure(LockFileError),
}
impl<'de> ::serde::de::Deserialize<'de> for LockFileResultEntry {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = LockFileResultEntry;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a LockFileResultEntry structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "success" => Ok(LockFileResultEntry::Success(LockFileResult::internal_deserialize(map)?)),
                    "failure" => {
                        match map.next_key()? {
                            Some("failure") => Ok(LockFileResultEntry::Failure(map.next_value()?)),
                            None => Err(de::Error::missing_field("failure")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["success",
                                    "failure"];
        deserializer.deserialize_struct("LockFileResultEntry", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for LockFileResultEntry {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            LockFileResultEntry::Success(ref x) => {
                
                let mut s = serializer.serialize_struct("LockFileResultEntry", 3)?;
                s.serialize_field(".tag", "success")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            LockFileResultEntry::Failure(ref x) => {
                
                let mut s = serializer.serialize_struct("LockFileResultEntry", 2)?;
                s.serialize_field(".tag", "failure")?;
                s.serialize_field("failure", x)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum LookupError {
    
    
    
    MalformedPath(MalformedPathError),
    
    NotFound,
    
    NotFile,
    
    NotFolder,
    
    
    RestrictedContent,
    
    UnsupportedContentType,
    
    Locked,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for LookupError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = LookupError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a LookupError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "malformed_path" => {
                        match map.next_key()? {
                            Some("malformed_path") => Ok(LookupError::MalformedPath(map.next_value()?)),
                            None => Ok(LookupError::MalformedPath(None)),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "not_found" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LookupError::NotFound)
                    }
                    "not_file" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LookupError::NotFile)
                    }
                    "not_folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LookupError::NotFolder)
                    }
                    "restricted_content" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LookupError::RestrictedContent)
                    }
                    "unsupported_content_type" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LookupError::UnsupportedContentType)
                    }
                    "locked" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LookupError::Locked)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(LookupError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["malformed_path",
                                    "not_found",
                                    "not_file",
                                    "not_folder",
                                    "restricted_content",
                                    "unsupported_content_type",
                                    "locked",
                                    "other"];
        deserializer.deserialize_struct("LookupError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for LookupError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            LookupError::MalformedPath(ref x) => {
                
                let n = if x.is_some() { 2 } else { 1 };
                let mut s = serializer.serialize_struct("LookupError", n)?;
                s.serialize_field(".tag", "malformed_path")?;
                if let Some(ref x) = x {
                    s.serialize_field("malformed_path", &x)?;
                }
                s.end()
            }
            LookupError::NotFound => {
                
                let mut s = serializer.serialize_struct("LookupError", 1)?;
                s.serialize_field(".tag", "not_found")?;
                s.end()
            }
            LookupError::NotFile => {
                
                let mut s = serializer.serialize_struct("LookupError", 1)?;
                s.serialize_field(".tag", "not_file")?;
                s.end()
            }
            LookupError::NotFolder => {
                
                let mut s = serializer.serialize_struct("LookupError", 1)?;
                s.serialize_field(".tag", "not_folder")?;
                s.end()
            }
            LookupError::RestrictedContent => {
                
                let mut s = serializer.serialize_struct("LookupError", 1)?;
                s.serialize_field(".tag", "restricted_content")?;
                s.end()
            }
            LookupError::UnsupportedContentType => {
                
                let mut s = serializer.serialize_struct("LookupError", 1)?;
                s.serialize_field(".tag", "unsupported_content_type")?;
                s.end()
            }
            LookupError::Locked => {
                
                let mut s = serializer.serialize_struct("LookupError", 1)?;
                s.serialize_field(".tag", "locked")?;
                s.end()
            }
            LookupError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for LookupError {
    fn description(&self) -> &str {
        "LookupError"
    }
}
impl ::std::fmt::Display for LookupError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum MediaInfo {
    
    Pending,
    
    Metadata(MediaMetadata),
}
impl<'de> ::serde::de::Deserialize<'de> for MediaInfo {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = MediaInfo;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a MediaInfo structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "pending" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(MediaInfo::Pending)
                    }
                    "metadata" => {
                        match map.next_key()? {
                            Some("metadata") => Ok(MediaInfo::Metadata(map.next_value()?)),
                            None => Err(de::Error::missing_field("metadata")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["pending",
                                    "metadata"];
        deserializer.deserialize_struct("MediaInfo", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for MediaInfo {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            MediaInfo::Pending => {
                
                let mut s = serializer.serialize_struct("MediaInfo", 1)?;
                s.serialize_field(".tag", "pending")?;
                s.end()
            }
            MediaInfo::Metadata(ref x) => {
                
                let mut s = serializer.serialize_struct("MediaInfo", 2)?;
                s.serialize_field(".tag", "metadata")?;
                s.serialize_field("metadata", x)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum MediaMetadata {
    Photo(PhotoMetadata),
    Video(VideoMetadata),
}
impl<'de> ::serde::de::Deserialize<'de> for MediaMetadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = MediaMetadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a MediaMetadata structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "photo" => Ok(MediaMetadata::Photo(PhotoMetadata::internal_deserialize(map)?)),
                    "video" => Ok(MediaMetadata::Video(VideoMetadata::internal_deserialize(map)?)),
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["photo",
                                    "video"];
        deserializer.deserialize_struct("MediaMetadata", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for MediaMetadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            MediaMetadata::Photo(ref x) => {
                let mut s = serializer.serialize_struct("MediaMetadata", 4)?;
                s.serialize_field(".tag", "photo")?;
                s.serialize_field("dimensions", &x.dimensions)?;
                s.serialize_field("location", &x.location)?;
                s.serialize_field("time_taken", &x.time_taken)?;
                s.end()
            }
            MediaMetadata::Video(ref x) => {
                let mut s = serializer.serialize_struct("MediaMetadata", 5)?;
                s.serialize_field(".tag", "video")?;
                s.serialize_field("dimensions", &x.dimensions)?;
                s.serialize_field("location", &x.location)?;
                s.serialize_field("time_taken", &x.time_taken)?;
                s.serialize_field("duration", &x.duration)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum Metadata {
    File(FileMetadata),
    Folder(FolderMetadata),
    Deleted(DeletedMetadata),
}
impl<'de> ::serde::de::Deserialize<'de> for Metadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = Metadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a Metadata structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "file" => Ok(Metadata::File(FileMetadata::internal_deserialize(map)?)),
                    "folder" => Ok(Metadata::Folder(FolderMetadata::internal_deserialize(map)?)),
                    "deleted" => Ok(Metadata::Deleted(DeletedMetadata::internal_deserialize(map)?)),
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["file",
                                    "folder",
                                    "deleted"];
        deserializer.deserialize_struct("Metadata", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for Metadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            Metadata::File(ref x) => {
                let mut s = serializer.serialize_struct("Metadata", 19)?;
                s.serialize_field(".tag", "file")?;
                s.serialize_field("name", &x.name)?;
                s.serialize_field("id", &x.id)?;
                s.serialize_field("client_modified", &x.client_modified)?;
                s.serialize_field("server_modified", &x.server_modified)?;
                s.serialize_field("rev", &x.rev)?;
                s.serialize_field("size", &x.size)?;
                s.serialize_field("path_lower", &x.path_lower)?;
                s.serialize_field("path_display", &x.path_display)?;
                s.serialize_field("parent_shared_folder_id", &x.parent_shared_folder_id)?;
                s.serialize_field("media_info", &x.media_info)?;
                s.serialize_field("symlink_info", &x.symlink_info)?;
                s.serialize_field("sharing_info", &x.sharing_info)?;
                s.serialize_field("is_downloadable", &x.is_downloadable)?;
                s.serialize_field("export_info", &x.export_info)?;
                s.serialize_field("property_groups", &x.property_groups)?;
                s.serialize_field("has_explicit_shared_members", &x.has_explicit_shared_members)?;
                s.serialize_field("content_hash", &x.content_hash)?;
                s.serialize_field("file_lock_info", &x.file_lock_info)?;
                s.end()
            }
            Metadata::Folder(ref x) => {
                let mut s = serializer.serialize_struct("Metadata", 9)?;
                s.serialize_field(".tag", "folder")?;
                s.serialize_field("name", &x.name)?;
                s.serialize_field("id", &x.id)?;
                s.serialize_field("path_lower", &x.path_lower)?;
                s.serialize_field("path_display", &x.path_display)?;
                s.serialize_field("parent_shared_folder_id", &x.parent_shared_folder_id)?;
                s.serialize_field("shared_folder_id", &x.shared_folder_id)?;
                s.serialize_field("sharing_info", &x.sharing_info)?;
                s.serialize_field("property_groups", &x.property_groups)?;
                s.end()
            }
            Metadata::Deleted(ref x) => {
                let mut s = serializer.serialize_struct("Metadata", 5)?;
                s.serialize_field(".tag", "deleted")?;
                s.serialize_field("name", &x.name)?;
                s.serialize_field("path_lower", &x.path_lower)?;
                s.serialize_field("path_display", &x.path_display)?;
                s.serialize_field("parent_shared_folder_id", &x.parent_shared_folder_id)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum MetadataV2 {
    Metadata(Metadata),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for MetadataV2 {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = MetadataV2;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a MetadataV2 structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "metadata" => {
                        match map.next_key()? {
                            Some("metadata") => Ok(MetadataV2::Metadata(map.next_value()?)),
                            None => Err(de::Error::missing_field("metadata")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(MetadataV2::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["metadata",
                                    "other"];
        deserializer.deserialize_struct("MetadataV2", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for MetadataV2 {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            MetadataV2::Metadata(ref x) => {
                
                let mut s = serializer.serialize_struct("MetadataV2", 2)?;
                s.serialize_field(".tag", "metadata")?;
                s.serialize_field("metadata", x)?;
                s.end()
            }
            MetadataV2::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct MinimalFileLinkMetadata {
    
    pub url: String,
    
    
    pub rev: Rev,
    
    pub id: Option<Id>,
    
    
    pub path: Option<String>,
}
impl MinimalFileLinkMetadata {
    pub fn new(url: String, rev: Rev) -> Self {
        MinimalFileLinkMetadata {
            url,
            rev,
            id: None,
            path: None,
        }
    }
    pub fn with_id(mut self, value: Id) -> Self {
        self.id = Some(value);
        self
    }
    pub fn with_path(mut self, value: String) -> Self {
        self.path = Some(value);
        self
    }
}
const MINIMAL_FILE_LINK_METADATA_FIELDS: &[&str] = &["url",
                                                     "rev",
                                                     "id",
                                                     "path"];
impl MinimalFileLinkMetadata {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<MinimalFileLinkMetadata, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<MinimalFileLinkMetadata>, V::Error> {
        let mut field_url = None;
        let mut field_rev = None;
        let mut field_id = None;
        let mut field_path = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "url" => {
                    if field_url.is_some() {
                        return Err(::serde::de::Error::duplicate_field("url"));
                    }
                    field_url = Some(map.next_value()?);
                }
                "rev" => {
                    if field_rev.is_some() {
                        return Err(::serde::de::Error::duplicate_field("rev"));
                    }
                    field_rev = Some(map.next_value()?);
                }
                "id" => {
                    if field_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("id"));
                    }
                    field_id = Some(map.next_value()?);
                }
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = MinimalFileLinkMetadata {
            url: field_url.ok_or_else(|| ::serde::de::Error::missing_field("url"))?,
            rev: field_rev.ok_or_else(|| ::serde::de::Error::missing_field("rev"))?,
            id: field_id,
            path: field_path,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("url", &self.url)?;
        s.serialize_field("rev", &self.rev)?;
        s.serialize_field("id", &self.id)?;
        s.serialize_field("path", &self.path)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for MinimalFileLinkMetadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = MinimalFileLinkMetadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a MinimalFileLinkMetadata struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                MinimalFileLinkMetadata::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("MinimalFileLinkMetadata", MINIMAL_FILE_LINK_METADATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for MinimalFileLinkMetadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("MinimalFileLinkMetadata", 4)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct MoveBatchArg {
    
    pub entries: Vec<RelocationPath>,
    
    
    pub autorename: bool,
    
    
    pub allow_ownership_transfer: bool,
}
impl MoveBatchArg {
    pub fn new(entries: Vec<RelocationPath>) -> Self {
        MoveBatchArg {
            entries,
            autorename: false,
            allow_ownership_transfer: false,
        }
    }
    pub fn with_autorename(mut self, value: bool) -> Self {
        self.autorename = value;
        self
    }
    pub fn with_allow_ownership_transfer(mut self, value: bool) -> Self {
        self.allow_ownership_transfer = value;
        self
    }
}
const MOVE_BATCH_ARG_FIELDS: &[&str] = &["entries",
                                         "autorename",
                                         "allow_ownership_transfer"];
impl MoveBatchArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<MoveBatchArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<MoveBatchArg>, V::Error> {
        let mut field_entries = None;
        let mut field_autorename = None;
        let mut field_allow_ownership_transfer = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                "autorename" => {
                    if field_autorename.is_some() {
                        return Err(::serde::de::Error::duplicate_field("autorename"));
                    }
                    field_autorename = Some(map.next_value()?);
                }
                "allow_ownership_transfer" => {
                    if field_allow_ownership_transfer.is_some() {
                        return Err(::serde::de::Error::duplicate_field("allow_ownership_transfer"));
                    }
                    field_allow_ownership_transfer = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = MoveBatchArg {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
            autorename: field_autorename.unwrap_or(false),
            allow_ownership_transfer: field_allow_ownership_transfer.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)?;
        s.serialize_field("autorename", &self.autorename)?;
        s.serialize_field("allow_ownership_transfer", &self.allow_ownership_transfer)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for MoveBatchArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = MoveBatchArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a MoveBatchArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                MoveBatchArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("MoveBatchArg", MOVE_BATCH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for MoveBatchArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("MoveBatchArg", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum MoveIntoVaultError {
    
    IsSharedFolder,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for MoveIntoVaultError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = MoveIntoVaultError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a MoveIntoVaultError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "is_shared_folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(MoveIntoVaultError::IsSharedFolder)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(MoveIntoVaultError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["is_shared_folder",
                                    "other"];
        deserializer.deserialize_struct("MoveIntoVaultError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for MoveIntoVaultError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            MoveIntoVaultError::IsSharedFolder => {
                
                let mut s = serializer.serialize_struct("MoveIntoVaultError", 1)?;
                s.serialize_field(".tag", "is_shared_folder")?;
                s.end()
            }
            MoveIntoVaultError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for MoveIntoVaultError {
    fn description(&self) -> &str {
        "MoveIntoVaultError"
    }
}
impl ::std::fmt::Display for MoveIntoVaultError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum PathOrLink {
    Path(ReadPath),
    Link(SharedLinkFileInfo),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for PathOrLink {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = PathOrLink;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a PathOrLink structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(PathOrLink::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "link" => Ok(PathOrLink::Link(SharedLinkFileInfo::internal_deserialize(map)?)),
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(PathOrLink::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "link",
                                    "other"];
        deserializer.deserialize_struct("PathOrLink", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for PathOrLink {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            PathOrLink::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("PathOrLink", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            PathOrLink::Link(ref x) => {
                
                let mut s = serializer.serialize_struct("PathOrLink", 4)?;
                s.serialize_field(".tag", "link")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            PathOrLink::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct PhotoMetadata {
    
    pub dimensions: Option<Dimensions>,
    
    pub location: Option<GpsCoordinates>,
    
    pub time_taken: Option<super::common::DropboxTimestamp>,
}
impl Default for PhotoMetadata {
    fn default() -> Self {
        PhotoMetadata {
            dimensions: None,
            location: None,
            time_taken: None,
        }
    }
}
impl PhotoMetadata {
    pub fn with_dimensions(mut self, value: Dimensions) -> Self {
        self.dimensions = Some(value);
        self
    }
    pub fn with_location(mut self, value: GpsCoordinates) -> Self {
        self.location = Some(value);
        self
    }
    pub fn with_time_taken(mut self, value: super::common::DropboxTimestamp) -> Self {
        self.time_taken = Some(value);
        self
    }
}
const PHOTO_METADATA_FIELDS: &[&str] = &["dimensions",
                                         "location",
                                         "time_taken"];
impl PhotoMetadata {
    
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
    ) -> Result<PhotoMetadata, V::Error> {
        let mut field_dimensions = None;
        let mut field_location = None;
        let mut field_time_taken = None;
        while let Some(key) = map.next_key::<&str>()? {
            match key {
                "dimensions" => {
                    if field_dimensions.is_some() {
                        return Err(::serde::de::Error::duplicate_field("dimensions"));
                    }
                    field_dimensions = Some(map.next_value()?);
                }
                "location" => {
                    if field_location.is_some() {
                        return Err(::serde::de::Error::duplicate_field("location"));
                    }
                    field_location = Some(map.next_value()?);
                }
                "time_taken" => {
                    if field_time_taken.is_some() {
                        return Err(::serde::de::Error::duplicate_field("time_taken"));
                    }
                    field_time_taken = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        let result = PhotoMetadata {
            dimensions: field_dimensions,
            location: field_location,
            time_taken: field_time_taken,
        };
        Ok(result)
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("dimensions", &self.dimensions)?;
        s.serialize_field("location", &self.location)?;
        s.serialize_field("time_taken", &self.time_taken)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for PhotoMetadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = PhotoMetadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a PhotoMetadata struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                PhotoMetadata::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("PhotoMetadata", PHOTO_METADATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for PhotoMetadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("PhotoMetadata", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct PreviewArg {
    
    pub path: ReadPath,
    
    pub rev: Option<Rev>,
}
impl PreviewArg {
    pub fn new(path: ReadPath) -> Self {
        PreviewArg {
            path,
            rev: None,
        }
    }
    pub fn with_rev(mut self, value: Rev) -> Self {
        self.rev = Some(value);
        self
    }
}
const PREVIEW_ARG_FIELDS: &[&str] = &["path",
                                      "rev"];
impl PreviewArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<PreviewArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<PreviewArg>, V::Error> {
        let mut field_path = None;
        let mut field_rev = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "rev" => {
                    if field_rev.is_some() {
                        return Err(::serde::de::Error::duplicate_field("rev"));
                    }
                    field_rev = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = PreviewArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            rev: field_rev,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("rev", &self.rev)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for PreviewArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = PreviewArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a PreviewArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                PreviewArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("PreviewArg", PREVIEW_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for PreviewArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("PreviewArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum PreviewError {
    
    Path(LookupError),
    
    InProgress,
    
    UnsupportedExtension,
    
    UnsupportedContent,
}
impl<'de> ::serde::de::Deserialize<'de> for PreviewError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = PreviewError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a PreviewError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(PreviewError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "in_progress" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(PreviewError::InProgress)
                    }
                    "unsupported_extension" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(PreviewError::UnsupportedExtension)
                    }
                    "unsupported_content" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(PreviewError::UnsupportedContent)
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "in_progress",
                                    "unsupported_extension",
                                    "unsupported_content"];
        deserializer.deserialize_struct("PreviewError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for PreviewError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            PreviewError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("PreviewError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            PreviewError::InProgress => {
                
                let mut s = serializer.serialize_struct("PreviewError", 1)?;
                s.serialize_field(".tag", "in_progress")?;
                s.end()
            }
            PreviewError::UnsupportedExtension => {
                
                let mut s = serializer.serialize_struct("PreviewError", 1)?;
                s.serialize_field(".tag", "unsupported_extension")?;
                s.end()
            }
            PreviewError::UnsupportedContent => {
                
                let mut s = serializer.serialize_struct("PreviewError", 1)?;
                s.serialize_field(".tag", "unsupported_content")?;
                s.end()
            }
        }
    }
}
impl ::std::error::Error for PreviewError {
    fn description(&self) -> &str {
        "PreviewError"
    }
}
impl ::std::fmt::Display for PreviewError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct PreviewResult {
    
    
    pub file_metadata: Option<FileMetadata>,
    
    
    pub link_metadata: Option<MinimalFileLinkMetadata>,
}
impl Default for PreviewResult {
    fn default() -> Self {
        PreviewResult {
            file_metadata: None,
            link_metadata: None,
        }
    }
}
impl PreviewResult {
    pub fn with_file_metadata(mut self, value: FileMetadata) -> Self {
        self.file_metadata = Some(value);
        self
    }
    pub fn with_link_metadata(mut self, value: MinimalFileLinkMetadata) -> Self {
        self.link_metadata = Some(value);
        self
    }
}
const PREVIEW_RESULT_FIELDS: &[&str] = &["file_metadata",
                                         "link_metadata"];
impl PreviewResult {
    
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
    ) -> Result<PreviewResult, V::Error> {
        let mut field_file_metadata = None;
        let mut field_link_metadata = None;
        while let Some(key) = map.next_key::<&str>()? {
            match key {
                "file_metadata" => {
                    if field_file_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("file_metadata"));
                    }
                    field_file_metadata = Some(map.next_value()?);
                }
                "link_metadata" => {
                    if field_link_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("link_metadata"));
                    }
                    field_link_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        let result = PreviewResult {
            file_metadata: field_file_metadata,
            link_metadata: field_link_metadata,
        };
        Ok(result)
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("file_metadata", &self.file_metadata)?;
        s.serialize_field("link_metadata", &self.link_metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for PreviewResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = PreviewResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a PreviewResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                PreviewResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("PreviewResult", PREVIEW_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for PreviewResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("PreviewResult", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct RelocationArg {
    
    pub from_path: WritePathOrId,
    
    pub to_path: WritePathOrId,
    
    pub allow_shared_folder: bool,
    
    
    pub autorename: bool,
    
    
    pub allow_ownership_transfer: bool,
}
impl RelocationArg {
    pub fn new(from_path: WritePathOrId, to_path: WritePathOrId) -> Self {
        RelocationArg {
            from_path,
            to_path,
            allow_shared_folder: false,
            autorename: false,
            allow_ownership_transfer: false,
        }
    }
    pub fn with_allow_shared_folder(mut self, value: bool) -> Self {
        self.allow_shared_folder = value;
        self
    }
    pub fn with_autorename(mut self, value: bool) -> Self {
        self.autorename = value;
        self
    }
    pub fn with_allow_ownership_transfer(mut self, value: bool) -> Self {
        self.allow_ownership_transfer = value;
        self
    }
}
const RELOCATION_ARG_FIELDS: &[&str] = &["from_path",
                                         "to_path",
                                         "allow_shared_folder",
                                         "autorename",
                                         "allow_ownership_transfer"];
impl RelocationArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<RelocationArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<RelocationArg>, V::Error> {
        let mut field_from_path = None;
        let mut field_to_path = None;
        let mut field_allow_shared_folder = None;
        let mut field_autorename = None;
        let mut field_allow_ownership_transfer = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "from_path" => {
                    if field_from_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("from_path"));
                    }
                    field_from_path = Some(map.next_value()?);
                }
                "to_path" => {
                    if field_to_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("to_path"));
                    }
                    field_to_path = Some(map.next_value()?);
                }
                "allow_shared_folder" => {
                    if field_allow_shared_folder.is_some() {
                        return Err(::serde::de::Error::duplicate_field("allow_shared_folder"));
                    }
                    field_allow_shared_folder = Some(map.next_value()?);
                }
                "autorename" => {
                    if field_autorename.is_some() {
                        return Err(::serde::de::Error::duplicate_field("autorename"));
                    }
                    field_autorename = Some(map.next_value()?);
                }
                "allow_ownership_transfer" => {
                    if field_allow_ownership_transfer.is_some() {
                        return Err(::serde::de::Error::duplicate_field("allow_ownership_transfer"));
                    }
                    field_allow_ownership_transfer = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = RelocationArg {
            from_path: field_from_path.ok_or_else(|| ::serde::de::Error::missing_field("from_path"))?,
            to_path: field_to_path.ok_or_else(|| ::serde::de::Error::missing_field("to_path"))?,
            allow_shared_folder: field_allow_shared_folder.unwrap_or(false),
            autorename: field_autorename.unwrap_or(false),
            allow_ownership_transfer: field_allow_ownership_transfer.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("from_path", &self.from_path)?;
        s.serialize_field("to_path", &self.to_path)?;
        s.serialize_field("allow_shared_folder", &self.allow_shared_folder)?;
        s.serialize_field("autorename", &self.autorename)?;
        s.serialize_field("allow_ownership_transfer", &self.allow_ownership_transfer)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = RelocationArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                RelocationArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("RelocationArg", RELOCATION_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("RelocationArg", 5)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct RelocationBatchArg {
    
    pub entries: Vec<RelocationPath>,
    
    
    pub autorename: bool,
    
    pub allow_shared_folder: bool,
    
    
    pub allow_ownership_transfer: bool,
}
impl RelocationBatchArg {
    pub fn new(entries: Vec<RelocationPath>) -> Self {
        RelocationBatchArg {
            entries,
            autorename: false,
            allow_shared_folder: false,
            allow_ownership_transfer: false,
        }
    }
    pub fn with_autorename(mut self, value: bool) -> Self {
        self.autorename = value;
        self
    }
    pub fn with_allow_shared_folder(mut self, value: bool) -> Self {
        self.allow_shared_folder = value;
        self
    }
    pub fn with_allow_ownership_transfer(mut self, value: bool) -> Self {
        self.allow_ownership_transfer = value;
        self
    }
}
const RELOCATION_BATCH_ARG_FIELDS: &[&str] = &["entries",
                                               "autorename",
                                               "allow_shared_folder",
                                               "allow_ownership_transfer"];
impl RelocationBatchArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<RelocationBatchArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<RelocationBatchArg>, V::Error> {
        let mut field_entries = None;
        let mut field_autorename = None;
        let mut field_allow_shared_folder = None;
        let mut field_allow_ownership_transfer = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                "autorename" => {
                    if field_autorename.is_some() {
                        return Err(::serde::de::Error::duplicate_field("autorename"));
                    }
                    field_autorename = Some(map.next_value()?);
                }
                "allow_shared_folder" => {
                    if field_allow_shared_folder.is_some() {
                        return Err(::serde::de::Error::duplicate_field("allow_shared_folder"));
                    }
                    field_allow_shared_folder = Some(map.next_value()?);
                }
                "allow_ownership_transfer" => {
                    if field_allow_ownership_transfer.is_some() {
                        return Err(::serde::de::Error::duplicate_field("allow_ownership_transfer"));
                    }
                    field_allow_ownership_transfer = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = RelocationBatchArg {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
            autorename: field_autorename.unwrap_or(false),
            allow_shared_folder: field_allow_shared_folder.unwrap_or(false),
            allow_ownership_transfer: field_allow_ownership_transfer.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)?;
        s.serialize_field("autorename", &self.autorename)?;
        s.serialize_field("allow_shared_folder", &self.allow_shared_folder)?;
        s.serialize_field("allow_ownership_transfer", &self.allow_ownership_transfer)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = RelocationBatchArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                RelocationBatchArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("RelocationBatchArg", RELOCATION_BATCH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("RelocationBatchArg", 4)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct RelocationBatchArgBase {
    
    pub entries: Vec<RelocationPath>,
    
    
    pub autorename: bool,
}
impl RelocationBatchArgBase {
    pub fn new(entries: Vec<RelocationPath>) -> Self {
        RelocationBatchArgBase {
            entries,
            autorename: false,
        }
    }
    pub fn with_autorename(mut self, value: bool) -> Self {
        self.autorename = value;
        self
    }
}
const RELOCATION_BATCH_ARG_BASE_FIELDS: &[&str] = &["entries",
                                                    "autorename"];
impl RelocationBatchArgBase {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<RelocationBatchArgBase, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<RelocationBatchArgBase>, V::Error> {
        let mut field_entries = None;
        let mut field_autorename = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                "autorename" => {
                    if field_autorename.is_some() {
                        return Err(::serde::de::Error::duplicate_field("autorename"));
                    }
                    field_autorename = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = RelocationBatchArgBase {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
            autorename: field_autorename.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)?;
        s.serialize_field("autorename", &self.autorename)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchArgBase {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = RelocationBatchArgBase;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchArgBase struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                RelocationBatchArgBase::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("RelocationBatchArgBase", RELOCATION_BATCH_ARG_BASE_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchArgBase {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("RelocationBatchArgBase", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum RelocationBatchError {
    FromLookup(LookupError),
    FromWrite(WriteError),
    To(WriteError),
    
    CantCopySharedFolder,
    
    CantNestSharedFolder,
    
    CantMoveFolderIntoItself,
    
    TooManyFiles,
    
    
    DuplicatedOrNestedPaths,
    
    
    CantTransferOwnership,
    
    InsufficientQuota,
    
    
    InternalError,
    
    CantMoveSharedFolder,
    
    CantMoveIntoVault(MoveIntoVaultError),
    
    TooManyWriteOperations,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = RelocationBatchError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "from_lookup" => {
                        match map.next_key()? {
                            Some("from_lookup") => Ok(RelocationBatchError::FromLookup(map.next_value()?)),
                            None => Err(de::Error::missing_field("from_lookup")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "from_write" => {
                        match map.next_key()? {
                            Some("from_write") => Ok(RelocationBatchError::FromWrite(map.next_value()?)),
                            None => Err(de::Error::missing_field("from_write")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "to" => {
                        match map.next_key()? {
                            Some("to") => Ok(RelocationBatchError::To(map.next_value()?)),
                            None => Err(de::Error::missing_field("to")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "cant_copy_shared_folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::CantCopySharedFolder)
                    }
                    "cant_nest_shared_folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::CantNestSharedFolder)
                    }
                    "cant_move_folder_into_itself" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::CantMoveFolderIntoItself)
                    }
                    "too_many_files" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::TooManyFiles)
                    }
                    "duplicated_or_nested_paths" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::DuplicatedOrNestedPaths)
                    }
                    "cant_transfer_ownership" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::CantTransferOwnership)
                    }
                    "insufficient_quota" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::InsufficientQuota)
                    }
                    "internal_error" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::InternalError)
                    }
                    "cant_move_shared_folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::CantMoveSharedFolder)
                    }
                    "cant_move_into_vault" => {
                        match map.next_key()? {
                            Some("cant_move_into_vault") => Ok(RelocationBatchError::CantMoveIntoVault(map.next_value()?)),
                            None => Err(de::Error::missing_field("cant_move_into_vault")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "too_many_write_operations" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::TooManyWriteOperations)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["from_lookup",
                                    "from_write",
                                    "to",
                                    "cant_copy_shared_folder",
                                    "cant_nest_shared_folder",
                                    "cant_move_folder_into_itself",
                                    "too_many_files",
                                    "duplicated_or_nested_paths",
                                    "cant_transfer_ownership",
                                    "insufficient_quota",
                                    "internal_error",
                                    "cant_move_shared_folder",
                                    "cant_move_into_vault",
                                    "other",
                                    "too_many_write_operations"];
        deserializer.deserialize_struct("RelocationBatchError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            RelocationBatchError::FromLookup(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 2)?;
                s.serialize_field(".tag", "from_lookup")?;
                s.serialize_field("from_lookup", x)?;
                s.end()
            }
            RelocationBatchError::FromWrite(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 2)?;
                s.serialize_field(".tag", "from_write")?;
                s.serialize_field("from_write", x)?;
                s.end()
            }
            RelocationBatchError::To(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 2)?;
                s.serialize_field(".tag", "to")?;
                s.serialize_field("to", x)?;
                s.end()
            }
            RelocationBatchError::CantCopySharedFolder => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "cant_copy_shared_folder")?;
                s.end()
            }
            RelocationBatchError::CantNestSharedFolder => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "cant_nest_shared_folder")?;
                s.end()
            }
            RelocationBatchError::CantMoveFolderIntoItself => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "cant_move_folder_into_itself")?;
                s.end()
            }
            RelocationBatchError::TooManyFiles => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "too_many_files")?;
                s.end()
            }
            RelocationBatchError::DuplicatedOrNestedPaths => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "duplicated_or_nested_paths")?;
                s.end()
            }
            RelocationBatchError::CantTransferOwnership => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "cant_transfer_ownership")?;
                s.end()
            }
            RelocationBatchError::InsufficientQuota => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "insufficient_quota")?;
                s.end()
            }
            RelocationBatchError::InternalError => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "internal_error")?;
                s.end()
            }
            RelocationBatchError::CantMoveSharedFolder => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "cant_move_shared_folder")?;
                s.end()
            }
            RelocationBatchError::CantMoveIntoVault(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 2)?;
                s.serialize_field(".tag", "cant_move_into_vault")?;
                s.serialize_field("cant_move_into_vault", x)?;
                s.end()
            }
            RelocationBatchError::TooManyWriteOperations => {
                
                let mut s = serializer.serialize_struct("RelocationBatchError", 1)?;
                s.serialize_field(".tag", "too_many_write_operations")?;
                s.end()
            }
            RelocationBatchError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for RelocationBatchError {
    fn description(&self) -> &str {
        "RelocationBatchError"
    }
}
impl ::std::fmt::Display for RelocationBatchError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum RelocationBatchErrorEntry {
    
    RelocationError(RelocationError),
    
    
    InternalError,
    
    TooManyWriteOperations,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchErrorEntry {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = RelocationBatchErrorEntry;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchErrorEntry structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "relocation_error" => {
                        match map.next_key()? {
                            Some("relocation_error") => Ok(RelocationBatchErrorEntry::RelocationError(map.next_value()?)),
                            None => Err(de::Error::missing_field("relocation_error")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "internal_error" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchErrorEntry::InternalError)
                    }
                    "too_many_write_operations" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchErrorEntry::TooManyWriteOperations)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchErrorEntry::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["relocation_error",
                                    "internal_error",
                                    "too_many_write_operations",
                                    "other"];
        deserializer.deserialize_struct("RelocationBatchErrorEntry", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchErrorEntry {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            RelocationBatchErrorEntry::RelocationError(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchErrorEntry", 2)?;
                s.serialize_field(".tag", "relocation_error")?;
                s.serialize_field("relocation_error", x)?;
                s.end()
            }
            RelocationBatchErrorEntry::InternalError => {
                
                let mut s = serializer.serialize_struct("RelocationBatchErrorEntry", 1)?;
                s.serialize_field(".tag", "internal_error")?;
                s.end()
            }
            RelocationBatchErrorEntry::TooManyWriteOperations => {
                
                let mut s = serializer.serialize_struct("RelocationBatchErrorEntry", 1)?;
                s.serialize_field(".tag", "too_many_write_operations")?;
                s.end()
            }
            RelocationBatchErrorEntry::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum RelocationBatchJobStatus {
    
    InProgress,
    
    Complete(RelocationBatchResult),
    
    Failed(RelocationBatchError),
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchJobStatus {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = RelocationBatchJobStatus;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchJobStatus structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "in_progress" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchJobStatus::InProgress)
                    }
                    "complete" => Ok(RelocationBatchJobStatus::Complete(RelocationBatchResult::internal_deserialize(map)?)),
                    "failed" => {
                        match map.next_key()? {
                            Some("failed") => Ok(RelocationBatchJobStatus::Failed(map.next_value()?)),
                            None => Err(de::Error::missing_field("failed")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["in_progress",
                                    "complete",
                                    "failed"];
        deserializer.deserialize_struct("RelocationBatchJobStatus", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchJobStatus {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            RelocationBatchJobStatus::InProgress => {
                
                let mut s = serializer.serialize_struct("RelocationBatchJobStatus", 1)?;
                s.serialize_field(".tag", "in_progress")?;
                s.end()
            }
            RelocationBatchJobStatus::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchJobStatus", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            RelocationBatchJobStatus::Failed(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchJobStatus", 2)?;
                s.serialize_field(".tag", "failed")?;
                s.serialize_field("failed", x)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum RelocationBatchLaunch {
    
    
    AsyncJobId(super::dbx_async::AsyncJobId),
    Complete(RelocationBatchResult),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchLaunch {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = RelocationBatchLaunch;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchLaunch structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "async_job_id" => {
                        match map.next_key()? {
                            Some("async_job_id") => Ok(RelocationBatchLaunch::AsyncJobId(map.next_value()?)),
                            None => Err(de::Error::missing_field("async_job_id")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "complete" => Ok(RelocationBatchLaunch::Complete(RelocationBatchResult::internal_deserialize(map)?)),
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchLaunch::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["async_job_id",
                                    "complete",
                                    "other"];
        deserializer.deserialize_struct("RelocationBatchLaunch", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchLaunch {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            RelocationBatchLaunch::AsyncJobId(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchLaunch", 2)?;
                s.serialize_field(".tag", "async_job_id")?;
                s.serialize_field("async_job_id", x)?;
                s.end()
            }
            RelocationBatchLaunch::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchLaunch", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            RelocationBatchLaunch::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct RelocationBatchResult {
    pub entries: Vec<RelocationBatchResultData>,
}
impl RelocationBatchResult {
    pub fn new(entries: Vec<RelocationBatchResultData>) -> Self {
        RelocationBatchResult {
            entries,
        }
    }
}
const RELOCATION_BATCH_RESULT_FIELDS: &[&str] = &["entries"];
impl RelocationBatchResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<RelocationBatchResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<RelocationBatchResult>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = RelocationBatchResult {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = RelocationBatchResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                RelocationBatchResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("RelocationBatchResult", RELOCATION_BATCH_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("RelocationBatchResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct RelocationBatchResultData {
    
    pub metadata: Metadata,
}
impl RelocationBatchResultData {
    pub fn new(metadata: Metadata) -> Self {
        RelocationBatchResultData {
            metadata,
        }
    }
}
const RELOCATION_BATCH_RESULT_DATA_FIELDS: &[&str] = &["metadata"];
impl RelocationBatchResultData {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<RelocationBatchResultData, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<RelocationBatchResultData>, V::Error> {
        let mut field_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = RelocationBatchResultData {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchResultData {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = RelocationBatchResultData;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchResultData struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                RelocationBatchResultData::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("RelocationBatchResultData", RELOCATION_BATCH_RESULT_DATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchResultData {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("RelocationBatchResultData", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum RelocationBatchResultEntry {
    Success(Metadata),
    Failure(RelocationBatchErrorEntry),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchResultEntry {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = RelocationBatchResultEntry;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchResultEntry structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "success" => {
                        match map.next_key()? {
                            Some("success") => Ok(RelocationBatchResultEntry::Success(map.next_value()?)),
                            None => Err(de::Error::missing_field("success")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "failure" => {
                        match map.next_key()? {
                            Some("failure") => Ok(RelocationBatchResultEntry::Failure(map.next_value()?)),
                            None => Err(de::Error::missing_field("failure")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchResultEntry::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["success",
                                    "failure",
                                    "other"];
        deserializer.deserialize_struct("RelocationBatchResultEntry", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchResultEntry {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            RelocationBatchResultEntry::Success(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchResultEntry", 2)?;
                s.serialize_field(".tag", "success")?;
                s.serialize_field("success", x)?;
                s.end()
            }
            RelocationBatchResultEntry::Failure(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchResultEntry", 2)?;
                s.serialize_field(".tag", "failure")?;
                s.serialize_field("failure", x)?;
                s.end()
            }
            RelocationBatchResultEntry::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum RelocationBatchV2JobStatus {
    
    InProgress,
    
    Complete(RelocationBatchV2Result),
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchV2JobStatus {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = RelocationBatchV2JobStatus;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchV2JobStatus structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "in_progress" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationBatchV2JobStatus::InProgress)
                    }
                    "complete" => Ok(RelocationBatchV2JobStatus::Complete(RelocationBatchV2Result::internal_deserialize(map)?)),
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["in_progress",
                                    "complete"];
        deserializer.deserialize_struct("RelocationBatchV2JobStatus", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchV2JobStatus {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            RelocationBatchV2JobStatus::InProgress => {
                
                let mut s = serializer.serialize_struct("RelocationBatchV2JobStatus", 1)?;
                s.serialize_field(".tag", "in_progress")?;
                s.end()
            }
            RelocationBatchV2JobStatus::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchV2JobStatus", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum RelocationBatchV2Launch {
    
    
    AsyncJobId(super::dbx_async::AsyncJobId),
    Complete(RelocationBatchV2Result),
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchV2Launch {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = RelocationBatchV2Launch;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchV2Launch structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "async_job_id" => {
                        match map.next_key()? {
                            Some("async_job_id") => Ok(RelocationBatchV2Launch::AsyncJobId(map.next_value()?)),
                            None => Err(de::Error::missing_field("async_job_id")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "complete" => Ok(RelocationBatchV2Launch::Complete(RelocationBatchV2Result::internal_deserialize(map)?)),
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["async_job_id",
                                    "complete"];
        deserializer.deserialize_struct("RelocationBatchV2Launch", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchV2Launch {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            RelocationBatchV2Launch::AsyncJobId(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchV2Launch", 2)?;
                s.serialize_field(".tag", "async_job_id")?;
                s.serialize_field("async_job_id", x)?;
                s.end()
            }
            RelocationBatchV2Launch::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationBatchV2Launch", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct RelocationBatchV2Result {
    
    
    pub entries: Vec<RelocationBatchResultEntry>,
}
impl RelocationBatchV2Result {
    pub fn new(entries: Vec<RelocationBatchResultEntry>) -> Self {
        RelocationBatchV2Result {
            entries,
        }
    }
}
const RELOCATION_BATCH_V2_RESULT_FIELDS: &[&str] = &["entries"];
impl RelocationBatchV2Result {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<RelocationBatchV2Result, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<RelocationBatchV2Result>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = RelocationBatchV2Result {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationBatchV2Result {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = RelocationBatchV2Result;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationBatchV2Result struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                RelocationBatchV2Result::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("RelocationBatchV2Result", RELOCATION_BATCH_V2_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationBatchV2Result {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("RelocationBatchV2Result", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum RelocationError {
    FromLookup(LookupError),
    FromWrite(WriteError),
    To(WriteError),
    
    CantCopySharedFolder,
    
    CantNestSharedFolder,
    
    CantMoveFolderIntoItself,
    
    TooManyFiles,
    
    
    DuplicatedOrNestedPaths,
    
    
    CantTransferOwnership,
    
    InsufficientQuota,
    
    
    InternalError,
    
    CantMoveSharedFolder,
    
    CantMoveIntoVault(MoveIntoVaultError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = RelocationError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "from_lookup" => {
                        match map.next_key()? {
                            Some("from_lookup") => Ok(RelocationError::FromLookup(map.next_value()?)),
                            None => Err(de::Error::missing_field("from_lookup")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "from_write" => {
                        match map.next_key()? {
                            Some("from_write") => Ok(RelocationError::FromWrite(map.next_value()?)),
                            None => Err(de::Error::missing_field("from_write")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "to" => {
                        match map.next_key()? {
                            Some("to") => Ok(RelocationError::To(map.next_value()?)),
                            None => Err(de::Error::missing_field("to")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "cant_copy_shared_folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::CantCopySharedFolder)
                    }
                    "cant_nest_shared_folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::CantNestSharedFolder)
                    }
                    "cant_move_folder_into_itself" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::CantMoveFolderIntoItself)
                    }
                    "too_many_files" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::TooManyFiles)
                    }
                    "duplicated_or_nested_paths" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::DuplicatedOrNestedPaths)
                    }
                    "cant_transfer_ownership" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::CantTransferOwnership)
                    }
                    "insufficient_quota" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::InsufficientQuota)
                    }
                    "internal_error" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::InternalError)
                    }
                    "cant_move_shared_folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::CantMoveSharedFolder)
                    }
                    "cant_move_into_vault" => {
                        match map.next_key()? {
                            Some("cant_move_into_vault") => Ok(RelocationError::CantMoveIntoVault(map.next_value()?)),
                            None => Err(de::Error::missing_field("cant_move_into_vault")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RelocationError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["from_lookup",
                                    "from_write",
                                    "to",
                                    "cant_copy_shared_folder",
                                    "cant_nest_shared_folder",
                                    "cant_move_folder_into_itself",
                                    "too_many_files",
                                    "duplicated_or_nested_paths",
                                    "cant_transfer_ownership",
                                    "insufficient_quota",
                                    "internal_error",
                                    "cant_move_shared_folder",
                                    "cant_move_into_vault",
                                    "other"];
        deserializer.deserialize_struct("RelocationError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            RelocationError::FromLookup(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationError", 2)?;
                s.serialize_field(".tag", "from_lookup")?;
                s.serialize_field("from_lookup", x)?;
                s.end()
            }
            RelocationError::FromWrite(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationError", 2)?;
                s.serialize_field(".tag", "from_write")?;
                s.serialize_field("from_write", x)?;
                s.end()
            }
            RelocationError::To(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationError", 2)?;
                s.serialize_field(".tag", "to")?;
                s.serialize_field("to", x)?;
                s.end()
            }
            RelocationError::CantCopySharedFolder => {
                
                let mut s = serializer.serialize_struct("RelocationError", 1)?;
                s.serialize_field(".tag", "cant_copy_shared_folder")?;
                s.end()
            }
            RelocationError::CantNestSharedFolder => {
                
                let mut s = serializer.serialize_struct("RelocationError", 1)?;
                s.serialize_field(".tag", "cant_nest_shared_folder")?;
                s.end()
            }
            RelocationError::CantMoveFolderIntoItself => {
                
                let mut s = serializer.serialize_struct("RelocationError", 1)?;
                s.serialize_field(".tag", "cant_move_folder_into_itself")?;
                s.end()
            }
            RelocationError::TooManyFiles => {
                
                let mut s = serializer.serialize_struct("RelocationError", 1)?;
                s.serialize_field(".tag", "too_many_files")?;
                s.end()
            }
            RelocationError::DuplicatedOrNestedPaths => {
                
                let mut s = serializer.serialize_struct("RelocationError", 1)?;
                s.serialize_field(".tag", "duplicated_or_nested_paths")?;
                s.end()
            }
            RelocationError::CantTransferOwnership => {
                
                let mut s = serializer.serialize_struct("RelocationError", 1)?;
                s.serialize_field(".tag", "cant_transfer_ownership")?;
                s.end()
            }
            RelocationError::InsufficientQuota => {
                
                let mut s = serializer.serialize_struct("RelocationError", 1)?;
                s.serialize_field(".tag", "insufficient_quota")?;
                s.end()
            }
            RelocationError::InternalError => {
                
                let mut s = serializer.serialize_struct("RelocationError", 1)?;
                s.serialize_field(".tag", "internal_error")?;
                s.end()
            }
            RelocationError::CantMoveSharedFolder => {
                
                let mut s = serializer.serialize_struct("RelocationError", 1)?;
                s.serialize_field(".tag", "cant_move_shared_folder")?;
                s.end()
            }
            RelocationError::CantMoveIntoVault(ref x) => {
                
                let mut s = serializer.serialize_struct("RelocationError", 2)?;
                s.serialize_field(".tag", "cant_move_into_vault")?;
                s.serialize_field("cant_move_into_vault", x)?;
                s.end()
            }
            RelocationError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for RelocationError {
    fn description(&self) -> &str {
        "RelocationError"
    }
}
impl ::std::fmt::Display for RelocationError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct RelocationPath {
    
    pub from_path: WritePathOrId,
    
    pub to_path: WritePathOrId,
}
impl RelocationPath {
    pub fn new(from_path: WritePathOrId, to_path: WritePathOrId) -> Self {
        RelocationPath {
            from_path,
            to_path,
        }
    }
}
const RELOCATION_PATH_FIELDS: &[&str] = &["from_path",
                                          "to_path"];
impl RelocationPath {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<RelocationPath, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<RelocationPath>, V::Error> {
        let mut field_from_path = None;
        let mut field_to_path = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "from_path" => {
                    if field_from_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("from_path"));
                    }
                    field_from_path = Some(map.next_value()?);
                }
                "to_path" => {
                    if field_to_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("to_path"));
                    }
                    field_to_path = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = RelocationPath {
            from_path: field_from_path.ok_or_else(|| ::serde::de::Error::missing_field("from_path"))?,
            to_path: field_to_path.ok_or_else(|| ::serde::de::Error::missing_field("to_path"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("from_path", &self.from_path)?;
        s.serialize_field("to_path", &self.to_path)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationPath {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = RelocationPath;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationPath struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                RelocationPath::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("RelocationPath", RELOCATION_PATH_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationPath {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("RelocationPath", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct RelocationResult {
    
    pub metadata: Metadata,
}
impl RelocationResult {
    pub fn new(metadata: Metadata) -> Self {
        RelocationResult {
            metadata,
        }
    }
}
const RELOCATION_RESULT_FIELDS: &[&str] = &["metadata"];
impl RelocationResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<RelocationResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<RelocationResult>, V::Error> {
        let mut field_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = RelocationResult {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for RelocationResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = RelocationResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RelocationResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                RelocationResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("RelocationResult", RELOCATION_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for RelocationResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("RelocationResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct RestoreArg {
    
    pub path: WritePath,
    
    pub rev: Rev,
}
impl RestoreArg {
    pub fn new(path: WritePath, rev: Rev) -> Self {
        RestoreArg {
            path,
            rev,
        }
    }
}
const RESTORE_ARG_FIELDS: &[&str] = &["path",
                                      "rev"];
impl RestoreArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<RestoreArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<RestoreArg>, V::Error> {
        let mut field_path = None;
        let mut field_rev = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "rev" => {
                    if field_rev.is_some() {
                        return Err(::serde::de::Error::duplicate_field("rev"));
                    }
                    field_rev = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = RestoreArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            rev: field_rev.ok_or_else(|| ::serde::de::Error::missing_field("rev"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("rev", &self.rev)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for RestoreArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = RestoreArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RestoreArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                RestoreArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("RestoreArg", RESTORE_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for RestoreArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("RestoreArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum RestoreError {
    
    PathLookup(LookupError),
    
    PathWrite(WriteError),
    
    InvalidRevision,
    
    InProgress,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for RestoreError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = RestoreError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a RestoreError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path_lookup" => {
                        match map.next_key()? {
                            Some("path_lookup") => Ok(RestoreError::PathLookup(map.next_value()?)),
                            None => Err(de::Error::missing_field("path_lookup")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "path_write" => {
                        match map.next_key()? {
                            Some("path_write") => Ok(RestoreError::PathWrite(map.next_value()?)),
                            None => Err(de::Error::missing_field("path_write")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "invalid_revision" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RestoreError::InvalidRevision)
                    }
                    "in_progress" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RestoreError::InProgress)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(RestoreError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path_lookup",
                                    "path_write",
                                    "invalid_revision",
                                    "in_progress",
                                    "other"];
        deserializer.deserialize_struct("RestoreError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for RestoreError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            RestoreError::PathLookup(ref x) => {
                
                let mut s = serializer.serialize_struct("RestoreError", 2)?;
                s.serialize_field(".tag", "path_lookup")?;
                s.serialize_field("path_lookup", x)?;
                s.end()
            }
            RestoreError::PathWrite(ref x) => {
                
                let mut s = serializer.serialize_struct("RestoreError", 2)?;
                s.serialize_field(".tag", "path_write")?;
                s.serialize_field("path_write", x)?;
                s.end()
            }
            RestoreError::InvalidRevision => {
                
                let mut s = serializer.serialize_struct("RestoreError", 1)?;
                s.serialize_field(".tag", "invalid_revision")?;
                s.end()
            }
            RestoreError::InProgress => {
                
                let mut s = serializer.serialize_struct("RestoreError", 1)?;
                s.serialize_field(".tag", "in_progress")?;
                s.end()
            }
            RestoreError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for RestoreError {
    fn description(&self) -> &str {
        "RestoreError"
    }
}
impl ::std::fmt::Display for RestoreError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SaveCopyReferenceArg {
    
    pub copy_reference: String,
    
    pub path: Path,
}
impl SaveCopyReferenceArg {
    pub fn new(copy_reference: String, path: Path) -> Self {
        SaveCopyReferenceArg {
            copy_reference,
            path,
        }
    }
}
const SAVE_COPY_REFERENCE_ARG_FIELDS: &[&str] = &["copy_reference",
                                                  "path"];
impl SaveCopyReferenceArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SaveCopyReferenceArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SaveCopyReferenceArg>, V::Error> {
        let mut field_copy_reference = None;
        let mut field_path = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "copy_reference" => {
                    if field_copy_reference.is_some() {
                        return Err(::serde::de::Error::duplicate_field("copy_reference"));
                    }
                    field_copy_reference = Some(map.next_value()?);
                }
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SaveCopyReferenceArg {
            copy_reference: field_copy_reference.ok_or_else(|| ::serde::de::Error::missing_field("copy_reference"))?,
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("copy_reference", &self.copy_reference)?;
        s.serialize_field("path", &self.path)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SaveCopyReferenceArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SaveCopyReferenceArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SaveCopyReferenceArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SaveCopyReferenceArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SaveCopyReferenceArg", SAVE_COPY_REFERENCE_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SaveCopyReferenceArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SaveCopyReferenceArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum SaveCopyReferenceError {
    Path(WriteError),
    
    InvalidCopyReference,
    
    
    NoPermission,
    
    NotFound,
    
    TooManyFiles,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for SaveCopyReferenceError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SaveCopyReferenceError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SaveCopyReferenceError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(SaveCopyReferenceError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "invalid_copy_reference" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveCopyReferenceError::InvalidCopyReference)
                    }
                    "no_permission" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveCopyReferenceError::NoPermission)
                    }
                    "not_found" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveCopyReferenceError::NotFound)
                    }
                    "too_many_files" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveCopyReferenceError::TooManyFiles)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveCopyReferenceError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "invalid_copy_reference",
                                    "no_permission",
                                    "not_found",
                                    "too_many_files",
                                    "other"];
        deserializer.deserialize_struct("SaveCopyReferenceError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SaveCopyReferenceError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SaveCopyReferenceError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("SaveCopyReferenceError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            SaveCopyReferenceError::InvalidCopyReference => {
                
                let mut s = serializer.serialize_struct("SaveCopyReferenceError", 1)?;
                s.serialize_field(".tag", "invalid_copy_reference")?;
                s.end()
            }
            SaveCopyReferenceError::NoPermission => {
                
                let mut s = serializer.serialize_struct("SaveCopyReferenceError", 1)?;
                s.serialize_field(".tag", "no_permission")?;
                s.end()
            }
            SaveCopyReferenceError::NotFound => {
                
                let mut s = serializer.serialize_struct("SaveCopyReferenceError", 1)?;
                s.serialize_field(".tag", "not_found")?;
                s.end()
            }
            SaveCopyReferenceError::TooManyFiles => {
                
                let mut s = serializer.serialize_struct("SaveCopyReferenceError", 1)?;
                s.serialize_field(".tag", "too_many_files")?;
                s.end()
            }
            SaveCopyReferenceError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for SaveCopyReferenceError {
    fn description(&self) -> &str {
        "SaveCopyReferenceError"
    }
}
impl ::std::fmt::Display for SaveCopyReferenceError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SaveCopyReferenceResult {
    
    pub metadata: Metadata,
}
impl SaveCopyReferenceResult {
    pub fn new(metadata: Metadata) -> Self {
        SaveCopyReferenceResult {
            metadata,
        }
    }
}
const SAVE_COPY_REFERENCE_RESULT_FIELDS: &[&str] = &["metadata"];
impl SaveCopyReferenceResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SaveCopyReferenceResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SaveCopyReferenceResult>, V::Error> {
        let mut field_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SaveCopyReferenceResult {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SaveCopyReferenceResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SaveCopyReferenceResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SaveCopyReferenceResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SaveCopyReferenceResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SaveCopyReferenceResult", SAVE_COPY_REFERENCE_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SaveCopyReferenceResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SaveCopyReferenceResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SaveUrlArg {
    
    pub path: Path,
    
    pub url: String,
}
impl SaveUrlArg {
    pub fn new(path: Path, url: String) -> Self {
        SaveUrlArg {
            path,
            url,
        }
    }
}
const SAVE_URL_ARG_FIELDS: &[&str] = &["path",
                                       "url"];
impl SaveUrlArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SaveUrlArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SaveUrlArg>, V::Error> {
        let mut field_path = None;
        let mut field_url = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "url" => {
                    if field_url.is_some() {
                        return Err(::serde::de::Error::duplicate_field("url"));
                    }
                    field_url = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SaveUrlArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            url: field_url.ok_or_else(|| ::serde::de::Error::missing_field("url"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("url", &self.url)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SaveUrlArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SaveUrlArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SaveUrlArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SaveUrlArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SaveUrlArg", SAVE_URL_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SaveUrlArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SaveUrlArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum SaveUrlError {
    Path(WriteError),
    
    
    DownloadFailed,
    
    InvalidUrl,
    
    NotFound,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for SaveUrlError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SaveUrlError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SaveUrlError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(SaveUrlError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "download_failed" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveUrlError::DownloadFailed)
                    }
                    "invalid_url" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveUrlError::InvalidUrl)
                    }
                    "not_found" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveUrlError::NotFound)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveUrlError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "download_failed",
                                    "invalid_url",
                                    "not_found",
                                    "other"];
        deserializer.deserialize_struct("SaveUrlError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SaveUrlError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SaveUrlError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("SaveUrlError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            SaveUrlError::DownloadFailed => {
                
                let mut s = serializer.serialize_struct("SaveUrlError", 1)?;
                s.serialize_field(".tag", "download_failed")?;
                s.end()
            }
            SaveUrlError::InvalidUrl => {
                
                let mut s = serializer.serialize_struct("SaveUrlError", 1)?;
                s.serialize_field(".tag", "invalid_url")?;
                s.end()
            }
            SaveUrlError::NotFound => {
                
                let mut s = serializer.serialize_struct("SaveUrlError", 1)?;
                s.serialize_field(".tag", "not_found")?;
                s.end()
            }
            SaveUrlError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for SaveUrlError {
    fn description(&self) -> &str {
        "SaveUrlError"
    }
}
impl ::std::fmt::Display for SaveUrlError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum SaveUrlJobStatus {
    
    InProgress,
    
    Complete(FileMetadata),
    Failed(SaveUrlError),
}
impl<'de> ::serde::de::Deserialize<'de> for SaveUrlJobStatus {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SaveUrlJobStatus;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SaveUrlJobStatus structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "in_progress" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SaveUrlJobStatus::InProgress)
                    }
                    "complete" => Ok(SaveUrlJobStatus::Complete(FileMetadata::internal_deserialize(map)?)),
                    "failed" => {
                        match map.next_key()? {
                            Some("failed") => Ok(SaveUrlJobStatus::Failed(map.next_value()?)),
                            None => Err(de::Error::missing_field("failed")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["in_progress",
                                    "complete",
                                    "failed"];
        deserializer.deserialize_struct("SaveUrlJobStatus", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SaveUrlJobStatus {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SaveUrlJobStatus::InProgress => {
                
                let mut s = serializer.serialize_struct("SaveUrlJobStatus", 1)?;
                s.serialize_field(".tag", "in_progress")?;
                s.end()
            }
            SaveUrlJobStatus::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("SaveUrlJobStatus", 19)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            SaveUrlJobStatus::Failed(ref x) => {
                
                let mut s = serializer.serialize_struct("SaveUrlJobStatus", 2)?;
                s.serialize_field(".tag", "failed")?;
                s.serialize_field("failed", x)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum SaveUrlResult {
    
    
    AsyncJobId(super::dbx_async::AsyncJobId),
    
    Complete(FileMetadata),
}
impl<'de> ::serde::de::Deserialize<'de> for SaveUrlResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SaveUrlResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SaveUrlResult structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "async_job_id" => {
                        match map.next_key()? {
                            Some("async_job_id") => Ok(SaveUrlResult::AsyncJobId(map.next_value()?)),
                            None => Err(de::Error::missing_field("async_job_id")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "complete" => Ok(SaveUrlResult::Complete(FileMetadata::internal_deserialize(map)?)),
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["async_job_id",
                                    "complete"];
        deserializer.deserialize_struct("SaveUrlResult", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SaveUrlResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SaveUrlResult::AsyncJobId(ref x) => {
                
                let mut s = serializer.serialize_struct("SaveUrlResult", 2)?;
                s.serialize_field(".tag", "async_job_id")?;
                s.serialize_field("async_job_id", x)?;
                s.end()
            }
            SaveUrlResult::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("SaveUrlResult", 19)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SearchArg {
    
    pub path: PathROrId,
    
    
    
    pub query: String,
    
    pub start: u64,
    
    pub max_results: u64,
    
    
    pub mode: SearchMode,
}
impl SearchArg {
    pub fn new(path: PathROrId, query: String) -> Self {
        SearchArg {
            path,
            query,
            start: 0,
            max_results: 100,
            mode: SearchMode::Filename,
        }
    }
    pub fn with_start(mut self, value: u64) -> Self {
        self.start = value;
        self
    }
    pub fn with_max_results(mut self, value: u64) -> Self {
        self.max_results = value;
        self
    }
    pub fn with_mode(mut self, value: SearchMode) -> Self {
        self.mode = value;
        self
    }
}
const SEARCH_ARG_FIELDS: &[&str] = &["path",
                                     "query",
                                     "start",
                                     "max_results",
                                     "mode"];
impl SearchArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SearchArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SearchArg>, V::Error> {
        let mut field_path = None;
        let mut field_query = None;
        let mut field_start = None;
        let mut field_max_results = None;
        let mut field_mode = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "query" => {
                    if field_query.is_some() {
                        return Err(::serde::de::Error::duplicate_field("query"));
                    }
                    field_query = Some(map.next_value()?);
                }
                "start" => {
                    if field_start.is_some() {
                        return Err(::serde::de::Error::duplicate_field("start"));
                    }
                    field_start = Some(map.next_value()?);
                }
                "max_results" => {
                    if field_max_results.is_some() {
                        return Err(::serde::de::Error::duplicate_field("max_results"));
                    }
                    field_max_results = Some(map.next_value()?);
                }
                "mode" => {
                    if field_mode.is_some() {
                        return Err(::serde::de::Error::duplicate_field("mode"));
                    }
                    field_mode = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SearchArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            query: field_query.ok_or_else(|| ::serde::de::Error::missing_field("query"))?,
            start: field_start.unwrap_or(0),
            max_results: field_max_results.unwrap_or(100),
            mode: field_mode.unwrap_or(SearchMode::Filename),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("query", &self.query)?;
        s.serialize_field("start", &self.start)?;
        s.serialize_field("max_results", &self.max_results)?;
        s.serialize_field("mode", &self.mode)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SearchArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SearchArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SearchArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SearchArg", SEARCH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SearchArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SearchArg", 5)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum SearchError {
    Path(LookupError),
    InvalidArgument(Option<String>),
    
    InternalError,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for SearchError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SearchError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(SearchError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "invalid_argument" => {
                        match map.next_key()? {
                            Some("invalid_argument") => Ok(SearchError::InvalidArgument(map.next_value()?)),
                            None => Ok(SearchError::InvalidArgument(None)),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "internal_error" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchError::InternalError)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "invalid_argument",
                                    "internal_error",
                                    "other"];
        deserializer.deserialize_struct("SearchError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SearchError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SearchError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("SearchError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            SearchError::InvalidArgument(ref x) => {
                
                let n = if x.is_some() { 2 } else { 1 };
                let mut s = serializer.serialize_struct("SearchError", n)?;
                s.serialize_field(".tag", "invalid_argument")?;
                if let Some(ref x) = x {
                    s.serialize_field("invalid_argument", &x)?;
                }
                s.end()
            }
            SearchError::InternalError => {
                
                let mut s = serializer.serialize_struct("SearchError", 1)?;
                s.serialize_field(".tag", "internal_error")?;
                s.end()
            }
            SearchError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for SearchError {
    fn description(&self) -> &str {
        "SearchError"
    }
}
impl ::std::fmt::Display for SearchError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SearchMatch {
    
    pub match_type: SearchMatchType,
    
    pub metadata: Metadata,
}
impl SearchMatch {
    pub fn new(match_type: SearchMatchType, metadata: Metadata) -> Self {
        SearchMatch {
            match_type,
            metadata,
        }
    }
}
const SEARCH_MATCH_FIELDS: &[&str] = &["match_type",
                                       "metadata"];
impl SearchMatch {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SearchMatch, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SearchMatch>, V::Error> {
        let mut field_match_type = None;
        let mut field_metadata = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "match_type" => {
                    if field_match_type.is_some() {
                        return Err(::serde::de::Error::duplicate_field("match_type"));
                    }
                    field_match_type = Some(map.next_value()?);
                }
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SearchMatch {
            match_type: field_match_type.ok_or_else(|| ::serde::de::Error::missing_field("match_type"))?,
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("match_type", &self.match_type)?;
        s.serialize_field("metadata", &self.metadata)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SearchMatch {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SearchMatch;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchMatch struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SearchMatch::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SearchMatch", SEARCH_MATCH_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SearchMatch {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SearchMatch", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SearchMatchFieldOptions {
    
    pub include_highlights: bool,
}
impl Default for SearchMatchFieldOptions {
    fn default() -> Self {
        SearchMatchFieldOptions {
            include_highlights: false,
        }
    }
}
impl SearchMatchFieldOptions {
    pub fn with_include_highlights(mut self, value: bool) -> Self {
        self.include_highlights = value;
        self
    }
}
const SEARCH_MATCH_FIELD_OPTIONS_FIELDS: &[&str] = &["include_highlights"];
impl SearchMatchFieldOptions {
    
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
    ) -> Result<SearchMatchFieldOptions, V::Error> {
        let mut field_include_highlights = None;
        while let Some(key) = map.next_key::<&str>()? {
            match key {
                "include_highlights" => {
                    if field_include_highlights.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_highlights"));
                    }
                    field_include_highlights = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        let result = SearchMatchFieldOptions {
            include_highlights: field_include_highlights.unwrap_or(false),
        };
        Ok(result)
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("include_highlights", &self.include_highlights)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SearchMatchFieldOptions {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SearchMatchFieldOptions;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchMatchFieldOptions struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SearchMatchFieldOptions::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SearchMatchFieldOptions", SEARCH_MATCH_FIELD_OPTIONS_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SearchMatchFieldOptions {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SearchMatchFieldOptions", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum SearchMatchType {
    
    Filename,
    
    Content,
    
    Both,
}
impl<'de> ::serde::de::Deserialize<'de> for SearchMatchType {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SearchMatchType;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchMatchType structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "filename" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMatchType::Filename)
                    }
                    "content" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMatchType::Content)
                    }
                    "both" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMatchType::Both)
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["filename",
                                    "content",
                                    "both"];
        deserializer.deserialize_struct("SearchMatchType", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SearchMatchType {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SearchMatchType::Filename => {
                
                let mut s = serializer.serialize_struct("SearchMatchType", 1)?;
                s.serialize_field(".tag", "filename")?;
                s.end()
            }
            SearchMatchType::Content => {
                
                let mut s = serializer.serialize_struct("SearchMatchType", 1)?;
                s.serialize_field(".tag", "content")?;
                s.end()
            }
            SearchMatchType::Both => {
                
                let mut s = serializer.serialize_struct("SearchMatchType", 1)?;
                s.serialize_field(".tag", "both")?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum SearchMatchTypeV2 {
    
    Filename,
    
    FileContent,
    
    FilenameAndContent,
    
    ImageContent,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for SearchMatchTypeV2 {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SearchMatchTypeV2;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchMatchTypeV2 structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "filename" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMatchTypeV2::Filename)
                    }
                    "file_content" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMatchTypeV2::FileContent)
                    }
                    "filename_and_content" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMatchTypeV2::FilenameAndContent)
                    }
                    "image_content" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMatchTypeV2::ImageContent)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMatchTypeV2::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["filename",
                                    "file_content",
                                    "filename_and_content",
                                    "image_content",
                                    "other"];
        deserializer.deserialize_struct("SearchMatchTypeV2", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SearchMatchTypeV2 {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SearchMatchTypeV2::Filename => {
                
                let mut s = serializer.serialize_struct("SearchMatchTypeV2", 1)?;
                s.serialize_field(".tag", "filename")?;
                s.end()
            }
            SearchMatchTypeV2::FileContent => {
                
                let mut s = serializer.serialize_struct("SearchMatchTypeV2", 1)?;
                s.serialize_field(".tag", "file_content")?;
                s.end()
            }
            SearchMatchTypeV2::FilenameAndContent => {
                
                let mut s = serializer.serialize_struct("SearchMatchTypeV2", 1)?;
                s.serialize_field(".tag", "filename_and_content")?;
                s.end()
            }
            SearchMatchTypeV2::ImageContent => {
                
                let mut s = serializer.serialize_struct("SearchMatchTypeV2", 1)?;
                s.serialize_field(".tag", "image_content")?;
                s.end()
            }
            SearchMatchTypeV2::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SearchMatchV2 {
    
    pub metadata: MetadataV2,
    
    pub match_type: Option<SearchMatchTypeV2>,
    
    pub highlight_spans: Option<Vec<HighlightSpan>>,
}
impl SearchMatchV2 {
    pub fn new(metadata: MetadataV2) -> Self {
        SearchMatchV2 {
            metadata,
            match_type: None,
            highlight_spans: None,
        }
    }
    pub fn with_match_type(mut self, value: SearchMatchTypeV2) -> Self {
        self.match_type = Some(value);
        self
    }
    pub fn with_highlight_spans(mut self, value: Vec<HighlightSpan>) -> Self {
        self.highlight_spans = Some(value);
        self
    }
}
const SEARCH_MATCH_V2_FIELDS: &[&str] = &["metadata",
                                          "match_type",
                                          "highlight_spans"];
impl SearchMatchV2 {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SearchMatchV2, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SearchMatchV2>, V::Error> {
        let mut field_metadata = None;
        let mut field_match_type = None;
        let mut field_highlight_spans = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "metadata" => {
                    if field_metadata.is_some() {
                        return Err(::serde::de::Error::duplicate_field("metadata"));
                    }
                    field_metadata = Some(map.next_value()?);
                }
                "match_type" => {
                    if field_match_type.is_some() {
                        return Err(::serde::de::Error::duplicate_field("match_type"));
                    }
                    field_match_type = Some(map.next_value()?);
                }
                "highlight_spans" => {
                    if field_highlight_spans.is_some() {
                        return Err(::serde::de::Error::duplicate_field("highlight_spans"));
                    }
                    field_highlight_spans = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SearchMatchV2 {
            metadata: field_metadata.ok_or_else(|| ::serde::de::Error::missing_field("metadata"))?,
            match_type: field_match_type,
            highlight_spans: field_highlight_spans,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("metadata", &self.metadata)?;
        s.serialize_field("match_type", &self.match_type)?;
        s.serialize_field("highlight_spans", &self.highlight_spans)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SearchMatchV2 {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SearchMatchV2;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchMatchV2 struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SearchMatchV2::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SearchMatchV2", SEARCH_MATCH_V2_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SearchMatchV2 {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SearchMatchV2", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum SearchMode {
    
    Filename,
    
    FilenameAndContent,
    
    DeletedFilename,
}
impl<'de> ::serde::de::Deserialize<'de> for SearchMode {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SearchMode;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchMode structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "filename" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMode::Filename)
                    }
                    "filename_and_content" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMode::FilenameAndContent)
                    }
                    "deleted_filename" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchMode::DeletedFilename)
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["filename",
                                    "filename_and_content",
                                    "deleted_filename"];
        deserializer.deserialize_struct("SearchMode", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SearchMode {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SearchMode::Filename => {
                
                let mut s = serializer.serialize_struct("SearchMode", 1)?;
                s.serialize_field(".tag", "filename")?;
                s.end()
            }
            SearchMode::FilenameAndContent => {
                
                let mut s = serializer.serialize_struct("SearchMode", 1)?;
                s.serialize_field(".tag", "filename_and_content")?;
                s.end()
            }
            SearchMode::DeletedFilename => {
                
                let mut s = serializer.serialize_struct("SearchMode", 1)?;
                s.serialize_field(".tag", "deleted_filename")?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SearchOptions {
    
    
    pub path: Option<PathROrId>,
    
    pub max_results: u64,
    
    
    pub order_by: Option<SearchOrderBy>,
    
    pub file_status: FileStatus,
    
    pub filename_only: bool,
    
    pub file_extensions: Option<Vec<String>>,
    
    
    pub file_categories: Option<Vec<FileCategory>>,
}
impl Default for SearchOptions {
    fn default() -> Self {
        SearchOptions {
            path: None,
            max_results: 100,
            order_by: None,
            file_status: FileStatus::Active,
            filename_only: false,
            file_extensions: None,
            file_categories: None,
        }
    }
}
impl SearchOptions {
    pub fn with_path(mut self, value: PathROrId) -> Self {
        self.path = Some(value);
        self
    }
    pub fn with_max_results(mut self, value: u64) -> Self {
        self.max_results = value;
        self
    }
    pub fn with_order_by(mut self, value: SearchOrderBy) -> Self {
        self.order_by = Some(value);
        self
    }
    pub fn with_file_status(mut self, value: FileStatus) -> Self {
        self.file_status = value;
        self
    }
    pub fn with_filename_only(mut self, value: bool) -> Self {
        self.filename_only = value;
        self
    }
    pub fn with_file_extensions(mut self, value: Vec<String>) -> Self {
        self.file_extensions = Some(value);
        self
    }
    pub fn with_file_categories(mut self, value: Vec<FileCategory>) -> Self {
        self.file_categories = Some(value);
        self
    }
}
const SEARCH_OPTIONS_FIELDS: &[&str] = &["path",
                                         "max_results",
                                         "order_by",
                                         "file_status",
                                         "filename_only",
                                         "file_extensions",
                                         "file_categories"];
impl SearchOptions {
    
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
    ) -> Result<SearchOptions, V::Error> {
        let mut field_path = None;
        let mut field_max_results = None;
        let mut field_order_by = None;
        let mut field_file_status = None;
        let mut field_filename_only = None;
        let mut field_file_extensions = None;
        let mut field_file_categories = None;
        while let Some(key) = map.next_key::<&str>()? {
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "max_results" => {
                    if field_max_results.is_some() {
                        return Err(::serde::de::Error::duplicate_field("max_results"));
                    }
                    field_max_results = Some(map.next_value()?);
                }
                "order_by" => {
                    if field_order_by.is_some() {
                        return Err(::serde::de::Error::duplicate_field("order_by"));
                    }
                    field_order_by = Some(map.next_value()?);
                }
                "file_status" => {
                    if field_file_status.is_some() {
                        return Err(::serde::de::Error::duplicate_field("file_status"));
                    }
                    field_file_status = Some(map.next_value()?);
                }
                "filename_only" => {
                    if field_filename_only.is_some() {
                        return Err(::serde::de::Error::duplicate_field("filename_only"));
                    }
                    field_filename_only = Some(map.next_value()?);
                }
                "file_extensions" => {
                    if field_file_extensions.is_some() {
                        return Err(::serde::de::Error::duplicate_field("file_extensions"));
                    }
                    field_file_extensions = Some(map.next_value()?);
                }
                "file_categories" => {
                    if field_file_categories.is_some() {
                        return Err(::serde::de::Error::duplicate_field("file_categories"));
                    }
                    field_file_categories = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        let result = SearchOptions {
            path: field_path,
            max_results: field_max_results.unwrap_or(100),
            order_by: field_order_by,
            file_status: field_file_status.unwrap_or(FileStatus::Active),
            filename_only: field_filename_only.unwrap_or(false),
            file_extensions: field_file_extensions,
            file_categories: field_file_categories,
        };
        Ok(result)
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("max_results", &self.max_results)?;
        s.serialize_field("order_by", &self.order_by)?;
        s.serialize_field("file_status", &self.file_status)?;
        s.serialize_field("filename_only", &self.filename_only)?;
        s.serialize_field("file_extensions", &self.file_extensions)?;
        s.serialize_field("file_categories", &self.file_categories)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SearchOptions {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SearchOptions;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchOptions struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SearchOptions::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SearchOptions", SEARCH_OPTIONS_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SearchOptions {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SearchOptions", 7)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum SearchOrderBy {
    Relevance,
    LastModifiedTime,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for SearchOrderBy {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SearchOrderBy;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchOrderBy structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "relevance" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchOrderBy::Relevance)
                    }
                    "last_modified_time" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchOrderBy::LastModifiedTime)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SearchOrderBy::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["relevance",
                                    "last_modified_time",
                                    "other"];
        deserializer.deserialize_struct("SearchOrderBy", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SearchOrderBy {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SearchOrderBy::Relevance => {
                
                let mut s = serializer.serialize_struct("SearchOrderBy", 1)?;
                s.serialize_field(".tag", "relevance")?;
                s.end()
            }
            SearchOrderBy::LastModifiedTime => {
                
                let mut s = serializer.serialize_struct("SearchOrderBy", 1)?;
                s.serialize_field(".tag", "last_modified_time")?;
                s.end()
            }
            SearchOrderBy::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SearchResult {
    
    pub matches: Vec<SearchMatch>,
    
    
    pub more: bool,
    
    
    pub start: u64,
}
impl SearchResult {
    pub fn new(matches: Vec<SearchMatch>, more: bool, start: u64) -> Self {
        SearchResult {
            matches,
            more,
            start,
        }
    }
}
const SEARCH_RESULT_FIELDS: &[&str] = &["matches",
                                        "more",
                                        "start"];
impl SearchResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SearchResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SearchResult>, V::Error> {
        let mut field_matches = None;
        let mut field_more = None;
        let mut field_start = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "matches" => {
                    if field_matches.is_some() {
                        return Err(::serde::de::Error::duplicate_field("matches"));
                    }
                    field_matches = Some(map.next_value()?);
                }
                "more" => {
                    if field_more.is_some() {
                        return Err(::serde::de::Error::duplicate_field("more"));
                    }
                    field_more = Some(map.next_value()?);
                }
                "start" => {
                    if field_start.is_some() {
                        return Err(::serde::de::Error::duplicate_field("start"));
                    }
                    field_start = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SearchResult {
            matches: field_matches.ok_or_else(|| ::serde::de::Error::missing_field("matches"))?,
            more: field_more.ok_or_else(|| ::serde::de::Error::missing_field("more"))?,
            start: field_start.ok_or_else(|| ::serde::de::Error::missing_field("start"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("matches", &self.matches)?;
        s.serialize_field("more", &self.more)?;
        s.serialize_field("start", &self.start)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SearchResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SearchResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SearchResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SearchResult", SEARCH_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SearchResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SearchResult", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SearchV2Arg {
    
    
    pub query: String,
    
    pub options: Option<SearchOptions>,
    
    pub match_field_options: Option<SearchMatchFieldOptions>,
    
    pub include_highlights: Option<bool>,
}
impl SearchV2Arg {
    pub fn new(query: String) -> Self {
        SearchV2Arg {
            query,
            options: None,
            match_field_options: None,
            include_highlights: None,
        }
    }
    pub fn with_options(mut self, value: SearchOptions) -> Self {
        self.options = Some(value);
        self
    }
    pub fn with_match_field_options(mut self, value: SearchMatchFieldOptions) -> Self {
        self.match_field_options = Some(value);
        self
    }
    pub fn with_include_highlights(mut self, value: bool) -> Self {
        self.include_highlights = Some(value);
        self
    }
}
const SEARCH_V2_ARG_FIELDS: &[&str] = &["query",
                                        "options",
                                        "match_field_options",
                                        "include_highlights"];
impl SearchV2Arg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SearchV2Arg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SearchV2Arg>, V::Error> {
        let mut field_query = None;
        let mut field_options = None;
        let mut field_match_field_options = None;
        let mut field_include_highlights = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "query" => {
                    if field_query.is_some() {
                        return Err(::serde::de::Error::duplicate_field("query"));
                    }
                    field_query = Some(map.next_value()?);
                }
                "options" => {
                    if field_options.is_some() {
                        return Err(::serde::de::Error::duplicate_field("options"));
                    }
                    field_options = Some(map.next_value()?);
                }
                "match_field_options" => {
                    if field_match_field_options.is_some() {
                        return Err(::serde::de::Error::duplicate_field("match_field_options"));
                    }
                    field_match_field_options = Some(map.next_value()?);
                }
                "include_highlights" => {
                    if field_include_highlights.is_some() {
                        return Err(::serde::de::Error::duplicate_field("include_highlights"));
                    }
                    field_include_highlights = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SearchV2Arg {
            query: field_query.ok_or_else(|| ::serde::de::Error::missing_field("query"))?,
            options: field_options,
            match_field_options: field_match_field_options,
            include_highlights: field_include_highlights,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("query", &self.query)?;
        s.serialize_field("options", &self.options)?;
        s.serialize_field("match_field_options", &self.match_field_options)?;
        s.serialize_field("include_highlights", &self.include_highlights)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SearchV2Arg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SearchV2Arg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchV2Arg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SearchV2Arg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SearchV2Arg", SEARCH_V2_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SearchV2Arg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SearchV2Arg", 4)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SearchV2ContinueArg {
    
    
    pub cursor: SearchV2Cursor,
}
impl SearchV2ContinueArg {
    pub fn new(cursor: SearchV2Cursor) -> Self {
        SearchV2ContinueArg {
            cursor,
        }
    }
}
const SEARCH_V2_CONTINUE_ARG_FIELDS: &[&str] = &["cursor"];
impl SearchV2ContinueArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SearchV2ContinueArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SearchV2ContinueArg>, V::Error> {
        let mut field_cursor = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "cursor" => {
                    if field_cursor.is_some() {
                        return Err(::serde::de::Error::duplicate_field("cursor"));
                    }
                    field_cursor = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SearchV2ContinueArg {
            cursor: field_cursor.ok_or_else(|| ::serde::de::Error::missing_field("cursor"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("cursor", &self.cursor)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SearchV2ContinueArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SearchV2ContinueArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchV2ContinueArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SearchV2ContinueArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SearchV2ContinueArg", SEARCH_V2_CONTINUE_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SearchV2ContinueArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SearchV2ContinueArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SearchV2Result {
    
    pub matches: Vec<SearchMatchV2>,
    
    
    pub has_more: bool,
    
    
    pub cursor: Option<SearchV2Cursor>,
}
impl SearchV2Result {
    pub fn new(matches: Vec<SearchMatchV2>, has_more: bool) -> Self {
        SearchV2Result {
            matches,
            has_more,
            cursor: None,
        }
    }
    pub fn with_cursor(mut self, value: SearchV2Cursor) -> Self {
        self.cursor = Some(value);
        self
    }
}
const SEARCH_V2_RESULT_FIELDS: &[&str] = &["matches",
                                           "has_more",
                                           "cursor"];
impl SearchV2Result {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SearchV2Result, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SearchV2Result>, V::Error> {
        let mut field_matches = None;
        let mut field_has_more = None;
        let mut field_cursor = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "matches" => {
                    if field_matches.is_some() {
                        return Err(::serde::de::Error::duplicate_field("matches"));
                    }
                    field_matches = Some(map.next_value()?);
                }
                "has_more" => {
                    if field_has_more.is_some() {
                        return Err(::serde::de::Error::duplicate_field("has_more"));
                    }
                    field_has_more = Some(map.next_value()?);
                }
                "cursor" => {
                    if field_cursor.is_some() {
                        return Err(::serde::de::Error::duplicate_field("cursor"));
                    }
                    field_cursor = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SearchV2Result {
            matches: field_matches.ok_or_else(|| ::serde::de::Error::missing_field("matches"))?,
            has_more: field_has_more.ok_or_else(|| ::serde::de::Error::missing_field("has_more"))?,
            cursor: field_cursor,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("matches", &self.matches)?;
        s.serialize_field("has_more", &self.has_more)?;
        s.serialize_field("cursor", &self.cursor)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SearchV2Result {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SearchV2Result;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SearchV2Result struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SearchV2Result::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SearchV2Result", SEARCH_V2_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SearchV2Result {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SearchV2Result", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SharedLink {
    
    pub url: SharedLinkUrl,
    
    pub password: Option<String>,
}
impl SharedLink {
    pub fn new(url: SharedLinkUrl) -> Self {
        SharedLink {
            url,
            password: None,
        }
    }
    pub fn with_password(mut self, value: String) -> Self {
        self.password = Some(value);
        self
    }
}
const SHARED_LINK_FIELDS: &[&str] = &["url",
                                      "password"];
impl SharedLink {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SharedLink, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SharedLink>, V::Error> {
        let mut field_url = None;
        let mut field_password = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "url" => {
                    if field_url.is_some() {
                        return Err(::serde::de::Error::duplicate_field("url"));
                    }
                    field_url = Some(map.next_value()?);
                }
                "password" => {
                    if field_password.is_some() {
                        return Err(::serde::de::Error::duplicate_field("password"));
                    }
                    field_password = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SharedLink {
            url: field_url.ok_or_else(|| ::serde::de::Error::missing_field("url"))?,
            password: field_password,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("url", &self.url)?;
        s.serialize_field("password", &self.password)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SharedLink {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SharedLink;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SharedLink struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SharedLink::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SharedLink", SHARED_LINK_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SharedLink {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SharedLink", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SharedLinkFileInfo {
    
    
    
    pub url: String,
    
    
    pub path: Option<String>,
    
    
    pub password: Option<String>,
}
impl SharedLinkFileInfo {
    pub fn new(url: String) -> Self {
        SharedLinkFileInfo {
            url,
            path: None,
            password: None,
        }
    }
    pub fn with_path(mut self, value: String) -> Self {
        self.path = Some(value);
        self
    }
    pub fn with_password(mut self, value: String) -> Self {
        self.password = Some(value);
        self
    }
}
const SHARED_LINK_FILE_INFO_FIELDS: &[&str] = &["url",
                                                "path",
                                                "password"];
impl SharedLinkFileInfo {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SharedLinkFileInfo, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SharedLinkFileInfo>, V::Error> {
        let mut field_url = None;
        let mut field_path = None;
        let mut field_password = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "url" => {
                    if field_url.is_some() {
                        return Err(::serde::de::Error::duplicate_field("url"));
                    }
                    field_url = Some(map.next_value()?);
                }
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "password" => {
                    if field_password.is_some() {
                        return Err(::serde::de::Error::duplicate_field("password"));
                    }
                    field_password = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SharedLinkFileInfo {
            url: field_url.ok_or_else(|| ::serde::de::Error::missing_field("url"))?,
            path: field_path,
            password: field_password,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("url", &self.url)?;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("password", &self.password)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SharedLinkFileInfo {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SharedLinkFileInfo;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SharedLinkFileInfo struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SharedLinkFileInfo::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SharedLinkFileInfo", SHARED_LINK_FILE_INFO_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SharedLinkFileInfo {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SharedLinkFileInfo", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SharingInfo {
    
    pub read_only: bool,
}
impl SharingInfo {
    pub fn new(read_only: bool) -> Self {
        SharingInfo {
            read_only,
        }
    }
}
const SHARING_INFO_FIELDS: &[&str] = &["read_only"];
impl SharingInfo {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SharingInfo, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SharingInfo>, V::Error> {
        let mut field_read_only = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "read_only" => {
                    if field_read_only.is_some() {
                        return Err(::serde::de::Error::duplicate_field("read_only"));
                    }
                    field_read_only = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SharingInfo {
            read_only: field_read_only.ok_or_else(|| ::serde::de::Error::missing_field("read_only"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("read_only", &self.read_only)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SharingInfo {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SharingInfo;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SharingInfo struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SharingInfo::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SharingInfo", SHARING_INFO_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SharingInfo {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SharingInfo", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SingleUserLock {
    
    pub created: super::common::DropboxTimestamp,
    
    pub lock_holder_account_id: super::users_common::AccountId,
    
    pub lock_holder_team_id: Option<String>,
}
impl SingleUserLock {
    pub fn new(
        created: super::common::DropboxTimestamp,
        lock_holder_account_id: super::users_common::AccountId,
    ) -> Self {
        SingleUserLock {
            created,
            lock_holder_account_id,
            lock_holder_team_id: None,
        }
    }
    pub fn with_lock_holder_team_id(mut self, value: String) -> Self {
        self.lock_holder_team_id = Some(value);
        self
    }
}
const SINGLE_USER_LOCK_FIELDS: &[&str] = &["created",
                                           "lock_holder_account_id",
                                           "lock_holder_team_id"];
impl SingleUserLock {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SingleUserLock, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SingleUserLock>, V::Error> {
        let mut field_created = None;
        let mut field_lock_holder_account_id = None;
        let mut field_lock_holder_team_id = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "created" => {
                    if field_created.is_some() {
                        return Err(::serde::de::Error::duplicate_field("created"));
                    }
                    field_created = Some(map.next_value()?);
                }
                "lock_holder_account_id" => {
                    if field_lock_holder_account_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("lock_holder_account_id"));
                    }
                    field_lock_holder_account_id = Some(map.next_value()?);
                }
                "lock_holder_team_id" => {
                    if field_lock_holder_team_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("lock_holder_team_id"));
                    }
                    field_lock_holder_team_id = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SingleUserLock {
            created: field_created.ok_or_else(|| ::serde::de::Error::missing_field("created"))?,
            lock_holder_account_id: field_lock_holder_account_id.ok_or_else(|| ::serde::de::Error::missing_field("lock_holder_account_id"))?,
            lock_holder_team_id: field_lock_holder_team_id,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("created", &self.created)?;
        s.serialize_field("lock_holder_account_id", &self.lock_holder_account_id)?;
        s.serialize_field("lock_holder_team_id", &self.lock_holder_team_id)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SingleUserLock {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SingleUserLock;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SingleUserLock struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SingleUserLock::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SingleUserLock", SINGLE_USER_LOCK_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SingleUserLock {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SingleUserLock", 3)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct SymlinkInfo {
    
    pub target: String,
}
impl SymlinkInfo {
    pub fn new(target: String) -> Self {
        SymlinkInfo {
            target,
        }
    }
}
const SYMLINK_INFO_FIELDS: &[&str] = &["target"];
impl SymlinkInfo {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<SymlinkInfo, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<SymlinkInfo>, V::Error> {
        let mut field_target = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "target" => {
                    if field_target.is_some() {
                        return Err(::serde::de::Error::duplicate_field("target"));
                    }
                    field_target = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = SymlinkInfo {
            target: field_target.ok_or_else(|| ::serde::de::Error::missing_field("target"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("target", &self.target)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for SymlinkInfo {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = SymlinkInfo;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SymlinkInfo struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                SymlinkInfo::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("SymlinkInfo", SYMLINK_INFO_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for SymlinkInfo {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("SymlinkInfo", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum SyncSetting {
    
    
    Default,
    
    
    NotSynced,
    
    
    NotSyncedInactive,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for SyncSetting {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SyncSetting;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SyncSetting structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "default" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSetting::Default)
                    }
                    "not_synced" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSetting::NotSynced)
                    }
                    "not_synced_inactive" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSetting::NotSyncedInactive)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSetting::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["default",
                                    "not_synced",
                                    "not_synced_inactive",
                                    "other"];
        deserializer.deserialize_struct("SyncSetting", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SyncSetting {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SyncSetting::Default => {
                
                let mut s = serializer.serialize_struct("SyncSetting", 1)?;
                s.serialize_field(".tag", "default")?;
                s.end()
            }
            SyncSetting::NotSynced => {
                
                let mut s = serializer.serialize_struct("SyncSetting", 1)?;
                s.serialize_field(".tag", "not_synced")?;
                s.end()
            }
            SyncSetting::NotSyncedInactive => {
                
                let mut s = serializer.serialize_struct("SyncSetting", 1)?;
                s.serialize_field(".tag", "not_synced_inactive")?;
                s.end()
            }
            SyncSetting::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum SyncSettingArg {
    
    
    Default,
    
    
    NotSynced,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for SyncSettingArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SyncSettingArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SyncSettingArg structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "default" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSettingArg::Default)
                    }
                    "not_synced" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSettingArg::NotSynced)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSettingArg::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["default",
                                    "not_synced",
                                    "other"];
        deserializer.deserialize_struct("SyncSettingArg", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SyncSettingArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SyncSettingArg::Default => {
                
                let mut s = serializer.serialize_struct("SyncSettingArg", 1)?;
                s.serialize_field(".tag", "default")?;
                s.end()
            }
            SyncSettingArg::NotSynced => {
                
                let mut s = serializer.serialize_struct("SyncSettingArg", 1)?;
                s.serialize_field(".tag", "not_synced")?;
                s.end()
            }
            SyncSettingArg::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum SyncSettingsError {
    Path(LookupError),
    
    UnsupportedCombination,
    
    UnsupportedConfiguration,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for SyncSettingsError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = SyncSettingsError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a SyncSettingsError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(SyncSettingsError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "unsupported_combination" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSettingsError::UnsupportedCombination)
                    }
                    "unsupported_configuration" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSettingsError::UnsupportedConfiguration)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(SyncSettingsError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "unsupported_combination",
                                    "unsupported_configuration",
                                    "other"];
        deserializer.deserialize_struct("SyncSettingsError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for SyncSettingsError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            SyncSettingsError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("SyncSettingsError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            SyncSettingsError::UnsupportedCombination => {
                
                let mut s = serializer.serialize_struct("SyncSettingsError", 1)?;
                s.serialize_field(".tag", "unsupported_combination")?;
                s.end()
            }
            SyncSettingsError::UnsupportedConfiguration => {
                
                let mut s = serializer.serialize_struct("SyncSettingsError", 1)?;
                s.serialize_field(".tag", "unsupported_configuration")?;
                s.end()
            }
            SyncSettingsError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for SyncSettingsError {
    fn description(&self) -> &str {
        "SyncSettingsError"
    }
}
impl ::std::fmt::Display for SyncSettingsError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ThumbnailArg {
    
    pub path: ReadPath,
    
    
    pub format: ThumbnailFormat,
    
    pub size: ThumbnailSize,
    
    pub mode: ThumbnailMode,
}
impl ThumbnailArg {
    pub fn new(path: ReadPath) -> Self {
        ThumbnailArg {
            path,
            format: ThumbnailFormat::Jpeg,
            size: ThumbnailSize::W64h64,
            mode: ThumbnailMode::Strict,
        }
    }
    pub fn with_format(mut self, value: ThumbnailFormat) -> Self {
        self.format = value;
        self
    }
    pub fn with_size(mut self, value: ThumbnailSize) -> Self {
        self.size = value;
        self
    }
    pub fn with_mode(mut self, value: ThumbnailMode) -> Self {
        self.mode = value;
        self
    }
}
const THUMBNAIL_ARG_FIELDS: &[&str] = &["path",
                                        "format",
                                        "size",
                                        "mode"];
impl ThumbnailArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ThumbnailArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ThumbnailArg>, V::Error> {
        let mut field_path = None;
        let mut field_format = None;
        let mut field_size = None;
        let mut field_mode = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                "format" => {
                    if field_format.is_some() {
                        return Err(::serde::de::Error::duplicate_field("format"));
                    }
                    field_format = Some(map.next_value()?);
                }
                "size" => {
                    if field_size.is_some() {
                        return Err(::serde::de::Error::duplicate_field("size"));
                    }
                    field_size = Some(map.next_value()?);
                }
                "mode" => {
                    if field_mode.is_some() {
                        return Err(::serde::de::Error::duplicate_field("mode"));
                    }
                    field_mode = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ThumbnailArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
            format: field_format.unwrap_or(ThumbnailFormat::Jpeg),
            size: field_size.unwrap_or(ThumbnailSize::W64h64),
            mode: field_mode.unwrap_or(ThumbnailMode::Strict),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)?;
        s.serialize_field("format", &self.format)?;
        s.serialize_field("size", &self.size)?;
        s.serialize_field("mode", &self.mode)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ThumbnailArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ThumbnailArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ThumbnailArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ThumbnailArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ThumbnailArg", THUMBNAIL_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ThumbnailArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ThumbnailArg", 4)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum ThumbnailError {
    
    Path(LookupError),
    
    UnsupportedExtension,
    
    UnsupportedImage,
    
    ConversionError,
}
impl<'de> ::serde::de::Deserialize<'de> for ThumbnailError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ThumbnailError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ThumbnailError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(ThumbnailError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "unsupported_extension" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailError::UnsupportedExtension)
                    }
                    "unsupported_image" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailError::UnsupportedImage)
                    }
                    "conversion_error" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailError::ConversionError)
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "unsupported_extension",
                                    "unsupported_image",
                                    "conversion_error"];
        deserializer.deserialize_struct("ThumbnailError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ThumbnailError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ThumbnailError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("ThumbnailError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            ThumbnailError::UnsupportedExtension => {
                
                let mut s = serializer.serialize_struct("ThumbnailError", 1)?;
                s.serialize_field(".tag", "unsupported_extension")?;
                s.end()
            }
            ThumbnailError::UnsupportedImage => {
                
                let mut s = serializer.serialize_struct("ThumbnailError", 1)?;
                s.serialize_field(".tag", "unsupported_image")?;
                s.end()
            }
            ThumbnailError::ConversionError => {
                
                let mut s = serializer.serialize_struct("ThumbnailError", 1)?;
                s.serialize_field(".tag", "conversion_error")?;
                s.end()
            }
        }
    }
}
impl ::std::error::Error for ThumbnailError {
    fn description(&self) -> &str {
        "ThumbnailError"
    }
}
impl ::std::fmt::Display for ThumbnailError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum ThumbnailFormat {
    Jpeg,
    Png,
}
impl<'de> ::serde::de::Deserialize<'de> for ThumbnailFormat {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ThumbnailFormat;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ThumbnailFormat structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "jpeg" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailFormat::Jpeg)
                    }
                    "png" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailFormat::Png)
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["jpeg",
                                    "png"];
        deserializer.deserialize_struct("ThumbnailFormat", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ThumbnailFormat {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ThumbnailFormat::Jpeg => {
                
                let mut s = serializer.serialize_struct("ThumbnailFormat", 1)?;
                s.serialize_field(".tag", "jpeg")?;
                s.end()
            }
            ThumbnailFormat::Png => {
                
                let mut s = serializer.serialize_struct("ThumbnailFormat", 1)?;
                s.serialize_field(".tag", "png")?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum ThumbnailMode {
    
    Strict,
    
    Bestfit,
    
    FitoneBestfit,
}
impl<'de> ::serde::de::Deserialize<'de> for ThumbnailMode {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ThumbnailMode;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ThumbnailMode structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "strict" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailMode::Strict)
                    }
                    "bestfit" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailMode::Bestfit)
                    }
                    "fitone_bestfit" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailMode::FitoneBestfit)
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["strict",
                                    "bestfit",
                                    "fitone_bestfit"];
        deserializer.deserialize_struct("ThumbnailMode", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ThumbnailMode {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ThumbnailMode::Strict => {
                
                let mut s = serializer.serialize_struct("ThumbnailMode", 1)?;
                s.serialize_field(".tag", "strict")?;
                s.end()
            }
            ThumbnailMode::Bestfit => {
                
                let mut s = serializer.serialize_struct("ThumbnailMode", 1)?;
                s.serialize_field(".tag", "bestfit")?;
                s.end()
            }
            ThumbnailMode::FitoneBestfit => {
                
                let mut s = serializer.serialize_struct("ThumbnailMode", 1)?;
                s.serialize_field(".tag", "fitone_bestfit")?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum ThumbnailSize {
    
    W32h32,
    
    W64h64,
    
    W128h128,
    
    W256h256,
    
    W480h320,
    
    W640h480,
    
    W960h640,
    
    W1024h768,
    
    W2048h1536,
}
impl<'de> ::serde::de::Deserialize<'de> for ThumbnailSize {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ThumbnailSize;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ThumbnailSize structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "w32h32" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailSize::W32h32)
                    }
                    "w64h64" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailSize::W64h64)
                    }
                    "w128h128" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailSize::W128h128)
                    }
                    "w256h256" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailSize::W256h256)
                    }
                    "w480h320" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailSize::W480h320)
                    }
                    "w640h480" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailSize::W640h480)
                    }
                    "w960h640" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailSize::W960h640)
                    }
                    "w1024h768" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailSize::W1024h768)
                    }
                    "w2048h1536" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailSize::W2048h1536)
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["w32h32",
                                    "w64h64",
                                    "w128h128",
                                    "w256h256",
                                    "w480h320",
                                    "w640h480",
                                    "w960h640",
                                    "w1024h768",
                                    "w2048h1536"];
        deserializer.deserialize_struct("ThumbnailSize", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ThumbnailSize {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ThumbnailSize::W32h32 => {
                
                let mut s = serializer.serialize_struct("ThumbnailSize", 1)?;
                s.serialize_field(".tag", "w32h32")?;
                s.end()
            }
            ThumbnailSize::W64h64 => {
                
                let mut s = serializer.serialize_struct("ThumbnailSize", 1)?;
                s.serialize_field(".tag", "w64h64")?;
                s.end()
            }
            ThumbnailSize::W128h128 => {
                
                let mut s = serializer.serialize_struct("ThumbnailSize", 1)?;
                s.serialize_field(".tag", "w128h128")?;
                s.end()
            }
            ThumbnailSize::W256h256 => {
                
                let mut s = serializer.serialize_struct("ThumbnailSize", 1)?;
                s.serialize_field(".tag", "w256h256")?;
                s.end()
            }
            ThumbnailSize::W480h320 => {
                
                let mut s = serializer.serialize_struct("ThumbnailSize", 1)?;
                s.serialize_field(".tag", "w480h320")?;
                s.end()
            }
            ThumbnailSize::W640h480 => {
                
                let mut s = serializer.serialize_struct("ThumbnailSize", 1)?;
                s.serialize_field(".tag", "w640h480")?;
                s.end()
            }
            ThumbnailSize::W960h640 => {
                
                let mut s = serializer.serialize_struct("ThumbnailSize", 1)?;
                s.serialize_field(".tag", "w960h640")?;
                s.end()
            }
            ThumbnailSize::W1024h768 => {
                
                let mut s = serializer.serialize_struct("ThumbnailSize", 1)?;
                s.serialize_field(".tag", "w1024h768")?;
                s.end()
            }
            ThumbnailSize::W2048h1536 => {
                
                let mut s = serializer.serialize_struct("ThumbnailSize", 1)?;
                s.serialize_field(".tag", "w2048h1536")?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct ThumbnailV2Arg {
    
    
    pub resource: PathOrLink,
    
    
    pub format: ThumbnailFormat,
    
    pub size: ThumbnailSize,
    
    pub mode: ThumbnailMode,
}
impl ThumbnailV2Arg {
    pub fn new(resource: PathOrLink) -> Self {
        ThumbnailV2Arg {
            resource,
            format: ThumbnailFormat::Jpeg,
            size: ThumbnailSize::W64h64,
            mode: ThumbnailMode::Strict,
        }
    }
    pub fn with_format(mut self, value: ThumbnailFormat) -> Self {
        self.format = value;
        self
    }
    pub fn with_size(mut self, value: ThumbnailSize) -> Self {
        self.size = value;
        self
    }
    pub fn with_mode(mut self, value: ThumbnailMode) -> Self {
        self.mode = value;
        self
    }
}
const THUMBNAIL_V2_ARG_FIELDS: &[&str] = &["resource",
                                           "format",
                                           "size",
                                           "mode"];
impl ThumbnailV2Arg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<ThumbnailV2Arg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<ThumbnailV2Arg>, V::Error> {
        let mut field_resource = None;
        let mut field_format = None;
        let mut field_size = None;
        let mut field_mode = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "resource" => {
                    if field_resource.is_some() {
                        return Err(::serde::de::Error::duplicate_field("resource"));
                    }
                    field_resource = Some(map.next_value()?);
                }
                "format" => {
                    if field_format.is_some() {
                        return Err(::serde::de::Error::duplicate_field("format"));
                    }
                    field_format = Some(map.next_value()?);
                }
                "size" => {
                    if field_size.is_some() {
                        return Err(::serde::de::Error::duplicate_field("size"));
                    }
                    field_size = Some(map.next_value()?);
                }
                "mode" => {
                    if field_mode.is_some() {
                        return Err(::serde::de::Error::duplicate_field("mode"));
                    }
                    field_mode = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = ThumbnailV2Arg {
            resource: field_resource.ok_or_else(|| ::serde::de::Error::missing_field("resource"))?,
            format: field_format.unwrap_or(ThumbnailFormat::Jpeg),
            size: field_size.unwrap_or(ThumbnailSize::W64h64),
            mode: field_mode.unwrap_or(ThumbnailMode::Strict),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("resource", &self.resource)?;
        s.serialize_field("format", &self.format)?;
        s.serialize_field("size", &self.size)?;
        s.serialize_field("mode", &self.mode)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for ThumbnailV2Arg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = ThumbnailV2Arg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ThumbnailV2Arg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                ThumbnailV2Arg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("ThumbnailV2Arg", THUMBNAIL_V2_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for ThumbnailV2Arg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("ThumbnailV2Arg", 4)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum ThumbnailV2Error {
    
    Path(LookupError),
    
    UnsupportedExtension,
    
    UnsupportedImage,
    
    ConversionError,
    
    AccessDenied,
    
    NotFound,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for ThumbnailV2Error {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = ThumbnailV2Error;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a ThumbnailV2Error structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(ThumbnailV2Error::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "unsupported_extension" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailV2Error::UnsupportedExtension)
                    }
                    "unsupported_image" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailV2Error::UnsupportedImage)
                    }
                    "conversion_error" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailV2Error::ConversionError)
                    }
                    "access_denied" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailV2Error::AccessDenied)
                    }
                    "not_found" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailV2Error::NotFound)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(ThumbnailV2Error::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "unsupported_extension",
                                    "unsupported_image",
                                    "conversion_error",
                                    "access_denied",
                                    "not_found",
                                    "other"];
        deserializer.deserialize_struct("ThumbnailV2Error", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for ThumbnailV2Error {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            ThumbnailV2Error::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("ThumbnailV2Error", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            ThumbnailV2Error::UnsupportedExtension => {
                
                let mut s = serializer.serialize_struct("ThumbnailV2Error", 1)?;
                s.serialize_field(".tag", "unsupported_extension")?;
                s.end()
            }
            ThumbnailV2Error::UnsupportedImage => {
                
                let mut s = serializer.serialize_struct("ThumbnailV2Error", 1)?;
                s.serialize_field(".tag", "unsupported_image")?;
                s.end()
            }
            ThumbnailV2Error::ConversionError => {
                
                let mut s = serializer.serialize_struct("ThumbnailV2Error", 1)?;
                s.serialize_field(".tag", "conversion_error")?;
                s.end()
            }
            ThumbnailV2Error::AccessDenied => {
                
                let mut s = serializer.serialize_struct("ThumbnailV2Error", 1)?;
                s.serialize_field(".tag", "access_denied")?;
                s.end()
            }
            ThumbnailV2Error::NotFound => {
                
                let mut s = serializer.serialize_struct("ThumbnailV2Error", 1)?;
                s.serialize_field(".tag", "not_found")?;
                s.end()
            }
            ThumbnailV2Error::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for ThumbnailV2Error {
    fn description(&self) -> &str {
        "ThumbnailV2Error"
    }
}
impl ::std::fmt::Display for ThumbnailV2Error {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UnlockFileArg {
    
    pub path: WritePathOrId,
}
impl UnlockFileArg {
    pub fn new(path: WritePathOrId) -> Self {
        UnlockFileArg {
            path,
        }
    }
}
const UNLOCK_FILE_ARG_FIELDS: &[&str] = &["path"];
impl UnlockFileArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UnlockFileArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UnlockFileArg>, V::Error> {
        let mut field_path = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "path" => {
                    if field_path.is_some() {
                        return Err(::serde::de::Error::duplicate_field("path"));
                    }
                    field_path = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UnlockFileArg {
            path: field_path.ok_or_else(|| ::serde::de::Error::missing_field("path"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("path", &self.path)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UnlockFileArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UnlockFileArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UnlockFileArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UnlockFileArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UnlockFileArg", UNLOCK_FILE_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UnlockFileArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UnlockFileArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UnlockFileBatchArg {
    
    
    pub entries: Vec<UnlockFileArg>,
}
impl UnlockFileBatchArg {
    pub fn new(entries: Vec<UnlockFileArg>) -> Self {
        UnlockFileBatchArg {
            entries,
        }
    }
}
const UNLOCK_FILE_BATCH_ARG_FIELDS: &[&str] = &["entries"];
impl UnlockFileBatchArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UnlockFileBatchArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UnlockFileBatchArg>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UnlockFileBatchArg {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UnlockFileBatchArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UnlockFileBatchArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UnlockFileBatchArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UnlockFileBatchArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UnlockFileBatchArg", UNLOCK_FILE_BATCH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UnlockFileBatchArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UnlockFileBatchArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum UploadError {
    
    Path(UploadWriteFailed),
    
    PropertiesError(super::file_properties::InvalidPropertyGroupError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for UploadError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = UploadError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => Ok(UploadError::Path(UploadWriteFailed::internal_deserialize(map)?)),
                    "properties_error" => {
                        match map.next_key()? {
                            Some("properties_error") => Ok(UploadError::PropertiesError(map.next_value()?)),
                            None => Err(de::Error::missing_field("properties_error")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "properties_error",
                                    "other"];
        deserializer.deserialize_struct("UploadError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for UploadError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            UploadError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadError", 3)?;
                s.serialize_field(".tag", "path")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            UploadError::PropertiesError(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadError", 2)?;
                s.serialize_field(".tag", "properties_error")?;
                s.serialize_field("properties_error", x)?;
                s.end()
            }
            UploadError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for UploadError {
    fn description(&self) -> &str {
        "UploadError"
    }
}
impl ::std::fmt::Display for UploadError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum UploadErrorWithProperties {
    
    Path(UploadWriteFailed),
    
    PropertiesError(super::file_properties::InvalidPropertyGroupError),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for UploadErrorWithProperties {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = UploadErrorWithProperties;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadErrorWithProperties structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "path" => Ok(UploadErrorWithProperties::Path(UploadWriteFailed::internal_deserialize(map)?)),
                    "properties_error" => {
                        match map.next_key()? {
                            Some("properties_error") => Ok(UploadErrorWithProperties::PropertiesError(map.next_value()?)),
                            None => Err(de::Error::missing_field("properties_error")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadErrorWithProperties::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["path",
                                    "properties_error",
                                    "other"];
        deserializer.deserialize_struct("UploadErrorWithProperties", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for UploadErrorWithProperties {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            UploadErrorWithProperties::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadErrorWithProperties", 3)?;
                s.serialize_field(".tag", "path")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            UploadErrorWithProperties::PropertiesError(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadErrorWithProperties", 2)?;
                s.serialize_field(".tag", "properties_error")?;
                s.serialize_field("properties_error", x)?;
                s.end()
            }
            UploadErrorWithProperties::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UploadSessionAppendArg {
    
    pub cursor: UploadSessionCursor,
    
    
    pub close: bool,
}
impl UploadSessionAppendArg {
    pub fn new(cursor: UploadSessionCursor) -> Self {
        UploadSessionAppendArg {
            cursor,
            close: false,
        }
    }
    pub fn with_close(mut self, value: bool) -> Self {
        self.close = value;
        self
    }
}
const UPLOAD_SESSION_APPEND_ARG_FIELDS: &[&str] = &["cursor",
                                                    "close"];
impl UploadSessionAppendArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UploadSessionAppendArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UploadSessionAppendArg>, V::Error> {
        let mut field_cursor = None;
        let mut field_close = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "cursor" => {
                    if field_cursor.is_some() {
                        return Err(::serde::de::Error::duplicate_field("cursor"));
                    }
                    field_cursor = Some(map.next_value()?);
                }
                "close" => {
                    if field_close.is_some() {
                        return Err(::serde::de::Error::duplicate_field("close"));
                    }
                    field_close = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UploadSessionAppendArg {
            cursor: field_cursor.ok_or_else(|| ::serde::de::Error::missing_field("cursor"))?,
            close: field_close.unwrap_or(false),
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("cursor", &self.cursor)?;
        s.serialize_field("close", &self.close)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionAppendArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UploadSessionAppendArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionAppendArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UploadSessionAppendArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UploadSessionAppendArg", UPLOAD_SESSION_APPEND_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionAppendArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UploadSessionAppendArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UploadSessionCursor {
    
    pub session_id: String,
    
    
    pub offset: u64,
}
impl UploadSessionCursor {
    pub fn new(session_id: String, offset: u64) -> Self {
        UploadSessionCursor {
            session_id,
            offset,
        }
    }
}
const UPLOAD_SESSION_CURSOR_FIELDS: &[&str] = &["session_id",
                                                "offset"];
impl UploadSessionCursor {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UploadSessionCursor, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UploadSessionCursor>, V::Error> {
        let mut field_session_id = None;
        let mut field_offset = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "session_id" => {
                    if field_session_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("session_id"));
                    }
                    field_session_id = Some(map.next_value()?);
                }
                "offset" => {
                    if field_offset.is_some() {
                        return Err(::serde::de::Error::duplicate_field("offset"));
                    }
                    field_offset = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UploadSessionCursor {
            session_id: field_session_id.ok_or_else(|| ::serde::de::Error::missing_field("session_id"))?,
            offset: field_offset.ok_or_else(|| ::serde::de::Error::missing_field("offset"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("session_id", &self.session_id)?;
        s.serialize_field("offset", &self.offset)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionCursor {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UploadSessionCursor;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionCursor struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UploadSessionCursor::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UploadSessionCursor", UPLOAD_SESSION_CURSOR_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionCursor {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UploadSessionCursor", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UploadSessionFinishArg {
    
    pub cursor: UploadSessionCursor,
    
    pub commit: CommitInfo,
}
impl UploadSessionFinishArg {
    pub fn new(cursor: UploadSessionCursor, commit: CommitInfo) -> Self {
        UploadSessionFinishArg {
            cursor,
            commit,
        }
    }
}
const UPLOAD_SESSION_FINISH_ARG_FIELDS: &[&str] = &["cursor",
                                                    "commit"];
impl UploadSessionFinishArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UploadSessionFinishArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UploadSessionFinishArg>, V::Error> {
        let mut field_cursor = None;
        let mut field_commit = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "cursor" => {
                    if field_cursor.is_some() {
                        return Err(::serde::de::Error::duplicate_field("cursor"));
                    }
                    field_cursor = Some(map.next_value()?);
                }
                "commit" => {
                    if field_commit.is_some() {
                        return Err(::serde::de::Error::duplicate_field("commit"));
                    }
                    field_commit = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UploadSessionFinishArg {
            cursor: field_cursor.ok_or_else(|| ::serde::de::Error::missing_field("cursor"))?,
            commit: field_commit.ok_or_else(|| ::serde::de::Error::missing_field("commit"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("cursor", &self.cursor)?;
        s.serialize_field("commit", &self.commit)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionFinishArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UploadSessionFinishArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionFinishArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UploadSessionFinishArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UploadSessionFinishArg", UPLOAD_SESSION_FINISH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionFinishArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UploadSessionFinishArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UploadSessionFinishBatchArg {
    
    pub entries: Vec<UploadSessionFinishArg>,
}
impl UploadSessionFinishBatchArg {
    pub fn new(entries: Vec<UploadSessionFinishArg>) -> Self {
        UploadSessionFinishBatchArg {
            entries,
        }
    }
}
const UPLOAD_SESSION_FINISH_BATCH_ARG_FIELDS: &[&str] = &["entries"];
impl UploadSessionFinishBatchArg {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UploadSessionFinishBatchArg, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UploadSessionFinishBatchArg>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UploadSessionFinishBatchArg {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionFinishBatchArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UploadSessionFinishBatchArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionFinishBatchArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UploadSessionFinishBatchArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UploadSessionFinishBatchArg", UPLOAD_SESSION_FINISH_BATCH_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionFinishBatchArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UploadSessionFinishBatchArg", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum UploadSessionFinishBatchJobStatus {
    
    InProgress,
    
    Complete(UploadSessionFinishBatchResult),
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionFinishBatchJobStatus {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = UploadSessionFinishBatchJobStatus;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionFinishBatchJobStatus structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "in_progress" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionFinishBatchJobStatus::InProgress)
                    }
                    "complete" => Ok(UploadSessionFinishBatchJobStatus::Complete(UploadSessionFinishBatchResult::internal_deserialize(map)?)),
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["in_progress",
                                    "complete"];
        deserializer.deserialize_struct("UploadSessionFinishBatchJobStatus", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionFinishBatchJobStatus {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            UploadSessionFinishBatchJobStatus::InProgress => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishBatchJobStatus", 1)?;
                s.serialize_field(".tag", "in_progress")?;
                s.end()
            }
            UploadSessionFinishBatchJobStatus::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishBatchJobStatus", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum UploadSessionFinishBatchLaunch {
    
    
    AsyncJobId(super::dbx_async::AsyncJobId),
    Complete(UploadSessionFinishBatchResult),
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionFinishBatchLaunch {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = UploadSessionFinishBatchLaunch;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionFinishBatchLaunch structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "async_job_id" => {
                        match map.next_key()? {
                            Some("async_job_id") => Ok(UploadSessionFinishBatchLaunch::AsyncJobId(map.next_value()?)),
                            None => Err(de::Error::missing_field("async_job_id")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "complete" => Ok(UploadSessionFinishBatchLaunch::Complete(UploadSessionFinishBatchResult::internal_deserialize(map)?)),
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionFinishBatchLaunch::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["async_job_id",
                                    "complete",
                                    "other"];
        deserializer.deserialize_struct("UploadSessionFinishBatchLaunch", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionFinishBatchLaunch {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            UploadSessionFinishBatchLaunch::AsyncJobId(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishBatchLaunch", 2)?;
                s.serialize_field(".tag", "async_job_id")?;
                s.serialize_field("async_job_id", x)?;
                s.end()
            }
            UploadSessionFinishBatchLaunch::Complete(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishBatchLaunch", 2)?;
                s.serialize_field(".tag", "complete")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            UploadSessionFinishBatchLaunch::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UploadSessionFinishBatchResult {
    
    
    
    pub entries: Vec<UploadSessionFinishBatchResultEntry>,
}
impl UploadSessionFinishBatchResult {
    pub fn new(entries: Vec<UploadSessionFinishBatchResultEntry>) -> Self {
        UploadSessionFinishBatchResult {
            entries,
        }
    }
}
const UPLOAD_SESSION_FINISH_BATCH_RESULT_FIELDS: &[&str] = &["entries"];
impl UploadSessionFinishBatchResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UploadSessionFinishBatchResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UploadSessionFinishBatchResult>, V::Error> {
        let mut field_entries = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "entries" => {
                    if field_entries.is_some() {
                        return Err(::serde::de::Error::duplicate_field("entries"));
                    }
                    field_entries = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UploadSessionFinishBatchResult {
            entries: field_entries.ok_or_else(|| ::serde::de::Error::missing_field("entries"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("entries", &self.entries)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionFinishBatchResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UploadSessionFinishBatchResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionFinishBatchResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UploadSessionFinishBatchResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UploadSessionFinishBatchResult", UPLOAD_SESSION_FINISH_BATCH_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionFinishBatchResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UploadSessionFinishBatchResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum UploadSessionFinishBatchResultEntry {
    Success(FileMetadata),
    Failure(UploadSessionFinishError),
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionFinishBatchResultEntry {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = UploadSessionFinishBatchResultEntry;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionFinishBatchResultEntry structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "success" => Ok(UploadSessionFinishBatchResultEntry::Success(FileMetadata::internal_deserialize(map)?)),
                    "failure" => {
                        match map.next_key()? {
                            Some("failure") => Ok(UploadSessionFinishBatchResultEntry::Failure(map.next_value()?)),
                            None => Err(de::Error::missing_field("failure")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["success",
                                    "failure"];
        deserializer.deserialize_struct("UploadSessionFinishBatchResultEntry", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionFinishBatchResultEntry {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            UploadSessionFinishBatchResultEntry::Success(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishBatchResultEntry", 19)?;
                s.serialize_field(".tag", "success")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            UploadSessionFinishBatchResultEntry::Failure(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishBatchResultEntry", 2)?;
                s.serialize_field(".tag", "failure")?;
                s.serialize_field("failure", x)?;
                s.end()
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum UploadSessionFinishError {
    
    LookupFailed(UploadSessionLookupError),
    
    
    Path(WriteError),
    
    PropertiesError(super::file_properties::InvalidPropertyGroupError),
    
    
    TooManySharedFolderTargets,
    
    
    TooManyWriteOperations,
    
    ConcurrentSessionDataNotAllowed,
    
    ConcurrentSessionNotClosed,
    
    ConcurrentSessionMissingData,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionFinishError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = UploadSessionFinishError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionFinishError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "lookup_failed" => {
                        match map.next_key()? {
                            Some("lookup_failed") => Ok(UploadSessionFinishError::LookupFailed(map.next_value()?)),
                            None => Err(de::Error::missing_field("lookup_failed")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "path" => {
                        match map.next_key()? {
                            Some("path") => Ok(UploadSessionFinishError::Path(map.next_value()?)),
                            None => Err(de::Error::missing_field("path")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "properties_error" => {
                        match map.next_key()? {
                            Some("properties_error") => Ok(UploadSessionFinishError::PropertiesError(map.next_value()?)),
                            None => Err(de::Error::missing_field("properties_error")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "too_many_shared_folder_targets" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionFinishError::TooManySharedFolderTargets)
                    }
                    "too_many_write_operations" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionFinishError::TooManyWriteOperations)
                    }
                    "concurrent_session_data_not_allowed" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionFinishError::ConcurrentSessionDataNotAllowed)
                    }
                    "concurrent_session_not_closed" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionFinishError::ConcurrentSessionNotClosed)
                    }
                    "concurrent_session_missing_data" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionFinishError::ConcurrentSessionMissingData)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionFinishError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["lookup_failed",
                                    "path",
                                    "properties_error",
                                    "too_many_shared_folder_targets",
                                    "too_many_write_operations",
                                    "concurrent_session_data_not_allowed",
                                    "concurrent_session_not_closed",
                                    "concurrent_session_missing_data",
                                    "other"];
        deserializer.deserialize_struct("UploadSessionFinishError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionFinishError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            UploadSessionFinishError::LookupFailed(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishError", 2)?;
                s.serialize_field(".tag", "lookup_failed")?;
                s.serialize_field("lookup_failed", x)?;
                s.end()
            }
            UploadSessionFinishError::Path(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishError", 2)?;
                s.serialize_field(".tag", "path")?;
                s.serialize_field("path", x)?;
                s.end()
            }
            UploadSessionFinishError::PropertiesError(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishError", 2)?;
                s.serialize_field(".tag", "properties_error")?;
                s.serialize_field("properties_error", x)?;
                s.end()
            }
            UploadSessionFinishError::TooManySharedFolderTargets => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishError", 1)?;
                s.serialize_field(".tag", "too_many_shared_folder_targets")?;
                s.end()
            }
            UploadSessionFinishError::TooManyWriteOperations => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishError", 1)?;
                s.serialize_field(".tag", "too_many_write_operations")?;
                s.end()
            }
            UploadSessionFinishError::ConcurrentSessionDataNotAllowed => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishError", 1)?;
                s.serialize_field(".tag", "concurrent_session_data_not_allowed")?;
                s.end()
            }
            UploadSessionFinishError::ConcurrentSessionNotClosed => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishError", 1)?;
                s.serialize_field(".tag", "concurrent_session_not_closed")?;
                s.end()
            }
            UploadSessionFinishError::ConcurrentSessionMissingData => {
                
                let mut s = serializer.serialize_struct("UploadSessionFinishError", 1)?;
                s.serialize_field(".tag", "concurrent_session_missing_data")?;
                s.end()
            }
            UploadSessionFinishError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for UploadSessionFinishError {
    fn description(&self) -> &str {
        "UploadSessionFinishError"
    }
}
impl ::std::fmt::Display for UploadSessionFinishError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum UploadSessionLookupError {
    
    NotFound,
    
    
    
    IncorrectOffset(UploadSessionOffsetError),
    
    
    Closed,
    
    NotClosed,
    
    
    TooLarge,
    
    ConcurrentSessionInvalidOffset,
    
    
    ConcurrentSessionInvalidDataSize,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionLookupError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = UploadSessionLookupError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionLookupError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "not_found" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionLookupError::NotFound)
                    }
                    "incorrect_offset" => Ok(UploadSessionLookupError::IncorrectOffset(UploadSessionOffsetError::internal_deserialize(map)?)),
                    "closed" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionLookupError::Closed)
                    }
                    "not_closed" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionLookupError::NotClosed)
                    }
                    "too_large" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionLookupError::TooLarge)
                    }
                    "concurrent_session_invalid_offset" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionLookupError::ConcurrentSessionInvalidOffset)
                    }
                    "concurrent_session_invalid_data_size" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionLookupError::ConcurrentSessionInvalidDataSize)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionLookupError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["not_found",
                                    "incorrect_offset",
                                    "closed",
                                    "not_closed",
                                    "too_large",
                                    "concurrent_session_invalid_offset",
                                    "concurrent_session_invalid_data_size",
                                    "other"];
        deserializer.deserialize_struct("UploadSessionLookupError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionLookupError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            UploadSessionLookupError::NotFound => {
                
                let mut s = serializer.serialize_struct("UploadSessionLookupError", 1)?;
                s.serialize_field(".tag", "not_found")?;
                s.end()
            }
            UploadSessionLookupError::IncorrectOffset(ref x) => {
                
                let mut s = serializer.serialize_struct("UploadSessionLookupError", 2)?;
                s.serialize_field(".tag", "incorrect_offset")?;
                x.internal_serialize::<S>(&mut s)?;
                s.end()
            }
            UploadSessionLookupError::Closed => {
                
                let mut s = serializer.serialize_struct("UploadSessionLookupError", 1)?;
                s.serialize_field(".tag", "closed")?;
                s.end()
            }
            UploadSessionLookupError::NotClosed => {
                
                let mut s = serializer.serialize_struct("UploadSessionLookupError", 1)?;
                s.serialize_field(".tag", "not_closed")?;
                s.end()
            }
            UploadSessionLookupError::TooLarge => {
                
                let mut s = serializer.serialize_struct("UploadSessionLookupError", 1)?;
                s.serialize_field(".tag", "too_large")?;
                s.end()
            }
            UploadSessionLookupError::ConcurrentSessionInvalidOffset => {
                
                let mut s = serializer.serialize_struct("UploadSessionLookupError", 1)?;
                s.serialize_field(".tag", "concurrent_session_invalid_offset")?;
                s.end()
            }
            UploadSessionLookupError::ConcurrentSessionInvalidDataSize => {
                
                let mut s = serializer.serialize_struct("UploadSessionLookupError", 1)?;
                s.serialize_field(".tag", "concurrent_session_invalid_data_size")?;
                s.end()
            }
            UploadSessionLookupError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for UploadSessionLookupError {
    fn description(&self) -> &str {
        "UploadSessionLookupError"
    }
}
impl ::std::fmt::Display for UploadSessionLookupError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UploadSessionOffsetError {
    
    pub correct_offset: u64,
}
impl UploadSessionOffsetError {
    pub fn new(correct_offset: u64) -> Self {
        UploadSessionOffsetError {
            correct_offset,
        }
    }
}
const UPLOAD_SESSION_OFFSET_ERROR_FIELDS: &[&str] = &["correct_offset"];
impl UploadSessionOffsetError {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UploadSessionOffsetError, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UploadSessionOffsetError>, V::Error> {
        let mut field_correct_offset = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "correct_offset" => {
                    if field_correct_offset.is_some() {
                        return Err(::serde::de::Error::duplicate_field("correct_offset"));
                    }
                    field_correct_offset = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UploadSessionOffsetError {
            correct_offset: field_correct_offset.ok_or_else(|| ::serde::de::Error::missing_field("correct_offset"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("correct_offset", &self.correct_offset)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionOffsetError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UploadSessionOffsetError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionOffsetError struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UploadSessionOffsetError::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UploadSessionOffsetError", UPLOAD_SESSION_OFFSET_ERROR_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionOffsetError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UploadSessionOffsetError", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UploadSessionStartArg {
    
    
    pub close: bool,
    
    
    pub session_type: Option<UploadSessionType>,
}
impl Default for UploadSessionStartArg {
    fn default() -> Self {
        UploadSessionStartArg {
            close: false,
            session_type: None,
        }
    }
}
impl UploadSessionStartArg {
    pub fn with_close(mut self, value: bool) -> Self {
        self.close = value;
        self
    }
    pub fn with_session_type(mut self, value: UploadSessionType) -> Self {
        self.session_type = Some(value);
        self
    }
}
const UPLOAD_SESSION_START_ARG_FIELDS: &[&str] = &["close",
                                                   "session_type"];
impl UploadSessionStartArg {
    
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
    ) -> Result<UploadSessionStartArg, V::Error> {
        let mut field_close = None;
        let mut field_session_type = None;
        while let Some(key) = map.next_key::<&str>()? {
            match key {
                "close" => {
                    if field_close.is_some() {
                        return Err(::serde::de::Error::duplicate_field("close"));
                    }
                    field_close = Some(map.next_value()?);
                }
                "session_type" => {
                    if field_session_type.is_some() {
                        return Err(::serde::de::Error::duplicate_field("session_type"));
                    }
                    field_session_type = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        let result = UploadSessionStartArg {
            close: field_close.unwrap_or(false),
            session_type: field_session_type,
        };
        Ok(result)
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("close", &self.close)?;
        s.serialize_field("session_type", &self.session_type)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionStartArg {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UploadSessionStartArg;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionStartArg struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UploadSessionStartArg::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UploadSessionStartArg", UPLOAD_SESSION_START_ARG_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionStartArg {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UploadSessionStartArg", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum UploadSessionStartError {
    
    ConcurrentSessionDataNotAllowed,
    
    ConcurrentSessionCloseNotAllowed,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionStartError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = UploadSessionStartError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionStartError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "concurrent_session_data_not_allowed" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionStartError::ConcurrentSessionDataNotAllowed)
                    }
                    "concurrent_session_close_not_allowed" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionStartError::ConcurrentSessionCloseNotAllowed)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionStartError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["concurrent_session_data_not_allowed",
                                    "concurrent_session_close_not_allowed",
                                    "other"];
        deserializer.deserialize_struct("UploadSessionStartError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionStartError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            UploadSessionStartError::ConcurrentSessionDataNotAllowed => {
                
                let mut s = serializer.serialize_struct("UploadSessionStartError", 1)?;
                s.serialize_field(".tag", "concurrent_session_data_not_allowed")?;
                s.end()
            }
            UploadSessionStartError::ConcurrentSessionCloseNotAllowed => {
                
                let mut s = serializer.serialize_struct("UploadSessionStartError", 1)?;
                s.serialize_field(".tag", "concurrent_session_close_not_allowed")?;
                s.end()
            }
            UploadSessionStartError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for UploadSessionStartError {
    fn description(&self) -> &str {
        "UploadSessionStartError"
    }
}
impl ::std::fmt::Display for UploadSessionStartError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UploadSessionStartResult {
    
    
    
    pub session_id: String,
}
impl UploadSessionStartResult {
    pub fn new(session_id: String) -> Self {
        UploadSessionStartResult {
            session_id,
        }
    }
}
const UPLOAD_SESSION_START_RESULT_FIELDS: &[&str] = &["session_id"];
impl UploadSessionStartResult {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UploadSessionStartResult, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UploadSessionStartResult>, V::Error> {
        let mut field_session_id = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "session_id" => {
                    if field_session_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("session_id"));
                    }
                    field_session_id = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UploadSessionStartResult {
            session_id: field_session_id.ok_or_else(|| ::serde::de::Error::missing_field("session_id"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("session_id", &self.session_id)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionStartResult {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UploadSessionStartResult;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionStartResult struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UploadSessionStartResult::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UploadSessionStartResult", UPLOAD_SESSION_START_RESULT_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionStartResult {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UploadSessionStartResult", 1)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum UploadSessionType {
    
    Sequential,
    
    Concurrent,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for UploadSessionType {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = UploadSessionType;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadSessionType structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "sequential" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionType::Sequential)
                    }
                    "concurrent" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionType::Concurrent)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(UploadSessionType::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["sequential",
                                    "concurrent",
                                    "other"];
        deserializer.deserialize_struct("UploadSessionType", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for UploadSessionType {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            UploadSessionType::Sequential => {
                
                let mut s = serializer.serialize_struct("UploadSessionType", 1)?;
                s.serialize_field(".tag", "sequential")?;
                s.end()
            }
            UploadSessionType::Concurrent => {
                
                let mut s = serializer.serialize_struct("UploadSessionType", 1)?;
                s.serialize_field(".tag", "concurrent")?;
                s.end()
            }
            UploadSessionType::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct UploadWriteFailed {
    
    pub reason: WriteError,
    
    
    
    pub upload_session_id: String,
}
impl UploadWriteFailed {
    pub fn new(reason: WriteError, upload_session_id: String) -> Self {
        UploadWriteFailed {
            reason,
            upload_session_id,
        }
    }
}
const UPLOAD_WRITE_FAILED_FIELDS: &[&str] = &["reason",
                                              "upload_session_id"];
impl UploadWriteFailed {
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        map: V,
    ) -> Result<UploadWriteFailed, V::Error> {
        Self::internal_deserialize_opt(map, false).map(Option::unwrap)
    }
    pub(crate) fn internal_deserialize_opt<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
        optional: bool,
    ) -> Result<Option<UploadWriteFailed>, V::Error> {
        let mut field_reason = None;
        let mut field_upload_session_id = None;
        let mut nothing = true;
        while let Some(key) = map.next_key::<&str>()? {
            nothing = false;
            match key {
                "reason" => {
                    if field_reason.is_some() {
                        return Err(::serde::de::Error::duplicate_field("reason"));
                    }
                    field_reason = Some(map.next_value()?);
                }
                "upload_session_id" => {
                    if field_upload_session_id.is_some() {
                        return Err(::serde::de::Error::duplicate_field("upload_session_id"));
                    }
                    field_upload_session_id = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        if optional && nothing {
            return Ok(None);
        }
        let result = UploadWriteFailed {
            reason: field_reason.ok_or_else(|| ::serde::de::Error::missing_field("reason"))?,
            upload_session_id: field_upload_session_id.ok_or_else(|| ::serde::de::Error::missing_field("upload_session_id"))?,
        };
        Ok(Some(result))
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("reason", &self.reason)?;
        s.serialize_field("upload_session_id", &self.upload_session_id)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for UploadWriteFailed {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = UploadWriteFailed;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a UploadWriteFailed struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                UploadWriteFailed::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("UploadWriteFailed", UPLOAD_WRITE_FAILED_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for UploadWriteFailed {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("UploadWriteFailed", 2)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub struct VideoMetadata {
    
    pub dimensions: Option<Dimensions>,
    
    pub location: Option<GpsCoordinates>,
    
    pub time_taken: Option<super::common::DropboxTimestamp>,
    
    pub duration: Option<u64>,
}
impl Default for VideoMetadata {
    fn default() -> Self {
        VideoMetadata {
            dimensions: None,
            location: None,
            time_taken: None,
            duration: None,
        }
    }
}
impl VideoMetadata {
    pub fn with_dimensions(mut self, value: Dimensions) -> Self {
        self.dimensions = Some(value);
        self
    }
    pub fn with_location(mut self, value: GpsCoordinates) -> Self {
        self.location = Some(value);
        self
    }
    pub fn with_time_taken(mut self, value: super::common::DropboxTimestamp) -> Self {
        self.time_taken = Some(value);
        self
    }
    pub fn with_duration(mut self, value: u64) -> Self {
        self.duration = Some(value);
        self
    }
}
const VIDEO_METADATA_FIELDS: &[&str] = &["dimensions",
                                         "location",
                                         "time_taken",
                                         "duration"];
impl VideoMetadata {
    
    pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
        mut map: V,
    ) -> Result<VideoMetadata, V::Error> {
        let mut field_dimensions = None;
        let mut field_location = None;
        let mut field_time_taken = None;
        let mut field_duration = None;
        while let Some(key) = map.next_key::<&str>()? {
            match key {
                "dimensions" => {
                    if field_dimensions.is_some() {
                        return Err(::serde::de::Error::duplicate_field("dimensions"));
                    }
                    field_dimensions = Some(map.next_value()?);
                }
                "location" => {
                    if field_location.is_some() {
                        return Err(::serde::de::Error::duplicate_field("location"));
                    }
                    field_location = Some(map.next_value()?);
                }
                "time_taken" => {
                    if field_time_taken.is_some() {
                        return Err(::serde::de::Error::duplicate_field("time_taken"));
                    }
                    field_time_taken = Some(map.next_value()?);
                }
                "duration" => {
                    if field_duration.is_some() {
                        return Err(::serde::de::Error::duplicate_field("duration"));
                    }
                    field_duration = Some(map.next_value()?);
                }
                _ => {
                    
                    map.next_value::<::serde_json::Value>()?;
                }
            }
        }
        let result = VideoMetadata {
            dimensions: field_dimensions,
            location: field_location,
            time_taken: field_time_taken,
            duration: field_duration,
        };
        Ok(result)
    }
    pub(crate) fn internal_serialize<S: ::serde::ser::Serializer>(
        &self,
        s: &mut S::SerializeStruct,
    ) -> Result<(), S::Error> {
        use serde::ser::SerializeStruct;
        s.serialize_field("dimensions", &self.dimensions)?;
        s.serialize_field("location", &self.location)?;
        s.serialize_field("time_taken", &self.time_taken)?;
        s.serialize_field("duration", &self.duration)
    }
}
impl<'de> ::serde::de::Deserialize<'de> for VideoMetadata {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{MapAccess, Visitor};
        struct StructVisitor;
        impl<'de> Visitor<'de> for StructVisitor {
            type Value = VideoMetadata;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a VideoMetadata struct")
            }
            fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
                VideoMetadata::internal_deserialize(map)
            }
        }
        deserializer.deserialize_struct("VideoMetadata", VIDEO_METADATA_FIELDS, StructVisitor)
    }
}
impl ::serde::ser::Serialize for VideoMetadata {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        let mut s = serializer.serialize_struct("VideoMetadata", 4)?;
        self.internal_serialize::<S>(&mut s)?;
        s.end()
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum WriteConflictError {
    
    File,
    
    Folder,
    
    FileAncestor,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for WriteConflictError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = WriteConflictError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a WriteConflictError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "file" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteConflictError::File)
                    }
                    "folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteConflictError::Folder)
                    }
                    "file_ancestor" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteConflictError::FileAncestor)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteConflictError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["file",
                                    "folder",
                                    "file_ancestor",
                                    "other"];
        deserializer.deserialize_struct("WriteConflictError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for WriteConflictError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            WriteConflictError::File => {
                
                let mut s = serializer.serialize_struct("WriteConflictError", 1)?;
                s.serialize_field(".tag", "file")?;
                s.end()
            }
            WriteConflictError::Folder => {
                
                let mut s = serializer.serialize_struct("WriteConflictError", 1)?;
                s.serialize_field(".tag", "folder")?;
                s.end()
            }
            WriteConflictError::FileAncestor => {
                
                let mut s = serializer.serialize_struct("WriteConflictError", 1)?;
                s.serialize_field(".tag", "file_ancestor")?;
                s.end()
            }
            WriteConflictError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for WriteConflictError {
    fn description(&self) -> &str {
        "WriteConflictError"
    }
}
impl ::std::fmt::Display for WriteConflictError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive] 
pub enum WriteError {
    
    
    
    MalformedPath(MalformedPathError),
    
    Conflict(WriteConflictError),
    
    NoWritePermission,
    
    InsufficientSpace,
    
    DisallowedName,
    
    TeamFolder,
    
    OperationSuppressed,
    
    TooManyWriteOperations,
    
    
    Other,
}
impl<'de> ::serde::de::Deserialize<'de> for WriteError {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = WriteError;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a WriteError structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "malformed_path" => {
                        match map.next_key()? {
                            Some("malformed_path") => Ok(WriteError::MalformedPath(map.next_value()?)),
                            None => Ok(WriteError::MalformedPath(None)),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "conflict" => {
                        match map.next_key()? {
                            Some("conflict") => Ok(WriteError::Conflict(map.next_value()?)),
                            None => Err(de::Error::missing_field("conflict")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    "no_write_permission" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteError::NoWritePermission)
                    }
                    "insufficient_space" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteError::InsufficientSpace)
                    }
                    "disallowed_name" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteError::DisallowedName)
                    }
                    "team_folder" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteError::TeamFolder)
                    }
                    "operation_suppressed" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteError::OperationSuppressed)
                    }
                    "too_many_write_operations" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteError::TooManyWriteOperations)
                    }
                    _ => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteError::Other)
                    }
                }
            }
        }
        const VARIANTS: &[&str] = &["malformed_path",
                                    "conflict",
                                    "no_write_permission",
                                    "insufficient_space",
                                    "disallowed_name",
                                    "team_folder",
                                    "operation_suppressed",
                                    "too_many_write_operations",
                                    "other"];
        deserializer.deserialize_struct("WriteError", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for WriteError {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            WriteError::MalformedPath(ref x) => {
                
                let n = if x.is_some() { 2 } else { 1 };
                let mut s = serializer.serialize_struct("WriteError", n)?;
                s.serialize_field(".tag", "malformed_path")?;
                if let Some(ref x) = x {
                    s.serialize_field("malformed_path", &x)?;
                }
                s.end()
            }
            WriteError::Conflict(ref x) => {
                
                let mut s = serializer.serialize_struct("WriteError", 2)?;
                s.serialize_field(".tag", "conflict")?;
                s.serialize_field("conflict", x)?;
                s.end()
            }
            WriteError::NoWritePermission => {
                
                let mut s = serializer.serialize_struct("WriteError", 1)?;
                s.serialize_field(".tag", "no_write_permission")?;
                s.end()
            }
            WriteError::InsufficientSpace => {
                
                let mut s = serializer.serialize_struct("WriteError", 1)?;
                s.serialize_field(".tag", "insufficient_space")?;
                s.end()
            }
            WriteError::DisallowedName => {
                
                let mut s = serializer.serialize_struct("WriteError", 1)?;
                s.serialize_field(".tag", "disallowed_name")?;
                s.end()
            }
            WriteError::TeamFolder => {
                
                let mut s = serializer.serialize_struct("WriteError", 1)?;
                s.serialize_field(".tag", "team_folder")?;
                s.end()
            }
            WriteError::OperationSuppressed => {
                
                let mut s = serializer.serialize_struct("WriteError", 1)?;
                s.serialize_field(".tag", "operation_suppressed")?;
                s.end()
            }
            WriteError::TooManyWriteOperations => {
                
                let mut s = serializer.serialize_struct("WriteError", 1)?;
                s.serialize_field(".tag", "too_many_write_operations")?;
                s.end()
            }
            WriteError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
        }
    }
}
impl ::std::error::Error for WriteError {
    fn description(&self) -> &str {
        "WriteError"
    }
}
impl ::std::fmt::Display for WriteError {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        write!(f, "{:?}", *self)
    }
}
#[derive(Debug, Clone, PartialEq)]
pub enum WriteMode {
    
    
    
    Add,
    
    
    Overwrite,
    
    
    
    Update(Rev),
}
impl<'de> ::serde::de::Deserialize<'de> for WriteMode {
    fn deserialize<D: ::serde::de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        
        use serde::de::{self, MapAccess, Visitor};
        struct EnumVisitor;
        impl<'de> Visitor<'de> for EnumVisitor {
            type Value = WriteMode;
            fn expecting(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                f.write_str("a WriteMode structure")
            }
            fn visit_map<V: MapAccess<'de>>(self, mut map: V) -> Result<Self::Value, V::Error> {
                let tag: &str = match map.next_key()? {
                    Some(".tag") => map.next_value()?,
                    _ => return Err(de::Error::missing_field(".tag"))
                };
                match tag {
                    "add" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteMode::Add)
                    }
                    "overwrite" => {
                        crate::eat_json_fields(&mut map)?;
                        Ok(WriteMode::Overwrite)
                    }
                    "update" => {
                        match map.next_key()? {
                            Some("update") => Ok(WriteMode::Update(map.next_value()?)),
                            None => Err(de::Error::missing_field("update")),
                            _ => Err(de::Error::unknown_field(tag, VARIANTS))
                        }
                    }
                    _ => Err(de::Error::unknown_variant(tag, VARIANTS))
                }
            }
        }
        const VARIANTS: &[&str] = &["add",
                                    "overwrite",
                                    "update"];
        deserializer.deserialize_struct("WriteMode", VARIANTS, EnumVisitor)
    }
}
impl ::serde::ser::Serialize for WriteMode {
    fn serialize<S: ::serde::ser::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        
        use serde::ser::SerializeStruct;
        match *self {
            WriteMode::Add => {
                
                let mut s = serializer.serialize_struct("WriteMode", 1)?;
                s.serialize_field(".tag", "add")?;
                s.end()
            }
            WriteMode::Overwrite => {
                
                let mut s = serializer.serialize_struct("WriteMode", 1)?;
                s.serialize_field(".tag", "overwrite")?;
                s.end()
            }
            WriteMode::Update(ref x) => {
                
                let mut s = serializer.serialize_struct("WriteMode", 2)?;
                s.serialize_field(".tag", "update")?;
                s.serialize_field("update", x)?;
                s.end()
            }
        }
    }
}