B
    b)                 @   sr   d Z ddlmZ dZdZdZdZddlZddlZddl	m
Z
 dd	l	mZ dd
lmZ eeZG dd deZdS )z
Register.py
^^^^^^^^^^

API for OneDep Web Service Registration

:copyright: @wwPDB
:license: Apache 2.0, see LICENSE file for more details.


Updates:
    21-Sep-2016  jdw  adapted for the onedep tree package -

    )unicode_literalszrestructuredtext enzJohn Westbrookzjwest@rcsb.rutgers.eduz
Apache 2.0N)__version__)
__apiUrl__)ApiBasec                   s&   e Zd Zd fdd	Zdd Z  ZS )RegisterNc                sH   |r|nt }d}dttj d f }d}tt| j||||dd dS )z
        OneDep webservice registration client API

        :param string apiUrl: (Optional) alternative API server URL.


        NzOneDepApiClient/%s Python/%s r   registerF)apiKey	userAgentapiNameapiUrlZverify)r   r   sysversionsplitsuperr   __init__)selfr   r   r	   r
   )	__class__ 2lib/python3.7/site-packages/onedep/api/Register.pyr   '   s
    zRegister.__init__c             C   s   i }d|i}| j d|S )zRequest an API access token be sent to the input e-mail address

        :param string email: e-mail address

        :rtype: json service response converted to dictionary (with mininal keys: api_error_flag, api_status_text)

        emailaccesstoken)r   )get)r   r   ZpDr   r   r   r   7   s    zRegister.register)N)__name__
__module____qualname__r   r   __classcell__r   r   )r   r   r   &   s   r   )__doc__Z
__future__r   Z__docformat__
__author__Z	__email__Z__license__Zloggingr   Zonedepr   r   Zonedep.utils.ApiBaser   Z	getLoggerr   logr   r   r   r   r   <module>   s   
