Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit efb7a7d

Browse files
committed
forma nox session with ruff
1 parent 508d53d commit efb7a7d

File tree

13 files changed

+791
-587
lines changed

13 files changed

+791
-587
lines changed

tests/integration/goldens/asset/google/cloud/asset_v1/__init__.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,89 @@
111111
VersionedResource,
112112
)
113113

114+
from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient
115+
from .types.asset_service import (
116+
AnalyzeIamPolicyLongrunningMetadata,
117+
AnalyzeIamPolicyLongrunningRequest,
118+
AnalyzeIamPolicyLongrunningResponse,
119+
AnalyzeIamPolicyRequest,
120+
AnalyzeIamPolicyResponse,
121+
AnalyzeMoveRequest,
122+
AnalyzeMoveResponse,
123+
AnalyzeOrgPoliciesRequest,
124+
AnalyzeOrgPoliciesResponse,
125+
AnalyzeOrgPolicyGovernedAssetsRequest,
126+
AnalyzeOrgPolicyGovernedAssetsResponse,
127+
AnalyzeOrgPolicyGovernedContainersRequest,
128+
AnalyzeOrgPolicyGovernedContainersResponse,
129+
AnalyzerOrgPolicy,
130+
AnalyzerOrgPolicyConstraint,
131+
BatchGetAssetsHistoryRequest,
132+
BatchGetAssetsHistoryResponse,
133+
BatchGetEffectiveIamPoliciesRequest,
134+
BatchGetEffectiveIamPoliciesResponse,
135+
BigQueryDestination,
136+
ContentType,
137+
CreateFeedRequest,
138+
CreateSavedQueryRequest,
139+
DeleteFeedRequest,
140+
DeleteSavedQueryRequest,
141+
ExportAssetsRequest,
142+
ExportAssetsResponse,
143+
Feed,
144+
FeedOutputConfig,
145+
GcsDestination,
146+
GcsOutputResult,
147+
GetFeedRequest,
148+
GetSavedQueryRequest,
149+
IamPolicyAnalysisOutputConfig,
150+
IamPolicyAnalysisQuery,
151+
ListAssetsRequest,
152+
ListAssetsResponse,
153+
ListFeedsRequest,
154+
ListFeedsResponse,
155+
ListSavedQueriesRequest,
156+
ListSavedQueriesResponse,
157+
MoveAnalysis,
158+
MoveAnalysisResult,
159+
MoveImpact,
160+
OutputConfig,
161+
OutputResult,
162+
PartitionSpec,
163+
PubsubDestination,
164+
QueryAssetsOutputConfig,
165+
QueryAssetsRequest,
166+
QueryAssetsResponse,
167+
QueryResult,
168+
SavedQuery,
169+
SearchAllIamPoliciesRequest,
170+
SearchAllIamPoliciesResponse,
171+
SearchAllResourcesRequest,
172+
SearchAllResourcesResponse,
173+
TableFieldSchema,
174+
TableSchema,
175+
UpdateFeedRequest,
176+
UpdateSavedQueryRequest,
177+
)
178+
from .types.assets import (
179+
Asset,
180+
AttachedResource,
181+
ConditionEvaluation,
182+
IamPolicyAnalysisResult,
183+
IamPolicyAnalysisState,
184+
IamPolicySearchResult,
185+
RelatedAsset,
186+
RelatedAssets,
187+
RelatedResource,
188+
RelatedResources,
189+
RelationshipAttributes,
190+
Resource,
191+
ResourceSearchResult,
192+
TemporalAsset,
193+
TimeWindow,
194+
VersionedResource,
195+
)
196+
114197
if hasattr(api_core, "check_python_version") and hasattr(
115198
api_core, "check_dependency_versions"
116199
): # pragma: NO COVER

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from collections import OrderedDict
1716
import logging as std_logging
1817
import re
18+
from collections import OrderedDict
1919
from typing import (
2020
Callable,
2121
Dict,
@@ -29,13 +29,13 @@
2929
Union,
3030
)
3131

