def __init__(self, dataset_id=None, namespace=None, credentials=None, http=None): dataset_id = _determine_default_dataset_id(dataset_id) if dataset_id is None: raise EnvironmentError('Dataset ID could not be inferred.') self.dataset_id = dataset_id self.namespace = namespace self._batch_stack = _LocalStack() super(Client, self).__init__(credentials, http)
def __init__(self, project=None, namespace=None, credentials=None, http=None): project = _determine_default_project(project) if project is None: raise EnvironmentError('Project could not be inferred.') self.project = project self.namespace = namespace self._batch_stack = _LocalStack() super(Client, self).__init__(credentials, http)
def __init__(self, project=None, namespace=None, credentials=None, http=None): _ClientProjectMixin.__init__(self, project=project) self.namespace = namespace self._batch_stack = _LocalStack() super(Client, self).__init__(credentials, http)
def __init__(self, dataset_id=None, namespace=None, connection=None): dataset_id = _determine_default_dataset_id(dataset_id) if dataset_id is None: raise EnvironmentError('Dataset ID could not be inferred.') self.dataset_id = dataset_id if connection is None: connection = Connection.from_environment() self.connection = connection self._batch_stack = _LocalStack() self.namespace = namespace
from email.encoders import encode_noop from email.generator import Generator from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.parser import Parser import io import json import six from gcloud._helpers import _LocalStack from gcloud.storage import _implicit_environ from gcloud.storage.connection import Connection _BATCHES = _LocalStack() class MIMEApplicationHTTP(MIMEApplication): """MIME type for ``application/http``. Constructs payload from headers and body :type headers: dict :param headers: HTTP headers :type body: text or None :param body: HTTP payload """ def __init__(self, method, uri, headers, body): if isinstance(body, dict):
from email.generator import Generator from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.parser import Parser import httplib2 import io import json import six from gcloud._helpers import _LocalStack from gcloud.exceptions import make_exception from gcloud.storage import _implicit_environ from gcloud.storage.connection import Connection _BATCHES = _LocalStack() class MIMEApplicationHTTP(MIMEApplication): """MIME type for ``application/http``. Constructs payload from headers and body :type headers: dict :param headers: HTTP headers :type body: text or None :param body: HTTP payload """ def __init__(self, method, uri, headers, body): if isinstance(body, dict):
def __init__(self, project=None, credentials=None, http=None): self._connection = None super(Client, self).__init__(project=project, credentials=credentials, http=http) self._batch_stack = _LocalStack()