pyuploadcare/api_resources.py
def create_remote_copy(self, target, effects=None, make_public=None,
                           pattern=None):
        """Creates file copy in remote storage.

        Args:
            - target:
                Name of a custom storage connected to the project.
            - effects:
                Adds CDN image effects to ``self.default_effects`` if any.
            - make_public:
                To forbid public from accessing your files on the storage set
                ``make_public`` option to be False.
                Default value is None. Files have public access by default.
            - pattern:
                Specify ``pattern`` option to set S3 object key name.
                Takes precedence over pattern set in project settings.
                If neither is specified defaults to
                `${uuid}/${filename}${effects}${ext}`.

        For more information on each of the options above please refer to
        REST API docs https://uploadcare.com/docs/api_reference/rest/accessing_files/.

        Following example copies a file to custom storage named ``samplefs``:

             >>> file = File('e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a')
             >>> file.create_remote_copy(target='samplefs',
             >>>                         make_public=True,
             >>>                         pattern='${uuid}/${filename}${ext}')

        Now custom storage ``samplefs`` contains publicly available file
        with original filename billmurray.jpg in
        in the directory named ``e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a``.

        """
        effects = self._build_effects(effects)
        data = {
            'source': self.cdn_path(effects),
            'target': target
        }

        if make_public is not None:
            data['make_public'] = make_public
        if pattern is not None:
            data['pattern'] = pattern
        return rest_request('POST', 'files/', data=data)
def create_remote_copy(self, target, effects=None, make_public=None,
                           pattern=None):
        effects = self._build_effects(effects)
        data = {
            'source': self.cdn_path(effects),
            'target': target
        }

        if make_public is not None:
            data['make_public'] = make_public
        if pattern is not None:
            data['pattern'] = pattern
        return rest_request('POST', 'files/', data=data)
def create_remote_copy ( self , target , effects = None , make_public = None , pattern = None ) : effects = self . _build_effects ( effects ) data = { 'source' : self . cdn_path ( effects ) , 'target' : target } if make_public is not None : data [ 'make_public' ] = make_public if pattern is not None : data [ 'pattern' ] = pattern return rest_request ( 'POST' , 'files/' , data = data )
Creates file copy in remote storage.

        Args:
            - target:
                Name of a custom storage connected to the project.
            - effects:
                Adds CDN image effects to ``self.default_effects`` if any.
            - make_public:
                To forbid public from accessing your files on the storage set
                ``make_public`` option to be False.
                Default value is None. Files have public access by default.
            - pattern:
                Specify ``pattern`` option to set S3 object key name.
                Takes precedence over pattern set in project settings.
                If neither is specified defaults to
                `${uuid}/${filename}${effects}${ext}`.

        For more information on each of the options above please refer to
        REST API docs https://uploadcare.com/docs/api_reference/rest/accessing_files/.

        Following example copies a file to custom storage named ``samplefs``:

             >>> file = File('e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a')
             >>> file.create_remote_copy(target='samplefs',
             >>>                         make_public=True,
             >>>                         pattern='${uuid}/${filename}${ext}')

        Now custom storage ``samplefs`` contains publicly available file
        with original filename billmurray.jpg in
        in the directory named ``e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a``.
Creates file copy in remote storage .