parameters: (params)
return_statement: return {'docid': result['name'], 'token': ''}
docstring: Get a Download ID.
  
    Args:
      params: An object containing visualization options with the following
        possible values:
          image - The image to download.
          - name: a base name to use when constructing filenames. Only applicable
              when format is "ZIPPED_GEO_TIFF" (default) or filePerBand is true.
              Defaults to the image id (or "download" for computed images) when
              format is "ZIPPED_GEO_TIFF" or filePerBand is true, otherwise a
              random character string is generated. Band names are appended when
              filePerBand is true.
          - bands: a description of the bands to download. Must be an array of
              band names or an array of dictionaries, each with the
              following keys:
            + id: the name of the band, a string, required.
            + crs: an optional CRS string defining the band projection.
            + crs_transform: an optional array of 6 numbers specifying an affine
                transform from the specified CRS, in the order:
                [xScale, yShearing, xShearing, yScale, xTranslation, yTranslation]
            + dimensions: an optional array of two integers defining the width and
                height to which the band is cropped.
            + scale: an optional number, specifying the scale in meters of the
                   band; ignored if crs and crs_transform are specified.
          - crs: a default CRS string to use for any bands that do not explicitly
              specify one.
          - crs_transform: a default affine transform to use for any bands that do
              not specify one, of the same format as the crs_transform of bands.
          - dimensions: default image cropping dimensions to use for any bands
              that do not specify them.
          - scale: a default scale to use for any bands that do not specify one;
              ignored if crs and crs_transform is specified.
          - region: a polygon specifying a region to download; ignored if crs
              and crs_transform are specified.
          - filePerBand: whether to produce a separate GeoTIFF per band (boolean).
              Defaults to true. If false, a single GeoTIFF is produced and all
              band-level transformations will be ignored.
          - format: the download format. One of:
              "ZIPPED_GEO_TIFF" (GeoTIFF file(s) wrapped in a zip file, default),
              "GEO_TIFF" (GeoTIFF file), "NPY" (NumPy binary format).
              If "GEO_TIFF" or "NPY", filePerBand and all band-level
              transformations will be ignored. Loading a NumPy output results in
              a structured array.
          - id: deprecated, use image parameter.
  
    Returns:
      A dict containing a docid and token.
docstring_summary: Get a Download ID.
docstring_tokens: Get a Download ID .
function: def getDownloadId(params):
    """Get a Download ID.
  
    Args:
      params: An object containing visualization options with the following
        possible values:
          image - The image to download.
          - name: a base name to use when constructing filenames. Only applicable
              when format is "ZIPPED_GEO_TIFF" (default) or filePerBand is true.
              Defaults to the image id (or "download" for computed images) when
              format is "ZIPPED_GEO_TIFF" or filePerBand is true, otherwise a
              random character string is generated. Band names are appended when
              filePerBand is true.
          - bands: a description of the bands to download. Must be an array of
              band names or an array of dictionaries, each with the
              following keys:
            + id: the name of the band, a string, required.
            + crs: an optional CRS string defining the band projection.
            + crs_transform: an optional array of 6 numbers specifying an affine
                transform from the specified CRS, in the order:
                [xScale, yShearing, xShearing, yScale, xTranslation, yTranslation]
            + dimensions: an optional array of two integers defining the width and
                height to which the band is cropped.
            + scale: an optional number, specifying the scale in meters of the
                   band; ignored if crs and crs_transform are specified.
          - crs: a default CRS string to use for any bands that do not explicitly
              specify one.
          - crs_transform: a default affine transform to use for any bands that do
              not specify one, of the same format as the crs_transform of bands.
          - dimensions: default image cropping dimensions to use for any bands
              that do not specify them.
          - scale: a default scale to use for any bands that do not specify one;
              ignored if crs and crs_transform is specified.
          - region: a polygon specifying a region to download; ignored if crs
              and crs_transform are specified.
          - filePerBand: whether to produce a separate GeoTIFF per band (boolean).
              Defaults to true. If false, a single GeoTIFF is produced and all
              band-level transformations will be ignored.
          - format: the download format. One of:
              "ZIPPED_GEO_TIFF" (GeoTIFF file(s) wrapped in a zip file, default),
              "GEO_TIFF" (GeoTIFF file), "NPY" (NumPy binary format).
              If "GEO_TIFF" or "NPY", filePerBand and all band-level
              transformations will be ignored. Loading a NumPy output results in
              a structured array.
          - id: deprecated, use image parameter.
  
    Returns:
      A dict containing a docid and token.
    """
    params = params.copy()
    # Previously, the docs required an image ID parameter that was changed
    # to image. Due to the circular dependency, we raise an error and ask the
    # user to supply an ee.Image directly.
    if 'id' in params:
      raise ee_exception.EEException('Image ID string is not supported. '
                                     'Construct an image with the ID '
                                     '(e.g. ee.Image(id)) and use '
                                     'ee.Image.getDownloadURL instead.')
    if 'image' not in params:
      raise ee_exception.EEException('Missing image parameter.')
    if isinstance(params['image'], six.string_types):
      raise ee_exception.EEException('Image as JSON string not supported.')
    params.setdefault('filePerBand', True)
    params.setdefault(
        'format', 'ZIPPED_GEO_TIFF_PER_BAND'
        if params['filePerBand'] else 'ZIPPED_GEO_TIFF')
    if 'region' in params and ('scale' in params or 'crs_transform' in params
                              ) and 'dimensions' in params:
      raise ee_exception.EEException(
          'Cannot specify (bounding region, crs_transform/scale, dimensions) '
          'simultaneously.'
      )
    bands = None
    if 'bands' in params:
      bands = params['bands']
      if isinstance(bands, six.string_types):
        bands = _cloud_api_utils.convert_to_band_list(bands)
      if not isinstance(bands, list):
        raise ee_exception.EEException('Bands parameter must be a list.')
      if all(isinstance(band, six.string_types) for band in bands):
        # Support expressing the bands list as a list of strings.
        bands = [{'id': band} for band in bands]
      if not all('id' in band for band in bands):
        raise ee_exception.EEException('Each band dictionary must have an id.')
      params['bands'] = bands
    request = {
        'expression':
            serializer.encode(
                params['image']._build_download_id_image(params),  # pylint: disable=protected-access
                for_cloud_api=True),
        'fileFormat':
            _cloud_api_utils.convert_to_image_file_format(params.get('format')),
    }
    request['filenamePrefix'] = params.get('name')
    if bands:
      request['bandIds'] = _cloud_api_utils.convert_to_band_list(
          [band['id'] for band in bands])
    result = _execute_cloud_call(
        _get_cloud_api_resource().projects().thumbnails().create(
            parent=_get_projects_path(), fields='name', body=request))
    return {'docid': result['name'], 'token': ''}
