Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pub/Sub: Allow kwargs to be passed to create_channel, update templates (via synth). #8399

Merged
merged 1 commit into from
Jun 18, 2019
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
1 change: 1 addition & 0 deletions pubsub/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated by synthtool. DO NOT EDIT!
[run]
branch = True

Expand Down
1 change: 1 addition & 0 deletions pubsub/.flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated by synthtool. DO NOT EDIT!
[flake8]
ignore = E203, E266, E501, W503
exclude =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def __init__(
}

@classmethod
def create_channel(cls, address="pubsub.googleapis.com:443", credentials=None):
def create_channel(
cls, address="pubsub.googleapis.com:443", credentials=None, **kwargs
):
"""Create and return a gRPC channel object.
Args:
Expand All @@ -84,12 +86,14 @@ def create_channel(cls, address="pubsub.googleapis.com:443", credentials=None):
credentials identify this application to the service. If
none are specified, the client will attempt to ascertain
the credentials from the environment.
kwargs (dict): Keyword arguments, which are passed to the
channel creation.
Returns:
grpc.Channel: A gRPC channel object.
"""
return google.api_core.grpc_helpers.create_channel(
address, credentials=credentials, scopes=cls._OAUTH_SCOPES
address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs
)

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def __init__(
}

@classmethod
def create_channel(cls, address="pubsub.googleapis.com:443", credentials=None):
def create_channel(
cls, address="pubsub.googleapis.com:443", credentials=None, **kwargs
):
"""Create and return a gRPC channel object.
Args:
Expand All @@ -84,12 +86,14 @@ def create_channel(cls, address="pubsub.googleapis.com:443", credentials=None):
credentials identify this application to the service. If
none are specified, the client will attempt to ascertain
the credentials from the environment.
kwargs (dict): Keyword arguments, which are passed to the
channel creation.
Returns:
grpc.Channel: A gRPC channel object.
"""
return google.api_core.grpc_helpers.create_channel(
address, credentials=credentials, scopes=cls._OAUTH_SCOPES
address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs
)

@property
Expand Down
1 change: 1 addition & 0 deletions pubsub/google/cloud/pubsub_v1/proto/pubsub_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions pubsub/google/cloud/pubsub_v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,39 @@
)


if sys.version_info >= (3, 5):
busunkim96 marked this conversation as resolved.
Show resolved Hide resolved
FlowControl.__doc__ = (
"The settings for controlling the rate at which messages are pulled "
"with an asynchronous subscription."
)
FlowControl.max_bytes.__doc__ = (
"The maximum total size of received - but not yet processed - messages "
"before pausing the message stream."
)
FlowControl.max_messages.__doc__ = (
"The maximum number of received - but not yet processed - messages before "
"pausing the message stream."
)
FlowControl.resume_threshold.__doc__ = (
"The relative threshold of the ``max_bytes`` and ``max_messages`` limits "
"below which to resume the message stream. Must be a positive number not "
"greater than ``1.0``."
)
FlowControl.max_requests.__doc__ = "Currently not in use."
FlowControl.max_request_batch_size.__doc__ = (
"The maximum number of requests scheduled by callbacks to process and "
"dispatch at a time."
)
FlowControl.max_request_batch_latency.__doc__ = (
"The maximum amount of time in seconds to wait for additional request "
"items before processing the next batch of requests."
)
FlowControl.max_lease_duration.__doc__ = (
"The maximum amount of time in seconds to hold a lease on a message "
"before dropping it from the lease management."
)


_shared_modules = [
http_pb2,
iam_policy_pb2,
Expand Down
2 changes: 2 additions & 0 deletions pubsub/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Generated by synthtool. DO NOT EDIT!

from __future__ import absolute_import
import os
import shutil
Expand Down
1 change: 1 addition & 0 deletions pubsub/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Generated by synthtool. DO NOT EDIT!
[bdist_wheel]
universal = 1
10 changes: 5 additions & 5 deletions pubsub/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-06-12T13:55:40.520528Z",
"updateTime": "2019-06-18T12:24:16.486264Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.24.1",
"dockerImage": "googleapis/artman@sha256:6018498e15310260dc9b03c9d576608908ed9fbabe42e1494ff3d827fea27b19"
"version": "0.27.0",
"dockerImage": "googleapis/artman@sha256:b036a7f4278d9deb5796f065e5c7f608d47d75369985ca7ab5039998120e972d"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "f117dac435e96ebe58d85280a3faf2350c4d4219",
"internalRef": "252714985"
"sha": "384aa843867c4d17756d14a01f047b6368494d32",
"internalRef": "253675319"
}
},
{
Expand Down