Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Datastore 0.15.1 #183

Merged
merged 2 commits into from
Feb 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ easy-to-use client library for the `Google Cloud Datastore API`_ (v1) defined in

.. _`googleapis`: https://github.com/googleapis/googleapis/tree/master/google/datastore/v1
.. _`google-gax`: https://github.com/googleapis/gax-python
.. _`Google Cloud Datastore API API`: https://developers.google.com/apis-explorer/?hl=en_US#p/datastore/v1
.. _`Google Cloud Datastore API`: https://developers.google.com/apis-explorer/?hl=en_US#p/datastore/v1

Getting started
---------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))

__version__ = '0.15.0'
__version__ = '0.15.1'

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -60,7 +60,7 @@

# General information about the project.
project = u'gapic-google-cloud-datastore-v1'
copyright = u'2016, Google'
copyright = u'2017, Google'
author = u'Google APIs'

# The version info for the project you're documenting, acts as replacement for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ easy-to-use client library for the `Google Cloud Datastore API`_ (v1) defined in


.. _`google-gax`: https://github.com/googleapis/gax-python
.. _`googleapis`: https://github.com/googleapis/googleapis/tree/master/google/google/datastore/v1
.. _`googleapis`: https://github.com/googleapis/googleapis/tree/master/google/datastore/v1
.. _`Google Cloud Datastore API`: https://developers.google.com/apis-explorer/?hl=en_US#p/datastore/v1/


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016, Google Inc. All rights reserved.
# Copyright 2017, Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,7 @@
# merge preserves those additions if the generated source changes.
"""Accesses the google.datastore.v1 Datastore API."""

import collections
import json
import os
import pkg_resources
Expand Down Expand Up @@ -54,15 +55,10 @@ class DatastoreClient(object):
DEFAULT_SERVICE_PORT = 443
"""The default port of the service."""

_CODE_GEN_NAME_VERSION = 'gapic/0.1.0'

_GAX_VERSION = pkg_resources.get_distribution('google-gax').version

# The scopes needed to make gRPC calls to all of the methods defined in
# this service
_ALL_SCOPES = (
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/datastore', )
_ALL_SCOPES = ('https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/datastore', )

def __init__(self,
service_path=SERVICE_ADDRESS,
Expand All @@ -72,8 +68,11 @@ def __init__(self,
ssl_credentials=None,
scopes=None,
client_config=None,
app_name='gax',
app_version=_GAX_VERSION):
app_name=None,
app_version='',
lib_name=None,
lib_version='',
metrics_headers=()):
"""Constructor.

Args:
Expand All @@ -93,20 +92,49 @@ def __init__(self,
:func:`google.gax.construct_settings` for the structure of
this data. Falls back to the default config if not specified
or the specified config is missing data points.
app_name (string): The codename of the calling service.
app_version (string): The version of the calling service.
app_name (string): The name of the application calling
the service. Recommended for analytics purposes.
app_version (string): The version of the application calling
the service. Recommended for analytics purposes.
lib_name (string): The API library software used for calling
the service. (Unless you are writing an API client itself,
leave this as default.)
lib_version (string): The API library software version used
for calling the service. (Unless you are writing an API client
itself, leave this as default.)
metrics_headers (dict): A dictionary of values for tracking
client library metrics. Ultimately serializes to a string
(e.g. 'foo/1.2.3 bar/3.14.1'). This argument should be
considered private.

Returns:
A DatastoreClient object.
"""
# Unless the calling application specifically requested
# OAuth scopes, request everything.
if scopes is None:
scopes = self._ALL_SCOPES

# Initialize an empty client config, if none is set.
if client_config is None:
client_config = {}
goog_api_client = '{}/{} {} gax/{} python/{}'.format(
app_name, app_version, self._CODE_GEN_NAME_VERSION,
self._GAX_VERSION, platform.python_version())
metadata = [('x-goog-api-client', goog_api_client)]

# Initialize metrics_headers as an ordered dictionary
# (cuts down on cardinality of the resulting string slightly).
metrics_headers = collections.OrderedDict(metrics_headers)
metrics_headers['gl-python'] = platform.python_version()

# The library may or may not be set, depending on what is
# calling this client. Newer client libraries set the library name
# and version.
if lib_name:
metrics_headers[lib_name] = lib_version

# Finally, track the GAPIC package version.
metrics_headers['gapic'] = pkg_resources.get_distribution(
'gapic-google-cloud-datastore-v1', ).version

# Load the configuration defaults.
default_client_config = json.loads(
pkg_resources.resource_string(
__name__, 'datastore_client_config.json').decode())
Expand All @@ -115,7 +143,7 @@ def __init__(self,
default_client_config,
client_config,
config.STATUS_CODE_NAMES,
kwargs={'metadata': metadata})
metrics_headers=metrics_headers, )
self.datastore_stub = config.create_stub(
datastore_pb2.DatastoreStub,
channel=channel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
"interfaces": {
"google.datastore.v1.Datastore": {
"retry_codes": {
"retry_codes_def": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
}
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
googleapis-common-protos>=1.5.0, <2.0dev
google-gax>=0.15.4, <0.16dev
proto-google-cloud-datastore-v1>=0.90.0, <0.91dev
oauth2client>=2.0.0, <4.0dev
googleapis-common-protos>=1.5.2, <2.0dev
google-gax>=0.15.6, <0.16dev
proto-google-cloud-datastore-v1>=0.90.1, <0.91dev

This comment was marked as spam.

This comment was marked as spam.

oauth2client>=2.0.0, <4.0dev
8 changes: 4 additions & 4 deletions generated/python/gapic-google-cloud-datastore-v1/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
import sys

install_requires = [
'googleapis-common-protos>=1.5.0, <2.0dev',
'google-gax>=0.15.4, <0.16dev',
'proto-google-cloud-datastore-v1[grpc]>=0.90.0, <0.91dev',
'googleapis-common-protos>=1.5.2, <2.0dev',
'google-gax>=0.15.6, <0.16dev',
'proto-google-cloud-datastore-v1>=0.90.1, <0.91dev',

This comment was marked as spam.

'oauth2client>=2.0.0, <4.0dev',
]

setup(
name='gapic-google-cloud-datastore-v1',
version='0.15.0',
version='0.15.1',
author='Google Inc',
author_email='googleapis-packages@google.com',
classifiers=[
Expand Down