function_tokens: def getDownloadId ( params ) : params = params . copy ( ) # Previously, the docs required an image ID parameter that was changed # to image. Due to the circular dependency, we raise an error and ask the # user to supply an ee.Image directly. if 'id' in params : raise ee_exception . EEException ( 'Image ID string is not supported. ' 'Construct an image with the ID ' '(e.g. ee.Image(id)) and use ' 'ee.Image.getDownloadURL instead.' ) if 'image' not in params : raise ee_exception . EEException ( 'Missing image parameter.' ) if isinstance ( params [ 'image' ] , six . string_types ) : raise ee_exception . EEException ( 'Image as JSON string not supported.' ) params . setdefault ( 'filePerBand' , True ) params . setdefault ( 'format' , 'ZIPPED_GEO_TIFF_PER_BAND' if params [ 'filePerBand' ] else 'ZIPPED_GEO_TIFF' ) if 'region' in params and ( 'scale' in params or 'crs_transform' in params ) and 'dimensions' in params : raise ee_exception . EEException ( 'Cannot specify (bounding region, crs_transform/scale, dimensions) ' 'simultaneously.' ) bands = None if 'bands' in params : bands = params [ 'bands' ] if isinstance ( bands , six . string_types ) : bands = _cloud_api_utils . convert_to_band_list ( bands ) if not isinstance ( bands , list ) : raise ee_exception . EEException ( 'Bands parameter must be a list.' ) if all ( isinstance ( band , six . string_types ) for band in bands ) : # Support expressing the bands list as a list of strings. bands = [ { 'id' : band } for band in bands ] if not all ( 'id' in band for band in bands ) : raise ee_exception . EEException ( 'Each band dictionary must have an id.' ) params [ 'bands' ] = bands request = { 'expression' : serializer . encode ( params [ 'image' ] . _build_download_id_image ( params ) , # pylint: disable=protected-access for_cloud_api = True ) , 'fileFormat' : _cloud_api_utils . convert_to_image_file_format ( params . get ( 'format' ) ) , } request [ 'filenamePrefix' ] = params . get ( 'name' ) if bands : request [ 'bandIds' ] = _cloud_api_utils . convert_to_band_list ( [ band [ 'id' ] for band in bands ] ) result = _execute_cloud_call ( _get_cloud_api_resource ( ) . projects ( ) . thumbnails ( ) . create ( parent = _get_projects_path ( ) , fields = 'name' , body = request ) ) return { 'docid' : result [ 'name' ] , 'token' : '' }