'Initialize a RequestManager object.
Args:
app_id: String containing the application id for requests.
host_port: String containing the "host:port" pair; the port is optional.
url_path: partial URL (path) to post entity data to.
kind: Kind of the Entity records being posted.
throttle: A Throttle instance.
batch_size: The number of entities to transfer per request.
secure: Use SSL when communicating with server.
server: An existing AbstractRpcServer to reuse.
throttle_class: A class to use instead of the default
ThrottledHttpRpcServer.'

def __init__(self, app_id, host_port, url_path, kind, throttle, batch_size, secure, dry_run=False, server=None, throttle_class=None, oauth2_parameters=None):

    self.app_id = app_id
    self.host_port = host_port
    self.host = host_port.split(':')[0]
    if (url_path and (url_path[0] != '/')):
        url_path = ('/' + url_path)
    self.url_path = url_path
    self.kind = kind
    self.throttle = throttle
    self.batch_size = batch_size
    self.secure = secure
    self.authenticated = False
    self.auth_called = False
    self.parallel_download = True
    self.mapper = None
    self.dry_run = dry_run
    if self.dry_run:
        logger.info('Running    in    dry    run    mode,    skipping    remote_api    setup')
        return
    logger.debug(('Configuring    remote_api.    url_path    =    %s,    servername    =    %s' % (url_path, host_port)))
    throttled_rpc_server_factory = remote_api_throttle.ThrottledHttpRpcServerFactory(self.throttle, throttle_class=throttle_class)
    if server:
        remote_api_stub.ConfigureRemoteApiFromServer(server, url_path, app_id)
    else:
        remote_api_stub.ConfigureRemoteApiForOAuth(servername=host_port, path=url_path, secure=self.secure, oauth2_parameters=oauth2_parameters, save_cookies=True, auth_tries=3, rpc_server_factory=throttled_rpc_server_factory)
    remote_api_throttle.ThrottleRemoteDatastore(self.throttle)
    logger.debug('Bulkloader    using    app_id:    %s', os.environ['APPLICATION_ID'])
