Content-Length: 1752411 | pFad | https://github.com/googleapis/python-compute/commit/b3047e110ec6f1198af0429e3ef3b41796d47a5b

F2 chore: Bump gapic-generator-python version to 1.3.0 (#337) · googleapis/python-compute@b3047e1 · GitHub
Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit b3047e1

Browse files
chore: Bump gapic-generator-python version to 1.3.0 (#337)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 472561635 Source-Link: googleapis/googleapis@332ecf5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4313d682880fd9d7247291164d4e9d3d5bd9f177 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDMxM2Q2ODI4ODBmZDlkNzI0NzI5MTE2NGQ0ZTlkM2Q1YmQ5ZjE3NyJ9 fix(deps): require google-api-core >= 2.9.0 fix(deps): require protobuf >= 3.20.1
1 parent c3648fb commit b3047e1

File tree

258 files changed

+37185
-26826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+37185
-26826
lines changed

google/cloud/compute_v1/services/accelerator_types/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ def __init__(
325325
transport (Union[str, AcceleratorTypesTransport]): The
326326
transport to use. If set to None, a transport is chosen
327327
automatically.
328+
NOTE: "rest" transport functionality is currently in a
329+
beta state (preview). We welcome your feedback via an
330+
issue in this library's source repository.
328331
client_options (google.api_core.client_options.ClientOptions): Custom options for the
329332
client. It won't take effect if a ``transport`` instance is provided.
330333
(1) The ``api_endpoint`` property can be used to override the

google/cloud/compute_v1/services/accelerator_types/transports/rest.py

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from google.api_core import path_template
2727
from google.api_core import gapic_v1
2828

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

188193
def __init__(
@@ -202,35 +207,39 @@ def __init__(
202207
) -> None:
203208
"""Instantiate the transport.
204209
205-
Args:
206-
host (Optional[str]):
207-
The hostname to connect to.
208-
credentials (Optional[google.auth.credentials.Credentials]): The
209-
authorization credentials to attach to requests. These
210-
credentials identify the application to the service; if none
211-
are specified, the client will attempt to ascertain the
212-
credentials from the environment.
213-
214-
credentials_file (Optional[str]): A file with credentials that can
215-
be loaded with :func:`google.auth.load_credentials_from_file`.
216-
This argument is ignored if ``channel`` is provided.
217-
scopes (Optional(Sequence[str])): A list of scopes. This argument is
218-
ignored if ``channel`` is provided.
219-
client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client
220-
certificate to configure mutual TLS HTTP channel. It is ignored
221-
if ``channel`` is provided.
222-
quota_project_id (Optional[str]): An optional project to use for billing
223-
and quota.
224-
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
225-
The client info used to send a user-agent string along with
226-
API requests. If ``None``, then default info will be used.
227-
Generally, you only need to set this if you are developing
228-
your own client library.
229-
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
230-
be used for service account credentials.
231-
url_scheme: the protocol scheme for the API endpoint. Normally
232-
"https", but for testing or local servers,
233-
"http" can be specified.
210+
NOTE: This REST transport functionality is currently in a beta
211+
state (preview). We welcome your feedback via a GitHub issue in
212+
this library's repository. Thank you!
213+
214+
Args:
215+
host (Optional[str]):
216+
The hostname to connect to.
217+
credentials (Optional[google.auth.credentials.Credentials]): The
218+
authorization credentials to attach to requests. These
219+
credentials identify the application to the service; if none
220+
are specified, the client will attempt to ascertain the
221+
credentials from the environment.
222+
223+
credentials_file (Optional[str]): A file with credentials that can
224+
be loaded with :func:`google.auth.load_credentials_from_file`.
225+
This argument is ignored if ``channel`` is provided.
226+
scopes (Optional(Sequence[str])): A list of scopes. This argument is
227+
ignored if ``channel`` is provided.
228+
client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client
229+
certificate to configure mutual TLS HTTP channel. It is ignored
230+
if ``channel`` is provided.
231+
quota_project_id (Optional[str]): An optional project to use for billing
232+
and quota.
233+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
234+
The client info used to send a user-agent string along with
235+
API requests. If ``None``, then default info will be used.
236+
Generally, you only need to set this if you are developing
237+
your own client library.
238+
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
239+
be used for service account credentials.
240+
url_scheme: the protocol scheme for the API endpoint. Normally
241+
"https", but for testing or local servers,
242+
"http" can be specified.
234243
"""
235244
# Run the base constructor
236245
# TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.
@@ -309,25 +318,20 @@ def __call__(
309318
},
310319
]
311320
request, metadata = self._interceptor.pre_aggregated_list(request, metadata)
312-
request_kwargs = compute.AggregatedListAcceleratorTypesRequest.to_dict(
313-
request
314-
)
315-
transcoded_request = path_template.transcode(http_options, **request_kwargs)
321+
pb_request = compute.AggregatedListAcceleratorTypesRequest.pb(request)
322+
transcoded_request = path_template.transcode(http_options, pb_request)
316323

317324
uri = transcoded_request["uri"]
318325
method = transcoded_request["method"]
319326

320327
# Jsonify the query params
321328
query_params = json.loads(
322-
compute.AggregatedListAcceleratorTypesRequest.to_json(
323-
compute.AggregatedListAcceleratorTypesRequest(
324-
transcoded_request["query_params"]
325-
),
329+
json_format.MessageToJson(
330+
transcoded_request["query_params"],
326331
including_default_value_fields=False,
327332
use_integers_for_enums=False,
328333
)
329334
)
330-
331335
query_params.update(self._get_unset_required_fields(query_params))
332336

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

348352
# Return the response
349-
resp = compute.AcceleratorTypeAggregatedList.from_json(
350-
response.content, ignore_unknown_fields=True
351-
)
353+
resp = compute.AcceleratorTypeAggregatedList()
354+
pb_resp = compute.AcceleratorTypeAggregatedList.pb(resp)
355+
356+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
352357
resp = self._interceptor.post_aggregated_list(resp)
353358
return resp
354359

@@ -408,23 +413,20 @@ def __call__(
408413
},
409414
]
410415
request, metadata = self._interceptor.pre_get(request, metadata)
411-
request_kwargs = compute.GetAcceleratorTypeRequest.to_dict(request)
412-
transcoded_request = path_template.transcode(http_options, **request_kwargs)
416+
pb_request = compute.GetAcceleratorTypeRequest.pb(request)
417+
transcoded_request = path_template.transcode(http_options, pb_request)
413418

414419
uri = transcoded_request["uri"]
415420
method = transcoded_request["method"]
416421

417422
# Jsonify the query params
418423
query_params = json.loads(
419-
compute.GetAcceleratorTypeRequest.to_json(
420-
compute.GetAcceleratorTypeRequest(
421-
transcoded_request["query_params"]
422-
),
424+
json_format.MessageToJson(
425+
transcoded_request["query_params"],
423426
including_default_value_fields=False,
424427
use_integers_for_enums=False,
425428
)
426429
)
427-
428430
query_params.update(self._get_unset_required_fields(query_params))
429431

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

445447
# Return the response
446-
resp = compute.AcceleratorType.from_json(
447-
response.content, ignore_unknown_fields=True
448-
)
448+
resp = compute.AcceleratorType()
449+
pb_resp = compute.AcceleratorType.pb(resp)
450+
451+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
449452
resp = self._interceptor.post_get(resp)
450453
return resp
451454

@@ -497,23 +500,20 @@ def __call__(
497500
},
498501
]
499502
request, metadata = self._interceptor.pre_list(request, metadata)
500-
request_kwargs = compute.ListAcceleratorTypesRequest.to_dict(request)
501-
transcoded_request = path_template.transcode(http_options, **request_kwargs)
503+
pb_request = compute.ListAcceleratorTypesRequest.pb(request)
504+
transcoded_request = path_template.transcode(http_options, pb_request)
502505

503506
uri = transcoded_request["uri"]
504507
method = transcoded_request["method"]
505508

506509
# Jsonify the query params
507510
query_params = json.loads(
508-
compute.ListAcceleratorTypesRequest.to_json(
509-
compute.ListAcceleratorTypesRequest(
510-
transcoded_request["query_params"]
511-
),
511+
json_format.MessageToJson(
512+
transcoded_request["query_params"],
512513
including_default_value_fields=False,
513514
use_integers_for_enums=False,
514515
)
515516
)
516-
517517
query_params.update(self._get_unset_required_fields(query_params))
518518

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

534534
# Return the response
535-
resp = compute.AcceleratorTypeList.from_json(
536-
response.content, ignore_unknown_fields=True
537-
)
535+
resp = compute.AcceleratorTypeList()
536+
pb_resp = compute.AcceleratorTypeList.pb(resp)
537+
538+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
538539
resp = self._interceptor.post_list(resp)
539540
return resp
540541

google/cloud/compute_v1/services/addresses/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ def __init__(
324324
transport (Union[str, AddressesTransport]): The
325325
transport to use. If set to None, a transport is chosen
326326
automatically.
327+
NOTE: "rest" transport functionality is currently in a
328+
beta state (preview). We welcome your feedback via an
329+
issue in this library's source repository.
327330
client_options (google.api_core.client_options.ClientOptions): Custom options for the
328331
client. It won't take effect if a ``transport`` instance is provided.
329332
(1) The ``api_endpoint`` property can be used to override the

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/python-compute/commit/b3047e110ec6f1198af0429e3ef3b41796d47a5b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy