def __init__(self, project=None, credentials=None, http=None):
     self._base_connection = None
     super(Client, self).__init__(project=project,
                                  credentials=credentials,
                                  http=http)
     self._connection = Connection(self)
     self._batch_stack = _LocalStack()
示例#2
0
    def __init__(
        self,
        project=_marker,
        credentials=None,
        _http=None,
        client_info=None,
        client_options=None,
    ):
        self._base_connection = None
        if project is None:
            no_project = True
            project = "<none>"
        else:
            no_project = False
        if project is _marker:
            project = None
        super(Client, self).__init__(project=project,
                                     credentials=credentials,
                                     _http=_http)

        kw_args = {"client_info": client_info}
        if client_options:
            if type(client_options) == dict:
                client_options = google.api_core.client_options.from_dict(
                    client_options)
            if client_options.api_endpoint:
                api_endpoint = client_options.api_endpoint
                kw_args["api_endpoint"] = api_endpoint

        if no_project:
            self.project = None
        self._connection = Connection(self, **kw_args)
        self._batch_stack = _LocalStack()
示例#3
0
 def __init__(self, project=_marker, credentials=None, _http=None):
     self._base_connection = None
     if project is None:
         no_project = True
         project = '<none>'
     else:
         no_project = False
     if project is _marker:
         project = None
     super(Client, self).__init__(project=project,
                                  credentials=credentials,
                                  _http=_http)
     if no_project:
         self.project = None
     self._connection = Connection(self)
     self._batch_stack = _LocalStack()