Skip to content

Commit

Permalink
chore: Bump gapic-generator-python version to 1.3.0 (#337)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 472561635

Source-Link: googleapis/googleapis@332ecf5

Source-Link: googleapis/googleapis-gen@4313d68
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDMxM2Q2ODI4ODBmZDlkNzI0NzI5MTE2NGQ0ZTlkM2Q1YmQ5ZjE3NyJ9

fix(deps): require google-api-core >= 2.9.0
fix(deps): require protobuf >= 3.20.1
  • Loading branch information
gcf-owl-bot[bot] authored Sep 7, 2022
1 parent c07dc20 commit cf42bbb
Show file tree
Hide file tree
Showing 258 changed files with 37,185 additions and 26,826 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ def __init__(
transport (Union[str, AcceleratorTypesTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
NOTE: "rest" transport functionality is currently in a
beta state (preview). We welcome your feedback via an
issue in this library's source repository.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from google.api_core import path_template
from google.api_core import gapic_v1

from google.protobuf import json_format
from requests import __version__ as requests_version
import dataclasses
import re
Expand Down Expand Up @@ -183,6 +184,10 @@ class AcceleratorTypesRestTransport(AcceleratorTypesTransport):
and call it.
It sends JSON representations of protocol buffers over HTTP/1.1
NOTE: This REST transport functionality is currently in a beta
state (preview). We welcome your feedback via an issue in this
library's source repository. Thank you!
"""

def __init__(
Expand All @@ -202,35 +207,39 @@ def __init__(
) -> None:
"""Instantiate the transport.
Args:
host (Optional[str]):
The hostname to connect to.
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
credentials_file (Optional[str]): A file with credentials that can
be loaded with :func:`google.auth.load_credentials_from_file`.
This argument is ignored if ``channel`` is provided.
scopes (Optional(Sequence[str])): A list of scopes. This argument is
ignored if ``channel`` is provided.
client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client
certificate to configure mutual TLS HTTP channel. It is ignored
if ``channel`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
The client info used to send a user-agent string along with
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you are developing
your own client library.
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
url_scheme: the protocol scheme for the API endpoint. Normally
"https", but for testing or local servers,
"http" can be specified.
NOTE: This REST transport functionality is currently in a beta
state (preview). We welcome your feedback via a GitHub issue in
this library's repository. Thank you!
Args:
host (Optional[str]):
The hostname to connect to.
credentials (Optional[google.auth.credentials.Credentials]): The
authorization credentials to attach to requests. These
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
credentials_file (Optional[str]): A file with credentials that can
be loaded with :func:`google.auth.load_credentials_from_file`.
This argument is ignored if ``channel`` is provided.
scopes (Optional(Sequence[str])): A list of scopes. This argument is
ignored if ``channel`` is provided.
client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client
certificate to configure mutual TLS HTTP channel. It is ignored
if ``channel`` is provided.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
The client info used to send a user-agent string along with
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you are developing
your own client library.
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
url_scheme: the protocol scheme for the API endpoint. Normally
"https", but for testing or local servers,
"http" can be specified.
"""
# Run the base constructor
# TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.
Expand Down Expand Up @@ -309,25 +318,20 @@ def __call__(
},
]
request, metadata = self._interceptor.pre_aggregated_list(request, metadata)
request_kwargs = compute.AggregatedListAcceleratorTypesRequest.to_dict(
request
)
transcoded_request = path_template.transcode(http_options, **request_kwargs)
pb_request = compute.AggregatedListAcceleratorTypesRequest.pb(request)
transcoded_request = path_template.transcode(http_options, pb_request)

uri = transcoded_request["uri"]
method = transcoded_request["method"]

# Jsonify the query params
query_params = json.loads(
compute.AggregatedListAcceleratorTypesRequest.to_json(
compute.AggregatedListAcceleratorTypesRequest(
transcoded_request["query_params"]
),
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=False,
)
)

query_params.update(self._get_unset_required_fields(query_params))

# Send the request
Expand All @@ -346,9 +350,10 @@ def __call__(
raise core_exceptions.from_http_response(response)

# Return the response
resp = compute.AcceleratorTypeAggregatedList.from_json(
response.content, ignore_unknown_fields=True
)
resp = compute.AcceleratorTypeAggregatedList()
pb_resp = compute.AcceleratorTypeAggregatedList.pb(resp)

json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
resp = self._interceptor.post_aggregated_list(resp)
return resp

Expand Down Expand Up @@ -408,23 +413,20 @@ def __call__(
},
]
request, metadata = self._interceptor.pre_get(request, metadata)
request_kwargs = compute.GetAcceleratorTypeRequest.to_dict(request)
transcoded_request = path_template.transcode(http_options, **request_kwargs)
pb_request = compute.GetAcceleratorTypeRequest.pb(request)
transcoded_request = path_template.transcode(http_options, pb_request)

uri = transcoded_request["uri"]
method = transcoded_request["method"]

# Jsonify the query params
query_params = json.loads(
compute.GetAcceleratorTypeRequest.to_json(
compute.GetAcceleratorTypeRequest(
transcoded_request["query_params"]
),
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=False,
)
)

query_params.update(self._get_unset_required_fields(query_params))

# Send the request
Expand All @@ -443,9 +445,10 @@ def __call__(
raise core_exceptions.from_http_response(response)

# Return the response
resp = compute.AcceleratorType.from_json(
response.content, ignore_unknown_fields=True
)
resp = compute.AcceleratorType()
pb_resp = compute.AcceleratorType.pb(resp)

json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
resp = self._interceptor.post_get(resp)
return resp

Expand Down Expand Up @@ -497,23 +500,20 @@ def __call__(
},
]
request, metadata = self._interceptor.pre_list(request, metadata)
request_kwargs = compute.ListAcceleratorTypesRequest.to_dict(request)
transcoded_request = path_template.transcode(http_options, **request_kwargs)
pb_request = compute.ListAcceleratorTypesRequest.pb(request)
transcoded_request = path_template.transcode(http_options, pb_request)

uri = transcoded_request["uri"]
method = transcoded_request["method"]

# Jsonify the query params
query_params = json.loads(
compute.ListAcceleratorTypesRequest.to_json(
compute.ListAcceleratorTypesRequest(
transcoded_request["query_params"]
),
json_format.MessageToJson(
transcoded_request["query_params"],
including_default_value_fields=False,
use_integers_for_enums=False,
)
)

query_params.update(self._get_unset_required_fields(query_params))

# Send the request
Expand All @@ -532,9 +532,10 @@ def __call__(
raise core_exceptions.from_http_response(response)

# Return the response
resp = compute.AcceleratorTypeList.from_json(
response.content, ignore_unknown_fields=True
)
resp = compute.AcceleratorTypeList()
pb_resp = compute.AcceleratorTypeList.pb(resp)

json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
resp = self._interceptor.post_list(resp)
return resp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ def __init__(
transport (Union[str, AddressesTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
NOTE: "rest" transport functionality is currently in a
beta state (preview). We welcome your feedback via an
issue in this library's source repository.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
Expand Down
Loading

0 comments on commit cf42bbb

Please sign in to comment.