32+
import google.protobuf
3233
from google.api_core import exceptions as core_exceptions
3334
from google.api_core import gapic_v1
3435
from google.api_core import retry_async as retries
3536
from google.api_core.client_options import ClientOptions
3637
from google.auth import credentials as ga_credentials # type: ignore
3738
from google.oauth2 import service_account # type: ignore
38-
import google.protobuf
3939

4040
from google.cloud.asset_v1 import gapic_version as package_version
4141

@@ -44,11 +44,15 @@
4444
except AttributeError: # pragma: NO COVER
4545
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
4646

47-
from google.api_core import operation # type: ignore
48-
from google.api_core import operation_async # type: ignore
47+
from google.api_core import (
48+
operation, # type: ignore
49+
operation_async, # type: ignore
50+
)
4951
from google.longrunning import operations_pb2 # type: ignore
50-
from google.protobuf import field_mask_pb2 # type: ignore
51-
from google.protobuf import timestamp_pb2 # type: ignore
52+
from google.protobuf import (
53+
field_mask_pb2, # type: ignore
54+
timestamp_pb2, # type: ignore
55+
)
5256
from google.rpc import status_pb2 # type: ignore
5357
from google.type import expr_pb2 # type: ignore
5458

@@ -131,7 +135,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
131135
Returns:
132136
AssetServiceAsyncClient: The constructed client.
133137
"""
134-
return AssetServiceClient.from_service_account_info.__func__(AssetServiceAsyncClient, info, *args, **kwargs) # type: ignore
138+
return AssetServiceClient.from_service_account_info.__func__(
139+
AssetServiceAsyncClient, info, *args, **kwargs
140+
) # type: ignore
135141

136142
@classmethod
137143
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -147,7 +153,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
147153
Returns:
148154
AssetServiceAsyncClient: The constructed client.
149155
"""
150-
return AssetServiceClient.from_service_account_file.__func__(AssetServiceAsyncClient, filename, *args, **kwargs) # type: ignore
156+
return AssetServiceClient.from_service_account_file.__func__(
157+
AssetServiceAsyncClient, filename, *args, **kwargs
158+
) # type: ignore
151159

152160
from_service_account_json = from_service_account_file
153161

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/client.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from collections import OrderedDict
17-
from http import HTTPStatus
1816
import json
1917
import logging as std_logging
2018
import os
2119
import re
20+
import warnings
21+
from collections import OrderedDict
22+
from http import HTTPStatus
2223
from typing import (
2324
Callable,
2425
Dict,
@@ -32,8 +33,8 @@
3233
Union,
3334
cast,
3435
)
35-
import warnings
3636

37+
import google.protobuf
3738
from google.api_core import client_options as client_options_lib
3839
from google.api_core import exceptions as core_exceptions
3940
from google.api_core import gapic_v1
@@ -43,7 +44,8 @@
4344
from google.auth.transport import mtls # type: ignore
4445
from google.auth.transport.grpc import SslCredentials # type: ignore
4546
from google.oauth2 import service_account # type: ignore
46-
import google.protobuf
47+
48+
from google.cloud.asset_v1 import gapic_version as package_version
4749

4850
from google.cloud.asset_v1 import gapic_version as package_version
4951

@@ -61,11 +63,15 @@
6163

6264
_LOGGER = std_logging.getLogger(__name__)
6365

64-
from google.api_core import operation # type: ignore
65-
from google.api_core import operation_async # type: ignore
66+
from google.api_core import (
67+
operation, # type: ignore
68+
operation_async, # type: ignore
69+
)
6670
from google.longrunning import operations_pb2 # type: ignore
67-
from google.protobuf import field_mask_pb2 # type: ignore
68-
from google.protobuf import timestamp_pb2 # type: ignore
71+
from google.protobuf import (
72+
field_mask_pb2, # type: ignore
73+
timestamp_pb2, # type: ignore
74+
)
6975
from google.rpc import status_pb2 # type: ignore
7076
from google.type import expr_pb2 # type: ignore
7177

