
    >                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	  G d d	e
      Z G d
 de
      Z G d de
      Z G d de
      Zy)z6API map classes used with the CloudApiDelegator class.    )absolute_import)print_function)division)unicode_literals)BotoTranslation)
GcsJsonApic                       e Zd ZdZdZdZy)ApiSelectorzEnum class for API.XMLJSONN)__name__
__module____qualname____doc__r   r        #platform/gsutil/gslib/cs_api_map.pyr
   r
      s    #	$r   r
   c                       e Zd ZdZdZdZdZy)ApiMapConstantszEnum class for API map entries.apiclass	supporteddefaultN)r   r   r   r   API_MAPSUPPORT_MAPDEFAULT_MAPr   r   r   r   r       s    ''++r   r   c                        e Zd ZdZed        Zy)GsutilApiClassMapFactorya  Factory for generating gsutil API class maps.

  A valid class map is defined as:
    {
      (key) Provider prefix used in URI strings.
      (value) {
        (key) ApiSelector describing the API format.
        (value) CloudApi child class that implements this API.
      }
    }
  c                     t         j                  t        t         j                  t        i}t         j                  t        i}||d}|S )z%Returns the default gsutil class map.)gss3)r
   r   r   r   r   )clsgs_class_maps3_class_map	class_maps       r   GetClassMapz$GsutilApiClassMapFactory.GetClassMap4   sH     	*L
 	L I r   N)r   r   r   r   classmethodr%   r   r   r   r   r   '   s    
  r   r   c                        e Zd ZdZed        Zy)GsutilApiMapFactorya  Factory the generates the default gsutil API map.

    The API map determines which Cloud API implementation is used for a given
    command.  A valid API map is defined as:
    {
      (key) ApiMapConstants.API_MAP : (value) Gsutil API class map (as
          described in GsutilApiClassMapFactory comments).
      (key) ApiMapConstants.SUPPORT_MAP : (value) {
        (key) Provider prefix used in URI strings.
        (value) list of ApiSelectors supported by the command for this provider.
      }
      (key) ApiMapConstants.DEFAULT_MAP : (value) {
        (key) Provider prefix used in URI strings.
        (value) Default ApiSelector for this command and provider.
      }
    }
  c                     t         j                  |j                         t         j                  |t         j                  |iS )a  Creates a GsutilApiMap for use by the command from the inputs.

    Args:
      gsutil_api_class_map_factory: Factory defining a GetClassMap() function
                                    adhering to GsutilApiClassMapFactory
                                    semantics.
      support_map: Entries for ApiMapConstants.SUPPORT_MAP as described above.
      default_map: Entries for ApiMapConstants.DEFAULT_MAP as described above.

    Returns:
      GsutilApiMap generated from the inputs.
    )r   r   r%   r   r   )r!   gsutil_api_class_map_factorysupport_mapdefault_maps       r   	GetApiMapzGsutilApiMapFactory.GetApiMapX   s9     	!=!I!I!K##[##[ r   N)r   r   r   r   r&   r-   r   r   r   r(   r(   E   s    $  r   r(   N)r   
__future__r   r   r   r   gslib.boto_translationr   gslib.gcs_json_apir   objectr
   r   r   r(   r   r   r   <module>r2      sL    = & %  ' 2 )& f v <%& %r   