google-cloud-securesourcemanager 0.6.0__tar.gz → 0.6.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {google_cloud_securesourcemanager-0.6.0/google_cloud_securesourcemanager.egg-info → google_cloud_securesourcemanager-0.6.2}/PKG-INFO +5 -6
  2. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager/__init__.py +6 -0
  3. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager/gapic_version.py +1 -1
  4. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/__init__.py +20 -86
  5. google_cloud_securesourcemanager-0.6.2/google/cloud/securesourcemanager_v1/_compat.py +262 -0
  6. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/gapic_metadata.json +15 -0
  7. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/gapic_version.py +1 -1
  8. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/secure_source_manager/async_client.py +114 -3
  9. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/secure_source_manager/client.py +167 -163
  10. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/secure_source_manager/pagers.py +156 -0
  11. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/secure_source_manager/transports/base.py +22 -4
  12. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/secure_source_manager/transports/grpc.py +29 -0
  13. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/secure_source_manager/transports/grpc_asyncio.py +34 -0
  14. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/secure_source_manager/transports/rest.py +771 -602
  15. google_cloud_securesourcemanager-0.6.2/google/cloud/securesourcemanager_v1/services/secure_source_manager/transports/rest_base.py +1111 -0
  16. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/types/__init__.py +6 -0
  17. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/types/secure_source_manager.py +183 -0
  18. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2/google_cloud_securesourcemanager.egg-info}/PKG-INFO +5 -6
  19. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google_cloud_securesourcemanager.egg-info/SOURCES.txt +2 -0
  20. google_cloud_securesourcemanager-0.6.2/google_cloud_securesourcemanager.egg-info/requires.txt +9 -0
  21. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/setup.py +8 -6
  22. google_cloud_securesourcemanager-0.6.2/tests/unit/gapic/securesourcemanager_v1/test_compat.py +429 -0
  23. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/tests/unit/gapic/securesourcemanager_v1/test_secure_source_manager.py +1565 -1505
  24. google_cloud_securesourcemanager-0.6.0/google/cloud/securesourcemanager_v1/services/secure_source_manager/transports/rest_base.py +0 -3062
  25. google_cloud_securesourcemanager-0.6.0/google_cloud_securesourcemanager.egg-info/requires.txt +0 -12
  26. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/LICENSE +0 -0
  27. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/MANIFEST.in +0 -0
  28. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/README.rst +0 -0
  29. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager/py.typed +0 -0
  30. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/py.typed +0 -0
  31. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/__init__.py +0 -0
  32. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/secure_source_manager/__init__.py +0 -0
  33. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google/cloud/securesourcemanager_v1/services/secure_source_manager/transports/__init__.py +0 -0
  34. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google_cloud_securesourcemanager.egg-info/dependency_links.txt +0 -0
  35. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google_cloud_securesourcemanager.egg-info/not-zip-safe +0 -0
  36. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/google_cloud_securesourcemanager.egg-info/top_level.txt +0 -0
  37. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/setup.cfg +0 -0
  38. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/tests/__init__.py +0 -0
  39. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/tests/unit/__init__.py +0 -0
  40. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/tests/unit/gapic/__init__.py +0 -0
  41. {google_cloud_securesourcemanager-0.6.0 → google_cloud_securesourcemanager-0.6.2}/tests/unit/gapic/securesourcemanager_v1/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-securesourcemanager
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: Google Cloud Securesourcemanager API client library
5
5
  Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-securesourcemanager
6
6
  Author: Google LLC
@@ -21,14 +21,13 @@ Classifier: Operating System :: OS Independent
21
21
  Classifier: Topic :: Internet
22
22
  Requires-Python: >=3.10
23
23
  License-File: LICENSE
24
- Requires-Dist: google-api-core[grpc]<3.0.0,>=2.17.1
24
+ Requires-Dist: google-api-core[grpc]<3.0.0,>=2.28.0
25
25
  Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
26
26
  Requires-Dist: grpcio<2.0.0,>=1.59.0
27
27
  Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