@@ -731,11 +737,9 @@ def __init__(
731737

732738
universe_domain_opt = getattr(self._client_options, "universe_domain", None)
733739

734-
(
735-
self._use_client_cert,
736-
self._use_mtls_endpoint,
737-
self._universe_domain_env,
738-
) = AssetServiceClient._read_environment_variables()
740+
self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env = (
741+
AssetServiceClient._read_environment_variables()
742+
)
739743
self._client_cert_source = AssetServiceClient._get_client_cert_source(
740744
self._client_options.client_cert_source, self._use_client_cert
741745
)
@@ -770,8 +774,7 @@ def __init__(
770774
)
771775
if self._client_options.scopes:
772776
raise ValueError(
773-
"When providing a transport instance, provide its scopes "
774-
"directly."
777+
"When providing a transport instance, provide its scopes directly."
775778
)
776779
self._transport = cast(AssetServiceTransport, transport)
777780
self._api_endpoint = self._transport.host

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/pagers.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(
6767
*,
6868
retry: OptionalRetry = gapic_v1.method.DEFAULT,
6969
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
70-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
70+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
7171
):
7272
"""Instantiate the pager.
7373
@@ -143,7 +143,7 @@ def __init__(
143143
*,
144144
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
145145
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
146-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
146+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
147147
):
148148
"""Instantiates the pager.
149149
@@ -223,7 +223,7 @@ def __init__(
223223
*,
224224
retry: OptionalRetry = gapic_v1.method.DEFAULT,
225225
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
226-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
226+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
227227
):
228228
"""Instantiate the pager.
229229
@@ -299,7 +299,7 @@ def __init__(
299299
*,
300300
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
301301
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
302-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
302+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
303303
):
304304
"""Instantiates the pager.
305305
@@ -379,7 +379,7 @@ def __init__(
379379
*,
380380
retry: OptionalRetry = gapic_v1.method.DEFAULT,
381381
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
382-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
382+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
383383
):
384384
"""Instantiate the pager.
385385
@@ -455,7 +455,7 @@ def __init__(
455455
*,
456456
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
457457
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
458-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
458+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
459459
):
460460
"""Instantiates the pager.
461461
@@ -535,7 +535,7 @@ def __init__(
535535
*,
536536
retry: OptionalRetry = gapic_v1.method.DEFAULT,
537537
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
538-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
538+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
539539
):
540540
"""Instantiate the pager.
541541
@@ -611,7 +611,7 @@ def __init__(
611611
*,
612612
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
613613
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
614-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
614+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
615615
):
616616
"""Instantiates the pager.
617617
@@ -691,7 +691,7 @@ def __init__(
691691
*,
692692
retry: OptionalRetry = gapic_v1.method.DEFAULT,
693693
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
694-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
694+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
695695
):
696696
"""Instantiate the pager.
697697
@@ -769,7 +769,7 @@ def __init__(
769769
*,
770770
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
771771
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
772-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
772+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
773773
):
774774
"""Instantiates the pager.
775775
@@ -851,7 +851,7 @@ def __init__(
851851
*,
852852
retry: OptionalRetry = gapic_v1.method.DEFAULT,
853853
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
854-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
854+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
855855
):
856856
"""Instantiate the pager.
857857
@@ -935,7 +935,7 @@ def __init__(
935935
*,
936936
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
937937
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
938-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
938+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
939939
):
940940
"""Instantiates the pager.
941941
@@ -1021,7 +1021,7 @@ def __init__(
10211021
*,
10221022
retry: OptionalRetry = gapic_v1.method.DEFAULT,
10231023
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1024-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
1024+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
10251025
):
10261026
"""Instantiate the pager.
10271027
@@ -1101,7 +1101,7 @@ def __init__(
11011101
*,
11021102
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
11031103
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1104-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
1104+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
11051105
):
11061106
"""Instantiates the pager.
11071107

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
1818

1919
import google.api_core
20+
import google.auth # type: ignore
21+
import google.protobuf
2022
from google.api_core import exceptions as core_exceptions
2123
from google.api_core import gapic_v1, operations_v1
2224
from google.api_core import retry as retries
23-
import google.auth # type: ignore
2425
from google.auth import credentials as ga_credentials # type: ignore
2526
from google.longrunning import operations_pb2 # type: ignore
2627
from google.oauth2 import service_account # type: ignore
27-
import google.protobuf
2828
from google.protobuf import empty_pb2 # type: ignore
2929

3030
from google.cloud.asset_v1 import gapic_version as package_version

0 commit comments

Comments
 (0)