"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateFile = exports.bulkPublishDraftFiles = exports.listDeletedFiles = exports.bulkRestoreFilesFromTrashBin = exports.bulkDeleteFiles = exports.generateWebSocketToken = exports.generateVideoStreamingUrl = exports.searchFiles = exports.listFiles = exports.bulkImportFile = exports.bulkImportFiles = exports.importFile = exports.generateFileResumableUploadUrl = exports.generateFileUploadUrl = exports.updateFileDescriptor = exports.getFileDescriptors = exports.getFileDescriptor = exports.generateFileDownloadUrl = exports.generateFilesDownloadUrl = exports.bulkAnnotateImages = void 0;
var wrapper = __importStar(require("./proto/proto-generated"));
var FilesService = wrapper.com.wix.media.site_media.v1.FilesService;
/**
 * Run Image Annotation process on provided list of file ids
 * Note - the processes of this endpoint are synchronous and may take time to complete
 */
function bulkAnnotateImages(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'bulkAnnotateImages';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.bulkAnnotateImages = bulkAnnotateImages;
/**
 * Generates a URL for downloading a compressed file containing specific files in the Media Manager.
 *
 * The compressed file can contain up to 1000 files.
 *
 * To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, call the Generate Files Download URL endpoint.
 * Since this is a permanent URL, it is less secure.
 * Therefore, to download private files, call the Generate File Download URL endpoint for each private file that you want to generate a download URL for.
 */
function generateFilesDownloadUrl(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'generateFilesDownloadUrl';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.generateFilesDownloadUrl = generateFilesDownloadUrl;
/**
 * Generates one or more temporary URLs for downloading a specific file in the Media Manager.
 *
 * To download different assets of the file, specify the `assetKeys` parameter which generates a download URL for each asset.
 * If no `assetKey` is specified, it defaults to `src`, which generates one download URL in the original file's format and quality.
 *
 * Call this endpoint to grant external clients access to a private media file. Specify the `expirationInMinutes` parameter to set the URL expiration time, and the `expirationRedirectUrl` parameter to add a redirect url when the URL expires.
 *
 * To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, call the Generate Files Download URL endpoint.
 * Since this is a permanent URL, it is less secure.
 * Therefore, to download private files, call the Generate File Download URL endpoint for each private file that you want to generate a download URL for.
 */
function generateFileDownloadUrl(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'generateFileDownloadUrl';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.generateFileDownloadUrl = generateFileDownloadUrl;
/** Gets information about a specific file in the Media Manager. */
function getFileDescriptor(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'getFileDescriptor';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.getFileDescriptor = getFileDescriptor;
/** Gets information about specific files in the Media Manager. */
function getFileDescriptors(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'getFileDescriptors';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.getFileDescriptors = getFileDescriptors;
/**
 * Updates a file. <br />
 *
 * Specify the `parentFolderId` parameter to move a file from its current folder to a different folder.
 */
function updateFileDescriptor(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'updateFileDescriptor';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.updateFileDescriptor = updateFileDescriptor;
/**
 * Generates an upload URL to allow external clients to upload a file to the Media Manager. <br/>
 *
 * To learn how external clients can use the generated upload URL in the response to upload a file to the Media Manager, see Upload API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/upload-api) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/upload-api)).
 * > **Notes:**
 * > - When you upload a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
 * > - Any interruption in the upload process stops the file upload. For files larger than 10MB, or when network connection is poor, call Generate File Resumable Upload URL instead. With the resumable upload URL, any interruption in the upload process pauses the file upload, and resumes the file upload process after the interruption.
 */
function generateFileUploadUrl(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'generateFileUploadUrl';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.generateFileUploadUrl = generateFileUploadUrl;
/**
 * Generates a resumable upload URL to allow external clients to easily upload large files over 10MB to the Media Manager. <br/>
 *
 * With the resumable upload URL, any interruptions in the upload process pauses the file upload, and resumes the file upload process after the interruption. The resumable upload URL is also helpful when network connection is poor.
 * To learn how external clients can use the generated upload URL in the response to upload large files to the Media Manager, see Resumable Upload API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/resumable-upload-api) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/resumable-upload-api)).
 *
 * > **Note:** When you upload a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
 */
function generateFileResumableUploadUrl(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'generateFileResumableUploadUrl';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.generateFileResumableUploadUrl = generateFileResumableUploadUrl;
/**
 * Imports a file to the Media Manager using an external url.
 *
 * Returns information about the imported file.
 * Specify the `parentFolderId` and `filePath` parameters to specify which folder you want the file to be imported to.
 * If no folder is specified, the file is imported to the `media-root` folder.
 *
 * >**Notes:**
 * > - The `media` property isn't returned in the `files` response object.
 * > - When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
 *
 * To import a file, you need to do one of the following:
 * - Specify its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
 * - Specify its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
 * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
 * > **Note:** If you want to validate the media type, specify the file's expected media type in the optional `mediaType` field of the request.  For example, `mediaType: 'IMAGE'`.
 */
function importFile(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'importFile';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.importFile = importFile;
/**
 * Imports a bulk of files to the Media Manager using external urls. <br/>
 *
 * Returns information about the imported files.
 *
 * Use the `parentFolderId` and `filePath` parameters to specify the folder you want each file to be imported to.
 * If no folder is specified, the file is imported to the `media-root` folder.
 *
 * >**Notes:**
 * > - The `media` property isn't returned in the `files` response object.
 * > - When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
 *
 * To import files, you need to do one of the following for each file:
 * - Specify its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
 * - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
 * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
 * > **Note:** If you want to validate the media type, specify the file's expected media type in the optional `mediaType` field of the request.  For example, `mediaType: 'IMAGE'`.
 * @deprecated It has been replaced with com.wix.media.site_media.v1.FilesService.BulkImportFile(), and will be removed on 2024-03-31.
 */
function bulkImportFiles(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'bulkImportFiles';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.bulkImportFiles = bulkImportFiles;
/**
 * Imports a bulk of files to the Media Manager using external urls. <br/>
 *
 * Returns information about the imported files.
 *
 * Specify the `parentFolderId` and `filePath` parameters to specify the folder you want each file to be imported to.
 * If no folder is specified, the file is imported to the `media-root` folder.
 *
 * >**Notes:**
 * > - The `media` property isn't returned in the `files` response object.
 * > - When you import a file, it's not immediately available, meaning you can't manage or use the file straight away. Learn more about knowing when a file is ready ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/importing-files#backend-modules_media_files_knowing-when-a-file-is-ready) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/files/importing-files#knowing-when-a-file-is-ready)).
 *
 * To import files, you need to do one of the following for each file:
 * - Specify its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
 * - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
 * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
 * > **Note:** If you want to validate the media type, specify the file's expected media type in the optional `mediaType` field of the request.  For example, `mediaType: 'IMAGE'`.
 */
function bulkImportFile(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'bulkImportFile';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.bulkImportFile = bulkImportFile;
/**
 * Retrieves a list of files in the Media Manager.
 *
 * To retrieve a list of files within a specific folder in the Media Manager, specify the folder's ID in the `parentFolderId` parameter. If no folder is specified, the method retrieves the list of files in the root folder of the Media Manager.
 */
function listFiles(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'listFiles';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.listFiles = listFiles;
/**
 * Retrieves a list of up to 200 files with the specified filtering, sorting, and cursor paging.
 *
 * If no parameters are specified, the method returns all files in the `MEDIA_ROOT` folder.
 *
 * ## Defaults
 *
 * Search Files has the following default setting, which you can override:
 * + Sorted by `updatedDate` in descending order.
 *
 * ## Filters
 *
 * When using filters for dates, you must use
 * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
 *
 * ## See also
 *
 * To learn about working with *Search* methods, see
 * _API Query Language_
 * ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language) | [REST](https://dev.wix.com/docs/rest/articles/get-started/api-query-language))
 * and *Sorting and Paging*
 * ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/api-query-language#the-sort-array) | [REST](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging)).
 */
function searchFiles(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'searchFiles';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.searchFiles = searchFiles;
/**
 * Generates a URL for streaming a specific video file in the Media Manager. <br/>
 *
 * To stream different assets of the file, specify the `assetKeys` parameter which generates a video streaming URL for each asset. If no assetKey is specified, it defaults to `src`, which generates one video streaming URL in the original file's format and quality.
 */
function generateVideoStreamingUrl(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'generateVideoStreamingUrl';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.generateVideoStreamingUrl = generateVideoStreamingUrl;
/**
 * Return a token for a direct web socket notification channel
 * This API is not platformized (Contact the Media team for use instructions)
 * This API should be internal only
 */
function generateWebSocketToken(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'generateWebSocketToken';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.generateWebSocketToken = generateWebSocketToken;
/**
 * Deletes the specified files from the Media Manager. <br/>
 *
 * The deleted files are moved to the Media Manager's trash bin (`TRASH-ROOT` folder) unless permanently deleted. To permanently delete files, specify the `permanent` parameter with the value `true`. Permanently deleting files isn't reversible, so make sure that these files aren't being used in a site or in any other way as the files will no longer be accessible.
 *
 * Note the following:
 * * The specified files can be from different folders.
 * * Moving multiple files at once is an asynchronous action, and may take time for the changes to appear in the Media Manager.
 * * Attempting to delete files that are already in the trash bin doesn't result in an error.
 * * If a site contains deleted media files, the deleted media files still appear on the site as the files are still in the Media Manager (in the trash bin).
 * * You can use Bulk Restore Files From Trash Bin to restore files from the Media Manager's trash bin.
 */
function bulkDeleteFiles(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'bulkDeleteFiles';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.bulkDeleteFiles = bulkDeleteFiles;
/** Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager. */
function bulkRestoreFilesFromTrashBin(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'bulkRestoreFilesFromTrashBin';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.bulkRestoreFilesFromTrashBin = bulkRestoreFilesFromTrashBin;
/**
 * Retrieves a list of files in the Media Manager's trash bin. <br/>
 *
 * >**Note:** The Media Manager's trash bin (`TRASH-ROOT` folder) only contains temporarily deleted files, not permanently deleted files.
 */
function listDeletedFiles(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'listDeletedFiles';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.listDeletedFiles = listDeletedFiles;
function bulkPublishDraftFiles(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'bulkPublishDraftFiles';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.bulkPublishDraftFiles = bulkPublishDraftFiles;
/**
 * Updates a file.
 *
 * Specify the `parentFolderId` parameter to move a file from its current folder to a different folder.
 * @deprecated It has been replaced with com.wix.media.site_media.v1.FilesService.UpdateFileDescriptor(), and will be removed on 2023-03-31.
 */
function updateFile(payload) {
    var serviceArtifactId = 'com.wixpress.prospero.wix-privatemedia-proxy-server';
    var serviceProtoClass = FilesService;
    var methodName = 'updateFile';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
exports.updateFile = updateFile;
//# sourceMappingURL=rpc.impl.js.map