28
- Requires-Dist: proto-plus<2.0.0,>=1.22.3
29
- Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
30
- Requires-Dist: protobuf<8.0.0,>=4.25.8
31
- Requires-Dist: grpc-google-iam-v1<1.0.0,>=0.14.0
28
+ Requires-Dist: proto-plus<2.0.0,>=1.26.1
29
+ Requires-Dist: protobuf<8.0.0,>=6.33.5
30
+ Requires-Dist: grpc-google-iam-v1<1.0.0,>=0.14.2
32
31
  Dynamic: author
33
32
  Dynamic: author-email
34
33
  Dynamic: classifier
@@ -47,6 +47,8 @@ from google.cloud.securesourcemanager_v1.types.secure_source_manager import (
47
47
  DeleteRepositoryRequest,
48
48
  FetchBlobRequest,
49
49
  FetchBlobResponse,
50
+ FetchRefsRequest,
51
+ FetchRefsResponse,
50
52
  FetchTreeRequest,
51
53
  FetchTreeResponse,
52
54
  FileDiff,
@@ -86,6 +88,7 @@ from google.cloud.securesourcemanager_v1.types.secure_source_manager import (
86
88
  OperationMetadata,
87
89
  PullRequest,
88
90
  PullRequestComment,
91
+ Ref,
89
92
  Repository,
90
93
  ResolvePullRequestCommentsRequest,
91
94
  ResolvePullRequestCommentsResponse,
@@ -126,6 +129,8 @@ __all__ = (
126
129
  "DeleteRepositoryRequest",
127
130
  "FetchBlobRequest",
128
131
  "FetchBlobResponse",
132
+ "FetchRefsRequest",
133
+ "FetchRefsResponse",
129
134
  "FetchTreeRequest",
130
135
  "FetchTreeResponse",
131
136
  "FileDiff",
@@ -165,6 +170,7 @@ __all__ = (
165
170
  "OperationMetadata",
166
171
  "PullRequest",
167
172
  "PullRequestComment",
173
+ "Ref",
168
174
  "Repository",
169
175
  "ResolvePullRequestCommentsRequest",
170
176
  "ResolvePullRequestCommentsResponse",
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.6.0" # {x-release-please-version}
16
+ __version__ = "0.6.2" # {x-release-please-version}
@@ -13,15 +13,23 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- import sys
17
-
18
16
  import google.api_core as api_core
19
17
 
20
18
  from google.cloud.securesourcemanager_v1 import gapic_version as package_version
21
19
 
22
20
  __version__ = package_version.__version__
23
21
 
24
- from importlib import metadata
22
+ # PEP 0810: Explicit Lazy Imports
23
+ # Python 3.15+ natively intercepts and defers these imports.
24
+ # Developers can disable this behavior and force eager imports.
25
+ # For more information, see:
26
+ # https://docs.python.org/3.15/library/sys.html#sys.set_lazy_imports_filter
27
+ # Older Python versions safely ignore this variable.
28
+ __lazy_modules__ = {
29
+ "google.cloud.securesourcemanager_v1.services.secure_source_manager",
30
+ "google.cloud.securesourcemanager_v1.types.secure_source_manager",
31
+ }
32
+
25
33
 
26
34
  from .services.secure_source_manager import (
27
35
  SecureSourceManagerAsyncClient,
@@ -50,6 +58,8 @@ from .types.secure_source_manager import (
50
58
  DeleteRepositoryRequest,
51
59
  FetchBlobRequest,
52
60
  FetchBlobResponse,
61
+ FetchRefsRequest,
62
+ FetchRefsResponse,
53
63
  FetchTreeRequest,
54
64
  FetchTreeResponse,
55
65
  FileDiff,
@@ -89,6 +99,7 @@ from .types.secure_source_manager import (
89
99
  OperationMetadata,
90
100
  PullRequest,
91
101
  PullRequestComment,
102
+ Ref,
92
103
  Repository,
93
104
  ResolvePullRequestCommentsRequest,
94
105
  ResolvePullRequestCommentsResponse,
@@ -104,89 +115,6 @@ from .types.secure_source_manager import (
104
115
  UpdateRepositoryRequest,
105
116
  )
106
117
 
107
- if hasattr(api_core, "check_python_version") and hasattr(
108
- api_core, "check_dependency_versions"
109
- ): # pragma: NO COVER
110
- api_core.check_python_version("google.cloud.securesourcemanager_v1") # type: ignore
111
- api_core.check_dependency_versions("google.cloud.securesourcemanager_v1") # type: ignore
112
- else: # pragma: NO COVER
113
- # An older version of api_core is installed which does not define the
114
- # functions above. We do equivalent checks manually.
115
- try:
116
- import warnings
117
-
118
- _py_version_str = sys.version.split()[0]
119
- _package_label = "google.cloud.securesourcemanager_v1"
120
- if sys.version_info < (3, 10):
121
- warnings.warn(
122
- "You are using a non-supported Python version "
123
- + f"({_py_version_str}). Google will not post any further "
124
- + f"updates to {_package_label} supporting this Python version. "
125
- + "Please upgrade to the latest Python version, or at "
126
- + f"least to Python 3.10, and then update {_package_label}.",
127
- FutureWarning,
128
- )
129
-
130
- def parse_version_to_tuple(version_string: str):
131
- """Safely converts a semantic version string to a comparable tuple of integers.
132
- Example: "4.25.8" -> (4, 25, 8)
133
- Ignores non-numeric parts and handles common version formats.
134
- Args:
135
- version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
136
- Returns:
137
- Tuple of integers for the parsed version string.
138
- """
139
- parts = []
140
- for part in version_string.split("."):
141
- try:
142
- parts.append(int(part))
143
- except ValueError:
144
- # If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
145
- # This is a simplification compared to 'packaging.parse_version', but sufficient
146
- # for comparing strictly numeric semantic versions.
147
- break
148
- return tuple(parts)
149
-
150
- def _get_version(dependency_name):
151
- try:
152
- version_string: str = metadata.version(dependency_name)
153
- parsed_version = parse_version_to_tuple(version_string)
154
- return (parsed_version, version_string)
155
- except Exception:
156
- # Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
157
- # or errors during parse_version_to_tuple
158
- return (None, "--")
159
-
160
- _dependency_package = "google.protobuf"
161
- _next_supported_version = "4.25.8"
162
- _next_supported_version_tuple = (4, 25, 8)
163
- _recommendation = " (we recommend 6.x)"
164
- (_version_used, _version_used_string) = _get_version(_dependency_package)
165
- if _version_used and _version_used < _next_supported_version_tuple:
166
- warnings.warn(
167
- f"Package {_package_label} depends on "
168
- + f"{_dependency_package}, currently installed at version "
169
- + f"{_version_used_string}. Future updates to "
170
- + f"{_package_label} will require {_dependency_package} at "
171
- + f"version {_next_supported_version} or higher{_recommendation}."
172
- + " Please ensure "
173
- + "that either (a) your Python environment doesn't pin the "
174
- + f"version of {_dependency_package}, so that updates to "
175
- + f"{_package_label} can require the higher version, or "
176
- + "(b) you manually update your Python environment to use at "
177
- + f"least version {_next_supported_version} of "
178
- + f"{_dependency_package}.",
179
- FutureWarning,
180
- )
181
- except Exception:
182
- warnings.warn(
183
- "Could not determine the version of Python "
184
- + "currently being used. To continue receiving "
185
- + "updates for {_package_label}, ensure you are "
186
- + "using a supported version of Python; see "
187
- + "https://devguide.python.org/versions/"
188
- )
189
-
190
118
  __all__ = (
191
119
  "SecureSourceManagerAsyncClient",
192
120
  "BatchCreatePullRequestCommentsRequest",
@@ -211,6 +139,8 @@ __all__ = (
211
139
  "DeleteRepositoryRequest",
212
140
  "FetchBlobRequest",
213
141
  "FetchBlobResponse",
142
+ "FetchRefsRequest",
143
+ "FetchRefsResponse",
214
144
  "FetchTreeRequest",
215
145
  "FetchTreeResponse",
216
146
  "FileDiff",
@@ -250,6 +180,7 @@ __all__ = (
250
180
  "OperationMetadata",
251
181
  "PullRequest",
252
182
  "PullRequestComment",
183
+ "Ref",
253
184
  "Repository",
254
185
  "ResolvePullRequestCommentsRequest",
255
186
  "ResolvePullRequestCommentsResponse",
@@ -265,3 +196,6 @@ __all__ = (
265
196
  "UpdatePullRequestRequest",
266
197
  "UpdateRepositoryRequest",
267
198
  )
199
+
200
+ api_core.check_python_version("google.cloud.securesourcemanager_v1")
201
+ api_core.check_dependency_versions("google.cloud.securesourcemanager_v1")
@@ -0,0 +1,262 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2026 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ """A compatibility module for older versions of google-api-core."""
17
+
18
+ import json
19
+ import os
20
+ from typing import Any, Dict, List, Optional, Tuple
21
+ from urllib.parse import urlparse, urlunparse
22
+
23
+ from google.api_core import path_template
24
+ from google.api_core.universe import EmptyUniverseError
25
+ from google.auth.exceptions import MutualTLSChannelError
26
+ from google.protobuf import json_format
27
+
28
+ try:
29
+ # note: `#type: ignore` is added because the return type for `should_use_client_cert`
30
+ # is different than that of the fallback implementation below. This will be removed once
31
+ # we bump the minimum supported version of google-auth.
32
+ from google.auth.transport.mtls import should_use_client_cert # type: ignore
33
+ except ImportError: # pragma: NO COVER
34
+
35
+ def should_use_client_cert():
36
+ """Returns whether client certificate should be used for mTLS."""
37
+ use_client_cert = os.getenv(
38
+ "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"
39
+ ).lower()
40
+ if use_client_cert not in ("true", "false"):
41
+ raise ValueError(
42
+ "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be"
43
+ " either `true` or `false`"
44
+ )
45
+ return use_client_cert == "true"
46
+
47
+
48
+ def read_environment_variables():
49
+ """Returns the environment variables used by the client.
50
+
51
+ Returns:
52
+ Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE,
53
+ GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables.
54
+
55
+ Raises:
56
+ ValueError: If GOOGLE_API_USE_CLIENT_CERTIFICATE is not
57
+ any of ["true", "false"].
58
+ google.auth.exceptions.MutualTLSChannelError: If GOOGLE_API_USE_MTLS_ENDPOINT
59
+ is not any of ["auto", "never", "always"].
60
+ """
61
+ use_client_cert = should_use_client_cert()
62
+ use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").lower()
63
+ universe_domain_env = os.getenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN")
64
+ if use_mtls_endpoint not in ("auto", "never", "always"):
65
+ raise MutualTLSChannelError(
66
+ "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`,"
67
+ " `auto` or `always`"
68
+ )
69
+ return use_client_cert, use_mtls_endpoint, universe_domain_env
70
+
71
+
72
+ DEFAULT_UNIVERSE = "googleapis.com"
73
+
74
+ try:
75
+ from google.api_core.universe import get_default_mtls_endpoint
76
+ except ImportError: # pragma: NO COVER
77
+
78
+ def get_default_mtls_endpoint(api_endpoint: Optional[str]) -> Optional[str]:
79
+ """Converts api endpoint to mTLS endpoint.
80
+
81
+ Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
82
+ "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
83
+ Other URLs (including those that do not match these domain suffixes or
84
+ already contain '.mtls.') are passed through as-is.
85
+
86
+ Args:
87
+ api_endpoint (Optional[str]): the api endpoint to convert.
88
+
89
+ Returns:
90
+ Optional[str]: converted mTLS api endpoint.
91
+ """
92
+ if not api_endpoint or ".mtls." in api_endpoint.lower():
93
+ return api_endpoint
94
+
95
+ has_scheme = "://" in api_endpoint
96
+ if not has_scheme:
97
+ parsed = urlparse("//" + api_endpoint)
98
+ else:
99
+ parsed = urlparse(api_endpoint)
100
+
101
+ host = parsed.hostname
102
+ if not host:
103
+ return api_endpoint
104
+
105
+ port = f":{parsed.port}" if parsed.port else ""
106
+
107
+ lowered_host = host.lower()
108
+ suffix_sandbox = ".sandbox.googleapis.com"
109
+ suffix_google = ".googleapis.com"
110
+ if lowered_host.endswith(suffix_sandbox):
111
+ new_host = host[: -len(suffix_sandbox)] + ".mtls.sandbox.googleapis.com"
112
+ elif lowered_host.endswith(suffix_google):
113
+ new_host = host[: -len(suffix_google)] + ".mtls.googleapis.com"
114
+ else:
115
+ return api_endpoint
116
+
117
+ netloc = new_host + port
118
+ new_parsed = parsed._replace(netloc=netloc)
119
+
120
+ if not has_scheme:
121
+ return urlunparse(new_parsed)[2:]
122
+ else:
123
+ return urlunparse(new_parsed)
124
+
125
+
126
+ try:
127
+ from google.api_core.universe import get_api_endpoint
128
+ except ImportError: # pragma: NO COVER
129
+
130
+ def get_api_endpoint(
131
+ api_override: Optional[str],
132
+ universe_domain: str,
133
+ default_universe: str,
134
+ default_mtls_endpoint: Optional[str],
135
+ default_endpoint_template: str,
136
+ use_mtls: bool,
137
+ ) -> str:
138
+ """Return the API endpoint used by the client.
139
+
140
+ Args:
141
+ api_override (Optional[str]): The API endpoint override. If specified,
142
+ this is always returned.
143
+ universe_domain (str): The universe domain used by the client.
144
+ default_universe (str): The default universe domain.
145
+ default_mtls_endpoint (Optional[str]): The default mTLS endpoint.
146
+ default_endpoint_template (str): The default endpoint template containing
147
+ a placeholder `{UNIVERSE_DOMAIN}`.
148
+ use_mtls (bool): Whether to use the mTLS endpoint.
149
+
150
+ Returns:
151
+ str: The API endpoint to be used by the client.
152
+
153
+ Raises:
154
+ google.auth.exceptions.MutualTLSChannelError: If mTLS is requested but
155
+ not supported in the configured universe domain.
156
+ ValueError: If mTLS is requested but no mTLS endpoint is available.
157
+ """
158
+ if api_override is not None:
159
+ return api_override
160
+
161
+ if use_mtls:
162
+ if universe_domain.lower() != default_universe.lower():
163
+ raise MutualTLSChannelError(
164
+ f"mTLS is not supported in any universe other than {default_universe}."
165
+ )
166
+ if not default_mtls_endpoint:
167
+ raise ValueError("mTLS endpoint is not available.")
168
+ return default_mtls_endpoint
169
+ else:
170
+ return default_endpoint_template.format(UNIVERSE_DOMAIN=universe_domain)
171
+
172
+
173
+ try:
174
+ from google.api_core.universe import get_universe_domain
175
+ except ImportError: # pragma: NO COVER
176
+
177
+ def get_universe_domain(
178
+ *potential_universes: Optional[str],
179
+ default_universe: str,
180
+ ) -> str:
181
+ """Return the universe domain used by the client.
182
+
183
+ Args:
184
+ *potential_universes (Optional[str]): Potential universe domains in order of preference.
185
+ default_universe (str): The default universe domain.
186
+
187
+ Returns:
188
+ str: The universe domain to be used by the client.
189
+
190
+ Raises:
191
+ EmptyUniverseError: If the resolved universe domain is an empty string.
192
+ """
193
+ resolved = next(
194
+ (x.strip() for x in potential_universes if x is not None),
195
+ default_universe,
196
+ )
197
+
198
+ if not resolved:
199
+ raise EmptyUniverseError()
200
+ return resolved
201
+
202
+
203
+ try:
204
+ from google.api_core.rest_helpers import transcode_request # type: ignore
205
+ except ImportError: # pragma: NO COVER
206
+
207
+ def transcode_request(
208
+ http_options: List[Dict[str, str]],
209
+ request: Any,
210
+ required_fields_default_values: Optional[Dict[str, Any]] = None,
211
+ rest_numeric_enums: bool = False,
212
+ ) -> Tuple[Dict[str, Any], Optional[str], Dict[str, Any]]:
213
+ """Transcodes a request into HTTP method, URI, body, and query parameters.
214
+
215
+ Args:
216
+ http_options (List[Dict[str, str]]): List of HTTP transcoding rules.
217
+ request (Any): The protobuf or proto-plus request message.
218
+ required_fields_default_values (Optional[Dict[str, Any]]): Dictionary
219
+ of required fields default values to merge into query parameters if missing.
220
+ rest_numeric_enums (bool): Whether to encode enums as integers.
221
+
222
+ Returns:
223
+ Tuple[Dict[str, Any], Optional[str], Dict[str, Any]]: A tuple containing:
224
+ - The raw transcoded request dictionary (containing keys like 'uri', 'method').
225
+ - The serialized request body JSON string, or None if no body.
226
+ - The query parameters dictionary.
227
+ """
228
+ if request is None:
229
+ raise TypeError("request cannot be None")
230
+
231
+ # Convert proto-plus message to its underlying protobuf message if needed
232
+ pb_request = getattr(request, "_pb", request)
233
+
234
+ transcoded_request = path_template.transcode(http_options, pb_request)
235
+
236
+ body_json = None
237
+ if transcoded_request.get("body") is not None:
238
+ body_json = json_format.MessageToJson(
239
+ transcoded_request["body"],
240
+ use_integers_for_enums=rest_numeric_enums,
241
+ )
242
+
243
+ query_params_json = {}
244
+ if transcoded_request.get("query_params") is not None:
245
+ query_params_json = json.loads(
246
+ json_format.MessageToJson(
247
+ transcoded_request["query_params"],
248
+ use_integers_for_enums=rest_numeric_enums,
249
+ )
250
+ )
251
+
252
+ # If required_fields_default_values is provided, we merge default values for missing
253
+ # required fields into the query parameters.
254
+ if required_fields_default_values:
255
+ for k, v in required_fields_default_values.items():
256
+ if k not in query_params_json:
257
+ query_params_json[k] = v
258
+
259
+ if rest_numeric_enums:
260
+ query_params_json["$alt"] = "json;enum-encoding=int"
261
+
262
+ return transcoded_request, body_json, query_params_json
@@ -105,6 +105,11 @@
105
105
  "fetch_blob"
106
106
  ]
107
107
  },
108
+ "FetchRefs": {
109
+ "methods": [
110
+ "fetch_refs"
111
+ ]
112
+ },
108
113
  "FetchTree": {
109
114
  "methods": [
110
115
  "fetch_tree"
@@ -370,6 +375,11 @@
370
375
  "fetch_blob"
371
376
  ]
372
377
  },
378
+ "FetchRefs": {
379
+ "methods": [
380
+ "fetch_refs"
381
+ ]
382
+ },
373
383
  "FetchTree": {
374
384
  "methods": [
375
385
  "fetch_tree"
@@ -635,6 +645,11 @@
635
645
  "fetch_blob"
636
646
  ]
637
647
  },
648
+ "FetchRefs": {
649
+ "methods": [
650
+ "fetch_refs"
651
+ ]
652
+ },
638
653
  "FetchTree": {
639
654
  "methods": [
640
655
  "fetch_tree"
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.6.0" # {x-release-please-version}
16
+ __version__ = "0.6.2" # {x-release-please-version}
@@ -103,6 +103,12 @@ class SecureSourceManagerAsyncClient:
103
103
  )
104
104
  hook_path = staticmethod(SecureSourceManagerClient.hook_path)
105
105
  parse_hook_path = staticmethod(SecureSourceManagerClient.parse_hook_path)
106
+ inspect_template_path = staticmethod(
107
+ SecureSourceManagerClient.inspect_template_path
108
+ )
109
+ parse_inspect_template_path = staticmethod(
110
+ SecureSourceManagerClient.parse_inspect_template_path
111
+ )
106
112
  instance_path = staticmethod(SecureSourceManagerClient.instance_path)
107
113
  parse_instance_path = staticmethod(SecureSourceManagerClient.parse_instance_path)
108
114
  issue_path = staticmethod(SecureSourceManagerClient.issue_path)
@@ -125,6 +131,10 @@ class SecureSourceManagerAsyncClient:
125
131
  parse_repository_path = staticmethod(
126
132
  SecureSourceManagerClient.parse_repository_path
127
133
  )
134
+ service_account_path = staticmethod(SecureSourceManagerClient.service_account_path)
135
+ parse_service_account_path = staticmethod(
136
+ SecureSourceManagerClient.parse_service_account_path
137
+ )
128
138
  service_attachment_path = staticmethod(
129
139
  SecureSourceManagerClient.service_attachment_path
130
140
  )
@@ -4503,6 +4513,109 @@ class SecureSourceManagerAsyncClient:
4503
4513
  # Done; return the response.
4504
4514
  return response
4505
4515
 
4516
+ async def fetch_refs(
4517
+ self,
4518
+ request: Optional[Union[secure_source_manager.FetchRefsRequest, dict]] = None,
4519
+ *,
4520
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
4521
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4522
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
4523
+ ) -> pagers.FetchRefsAsyncPager:
4524
+ r"""Fetches git references from a repository.
4525
+
4526
+ .. code-block:: python
4527
+
4528
+ # This snippet has been automatically generated and should be regarded as a
4529
+ # code template only.
4530
+ # It will require modifications to work:
4531
+ # - It may require correct/in-range values for request initialization.
4532
+ # - It may require specifying regional endpoints when creating the service
4533
+ # client as shown in:
4534
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
4535
+ from google.cloud import securesourcemanager_v1
4536
+
4537
+ async def sample_fetch_refs():
4538
+ # Create a client
4539
+ client = securesourcemanager_v1.SecureSourceManagerAsyncClient()
4540
+
4541
+ # Initialize request argument(s)
4542
+ request = securesourcemanager_v1.FetchRefsRequest(
4543
+ repository="repository_value",
4544
+ )
4545
+
4546
+ # Make the request
4547
+ page_result = client.fetch_refs(request=request)
4548
+
4549
+ # Handle the response
4550
+ async for response in page_result:
4551
+ print(response)
4552
+
4553
+ Args:
4554
+ request (Optional[Union[google.cloud.securesourcemanager_v1.types.FetchRefsRequest, dict]]):
4555
+ The request object. Request message for fetching git
4556
+ references from a repository.
4557
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
4558
+ should be retried.
4559
+ timeout (float): The timeout for this request.
4560
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4561
+ sent along with the request as metadata. Normally, each value must be of type `str`,
4562
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
4563
+ be of type `bytes`.
4564
+
4565
+ Returns:
4566
+ google.cloud.securesourcemanager_v1.services.secure_source_manager.pagers.FetchRefsAsyncPager:
4567
+ Response message containing a list of
4568
+ git references.
4569
+ Iterating over this object will yield
4570
+ results and resolve additional pages
4571
+ automatically.
4572
+
4573
+ """
4574
+ # Create or coerce a protobuf request object.
4575
+ # - Use the request object if provided (there's no risk of modifying the input as
4576
+ # there are no flattened fields), or create one.
4577
+ if not isinstance(request, secure_source_manager.FetchRefsRequest):
4578
+ request = secure_source_manager.FetchRefsRequest(request)
4579
+
4580
+ # Wrap the RPC method; this adds retry and timeout information,
4581
+ # and friendly error handling.
4582
+ rpc = self._client._transport._wrapped_methods[
4583
+ self._client._transport.fetch_refs
4584
+ ]
4585
+
4586
+ # Certain fields should be provided within the metadata header;
4587
+ # add these here.
4588
+ metadata = tuple(metadata) + (
4589
+ gapic_v1.routing_header.to_grpc_metadata(
4590
+ (("repository", request.repository),)
4591
+ ),
4592
+ )
4593
+
4594
+ # Validate the universe domain.
4595
+ self._client._validate_universe_domain()
4596
+
4597
+ # Send the request.
4598
+ response = await rpc(
4599
+ request,
4600
+ retry=retry,
4601
+ timeout=timeout,
4602
+ metadata=metadata,
4603
+ )
4604
+
4605
+ # This method is paged; wrap the response in a pager, which provides
4606
+ # an `__aiter__` convenience method.
4607
+ response = pagers.FetchRefsAsyncPager(
4608
+ method=rpc,
4609
+ request=request,
4610
+ response=response,
4611
+ retry=retry,
4612
+ timeout=timeout,
4613
+ metadata=metadata,
4614
+ )
4615
+
4616
+ # Done; return the response.
4617
+ return response
4618
+
4506
4619
  async def create_issue(
4507
4620
  self,
4508
4621
  request: Optional[Union[secure_source_manager.CreateIssueRequest, dict]] = None,
@@ -7894,9 +8007,7 @@ class SecureSourceManagerAsyncClient:
7894
8007
  DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
7895
8008
  gapic_version=package_version.__version__
7896
8009
  )
7897
-
7898
- if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
7899
- DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
8010
+ DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
7900
8011
 
7901
8012
 
7902
8013
  __all__ = ("SecureSourceManagerAsyncClient",)