Skip to content

Commit 3204cea

Browse files
committed
chore(generator): update storagebatchoperations client.py and async_client.py to use setup_request_id
1 parent 0b2ceb2 commit 3204cea

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

  • packages/gapic-generator/tests/integration/goldens/storagebatchoperations/google/cloud/storagebatchoperations_v1/services/storage_batch_operations

packages/gapic-generator/tests/integration/goldens/storagebatchoperations/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/async_client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
from collections import OrderedDict
1818
import re
1919
from typing import Dict, Callable, Mapping, MutableMapping, MutableSequence, Optional, Sequence, Tuple, Type, Union
20-
import uuid
21-
2220
from google.cloud.storagebatchoperations_v1 import gapic_version as package_version
2321

2422
from google.api_core.client_options import ClientOptions
@@ -621,7 +619,7 @@ async def sample_create_job():
621619
)),
622620
)
623621

624-
self._client._setup_request_id(request, 'request_id', False)
622+
setup_request_id(request, 'request_id', False)
625623

626624
# Validate the universe domain.
627625
self._client._validate_universe_domain()
@@ -727,7 +725,7 @@ async def sample_delete_job():
727725
)),
728726
)
729727

730-
self._client._setup_request_id(request, 'request_id', False)
728+
setup_request_id(request, 'request_id', False)
731729

732730
# Validate the universe domain.
733731
self._client._validate_universe_domain()
@@ -829,7 +827,7 @@ async def sample_cancel_job():
829827
)),
830828
)
831829

832-
self._client._setup_request_id(request, 'request_id', False)
830+
setup_request_id(request, 'request_id', False)
833831

834832
# Validate the universe domain.
835833
self._client._validate_universe_domain()

packages/gapic-generator/tests/integration/goldens/storagebatchoperations/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/client.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,6 @@ def _validate_universe_domain(self):
472472
# NOTE (b/349488459): universe validation is disabled until further notice.
473473
return True
474474

475-
@staticmethod
476-
def _setup_request_id(request, field_name: str, is_proto3_optional: bool):
477-
"""Populate a UUID4 field in the request if it is not already set.
478-
479475
Args:
480476
request (Union[google.protobuf.message.Message, dict]): The request object.
481477
field_name (str): The name of the field to populate.
@@ -1017,7 +1013,7 @@ def sample_create_job():
10171013
)),
10181014
)
10191015
1020-
self._setup_request_id(request, 'request_id', False)
1016+
setup_request_id(request, 'request_id', False)
10211017
10221018
# Validate the universe domain.
10231019
self._validate_universe_domain()
@@ -1122,7 +1118,7 @@ def sample_delete_job():
11221118
)),
11231119
)
11241120
1125-
self._setup_request_id(request, 'request_id', False)
1121+
setup_request_id(request, 'request_id', False)
11261122
11271123
# Validate the universe domain.
11281124
self._validate_universe_domain()
@@ -1223,7 +1219,7 @@ def sample_cancel_job():
12231219
)),
12241220
)
12251221
1226-
self._setup_request_id(request, 'request_id', False)
1222+
setup_request_id(request, 'request_id', False)
12271223
12281224
# Validate the universe domain.
12291225
self._validate_universe_domain()

0 commit comments

Comments
 (0)