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

Commit

Permalink
chore: update gapic-generator-python to 0.50.5
Browse files Browse the repository at this point in the history
https://github.com/googleapis/gapic-generator-python/blob/master/CHANGELOG.md#0505-2021-07-22

Needed to fix failing generated unit tests in #91

Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Source-Date: Thu Aug 5 16:21:09 2021 -0600
Source-Repo: googleapis/googleapis-discovery
Source-Sha: ac663f7f0afb13e3a8cfd04160d1677655c5c613
Source-Link: googleapis/googleapis-discovery@ac663f7
  • Loading branch information
yoshi-automation committed Aug 5, 2021
1 parent b348c2d commit 757f4ce
Show file tree
Hide file tree
Showing 157 changed files with 4,218 additions and 6,534 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -86,7 +87,10 @@ def __init__(
# TODO: When custom host (api_endpoint) is set, `scopes` must *also* be set on the
# credentials object
super().__init__(
host=host, credentials=credentials, client_info=client_info,
host=host,
credentials=credentials,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
)
self._session = AuthorizedSession(
self._credentials, default_host=self.DEFAULT_HOST
Expand Down Expand Up @@ -142,16 +146,10 @@ def aggregated_list(
):
query_params["returnPartialSuccess"] = request.return_partial_success

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.get(url, headers=headers,)
response = self._session.get(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -206,16 +204,10 @@ def get(
# not required for GCE
query_params = {}

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.get(url, headers=headers,)
response = self._session.get(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -269,16 +261,10 @@ def list(
if compute.ListAcceleratorTypesRequest.return_partial_success in request:
query_params["returnPartialSuccess"] = request.return_partial_success

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.get(url, headers=headers,)
response = self._session.get(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down
48 changes: 12 additions & 36 deletions google/cloud/compute_v1/services/addresses/transports/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -85,7 +86,10 @@ def __init__(
# TODO: When custom host (api_endpoint) is set, `scopes` must *also* be set on the
# credentials object
super().__init__(
host=host, credentials=credentials, client_info=client_info,
host=host,
credentials=credentials,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
)
self._session = AuthorizedSession(
self._credentials, default_host=self.DEFAULT_HOST
Expand Down Expand Up @@ -138,16 +142,10 @@ def aggregated_list(
if compute.AggregatedListAddressesRequest.return_partial_success in request:
query_params["returnPartialSuccess"] = request.return_partial_success

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.get(url, headers=headers,)
response = self._session.get(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -224,16 +222,10 @@ def delete(
if compute.DeleteAddressRequest.request_id in request:
query_params["requestId"] = request.request_id

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.delete(url, headers=headers,)
response = self._session.delete(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -305,16 +297,10 @@ def get(
# not required for GCE
query_params = {}

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.get(url, headers=headers,)
response = self._session.get(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -393,16 +379,12 @@ def insert(
if compute.InsertAddressRequest.request_id in request:
query_params["requestId"] = request.request_id

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.post(url, headers=headers, data=body,)
response = self._session.post(
url, headers=headers, params=query_params, data=body,
)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -453,16 +435,10 @@ def list(
if compute.ListAddressesRequest.return_partial_success in request:
query_params["returnPartialSuccess"] = request.return_partial_success

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.get(url, headers=headers,)
response = self._session.get(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down
68 changes: 18 additions & 50 deletions google/cloud/compute_v1/services/autoscalers/transports/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -85,7 +86,10 @@ def __init__(
# TODO: When custom host (api_endpoint) is set, `scopes` must *also* be set on the
# credentials object
super().__init__(
host=host, credentials=credentials, client_info=client_info,
host=host,
credentials=credentials,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
)
self._session = AuthorizedSession(
self._credentials, default_host=self.DEFAULT_HOST
Expand Down Expand Up @@ -138,16 +142,10 @@ def aggregated_list(
if compute.AggregatedListAutoscalersRequest.return_partial_success in request:
query_params["returnPartialSuccess"] = request.return_partial_success

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.get(url, headers=headers,)
response = self._session.get(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -224,16 +222,10 @@ def delete(
if compute.DeleteAutoscalerRequest.request_id in request:
query_params["requestId"] = request.request_id

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.delete(url, headers=headers,)
response = self._session.delete(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -298,16 +290,10 @@ def get(
# not required for GCE
query_params = {}

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.get(url, headers=headers,)
response = self._session.get(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -388,16 +374,12 @@ def insert(
if compute.InsertAutoscalerRequest.request_id in request:
query_params["requestId"] = request.request_id

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.post(url, headers=headers, data=body,)
response = self._session.post(
url, headers=headers, params=query_params, data=body,
)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -451,16 +433,10 @@ def list(
if compute.ListAutoscalersRequest.return_partial_success in request:
query_params["returnPartialSuccess"] = request.return_partial_success

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.get(url, headers=headers,)
response = self._session.get(url, headers=headers, params=query_params,)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -543,16 +519,12 @@ def patch(
if compute.PatchAutoscalerRequest.request_id in request:
query_params["requestId"] = request.request_id

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.patch(url, headers=headers, data=body,)
response = self._session.patch(
url, headers=headers, params=query_params, data=body,
)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down Expand Up @@ -633,16 +605,12 @@ def update(
if compute.UpdateAutoscalerRequest.request_id in request:
query_params["requestId"] = request.request_id

# TODO(yon-mg): further discussion needed whether 'python truthiness' is appropriate here
# discards default values
# TODO(yon-mg): add test for proper url encoded strings
query_params = ["{k}={v}".format(k=k, v=v) for k, v in query_params.items()]
url += "?{}".format("&".join(query_params)).replace(" ", "+")

# Send the request
headers = dict(metadata)
headers["Content-Type"] = "application/json"
response = self._session.put(url, headers=headers, data=body,)
response = self._session.put(
url, headers=headers, params=query_params, data=body,
)

# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
# subclass.
Expand Down

0 comments on commit 757f4ce

Please sign in to comment.