diff --git a/generated/python/gapic-google-cloud-datastore-v1/README.rst b/generated/python/gapic-google-cloud-datastore-v1/README.rst index c0203f2bf..b8490c160 100644 --- a/generated/python/gapic-google-cloud-datastore-v1/README.rst +++ b/generated/python/gapic-google-cloud-datastore-v1/README.rst @@ -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 --------------- diff --git a/generated/python/gapic-google-cloud-datastore-v1/docs/conf.py b/generated/python/gapic-google-cloud-datastore-v1/docs/conf.py index 952a4dc28..21ca49bff 100644 --- a/generated/python/gapic-google-cloud-datastore-v1/docs/conf.py +++ b/generated/python/gapic-google-cloud-datastore-v1/docs/conf.py @@ -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 ------------------------------------------------ @@ -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 diff --git a/generated/python/gapic-google-cloud-datastore-v1/docs/index.rst b/generated/python/gapic-google-cloud-datastore-v1/docs/index.rst index 2375aa9c9..050affc26 100644 --- a/generated/python/gapic-google-cloud-datastore-v1/docs/index.rst +++ b/generated/python/gapic-google-cloud-datastore-v1/docs/index.rst @@ -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/ diff --git a/generated/python/gapic-google-cloud-datastore-v1/google/cloud/gapic/datastore/v1/datastore_client.py b/generated/python/gapic-google-cloud-datastore-v1/google/cloud/gapic/datastore/v1/datastore_client.py index 96cc003c8..d4991f82a 100644 --- a/generated/python/gapic-google-cloud-datastore-v1/google/cloud/gapic/datastore/v1/datastore_client.py +++ b/generated/python/gapic-google-cloud-datastore-v1/google/cloud/gapic/datastore/v1/datastore_client.py @@ -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. @@ -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 @@ -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, @@ -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: @@ -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()) @@ -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, diff --git a/generated/python/gapic-google-cloud-datastore-v1/google/cloud/gapic/datastore/v1/datastore_client_config.json b/generated/python/gapic-google-cloud-datastore-v1/google/cloud/gapic/datastore/v1/datastore_client_config.json index 5fbb8871b..84ac96e10 100644 --- a/generated/python/gapic-google-cloud-datastore-v1/google/cloud/gapic/datastore/v1/datastore_client_config.json +++ b/generated/python/gapic-google-cloud-datastore-v1/google/cloud/gapic/datastore/v1/datastore_client_config.json @@ -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": { diff --git a/generated/python/gapic-google-cloud-datastore-v1/requirements.txt b/generated/python/gapic-google-cloud-datastore-v1/requirements.txt index 4b82b3721..6b84daa2c 100644 --- a/generated/python/gapic-google-cloud-datastore-v1/requirements.txt +++ b/generated/python/gapic-google-cloud-datastore-v1/requirements.txt @@ -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 \ No newline at end of file +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 +oauth2client>=2.0.0, <4.0dev diff --git a/generated/python/gapic-google-cloud-datastore-v1/setup.py b/generated/python/gapic-google-cloud-datastore-v1/setup.py index 519358396..123625941 100644 --- a/generated/python/gapic-google-cloud-datastore-v1/setup.py +++ b/generated/python/gapic-google-cloud-datastore-v1/setup.py @@ -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', '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=[