google-cloud-maintenance-api 0.1.0__py3-none-any.whl

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 (25) hide show
  1. google/cloud/maintenance_api/__init__.py +51 -0
  2. google/cloud/maintenance_api/gapic_version.py +16 -0
  3. google/cloud/maintenance_api/py.typed +2 -0
  4. google/cloud/maintenance_api_v1beta/__init__.py +46 -0
  5. google/cloud/maintenance_api_v1beta/gapic_metadata.json +73 -0
  6. google/cloud/maintenance_api_v1beta/gapic_version.py +16 -0
  7. google/cloud/maintenance_api_v1beta/py.typed +2 -0
  8. google/cloud/maintenance_api_v1beta/services/__init__.py +15 -0
  9. google/cloud/maintenance_api_v1beta/services/maintenance/__init__.py +22 -0
  10. google/cloud/maintenance_api_v1beta/services/maintenance/async_client.py +786 -0
  11. google/cloud/maintenance_api_v1beta/services/maintenance/client.py +1211 -0
  12. google/cloud/maintenance_api_v1beta/services/maintenance/pagers.py +361 -0
  13. google/cloud/maintenance_api_v1beta/services/maintenance/transports/__init__.py +36 -0
  14. google/cloud/maintenance_api_v1beta/services/maintenance/transports/base.py +234 -0
  15. google/cloud/maintenance_api_v1beta/services/maintenance/transports/grpc.py +456 -0
  16. google/cloud/maintenance_api_v1beta/services/maintenance/transports/grpc_asyncio.py +499 -0
  17. google/cloud/maintenance_api_v1beta/services/maintenance/transports/rest.py +1182 -0
  18. google/cloud/maintenance_api_v1beta/services/maintenance/transports/rest_base.py +283 -0
  19. google/cloud/maintenance_api_v1beta/types/__init__.py +38 -0
  20. google/cloud/maintenance_api_v1beta/types/maintenance_service.py +713 -0
  21. google_cloud_maintenance_api-0.1.0.dist-info/METADATA +239 -0
  22. google_cloud_maintenance_api-0.1.0.dist-info/RECORD +25 -0
  23. google_cloud_maintenance_api-0.1.0.dist-info/WHEEL +5 -0
  24. google_cloud_maintenance_api-0.1.0.dist-info/licenses/LICENSE +202 -0
  25. google_cloud_maintenance_api-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,361 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2025 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
+ from typing import (
17
+ Any,
18
+ AsyncIterator,
19
+ Awaitable,
20
+ Callable,
21
+ Iterator,
22
+ Optional,
23
+ Sequence,
24
+ Tuple,
25
+ Union,
26
+ )
27
+
28
+ from google.api_core import gapic_v1
29
+ from google.api_core import retry as retries
30
+ from google.api_core import retry_async as retries_async
31
+
32
+ try:
33
+ OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
34
+ OptionalAsyncRetry = Union[
35
+ retries_async.AsyncRetry, gapic_v1.method._MethodDefault, None
36
+ ]
37
+ except AttributeError: # pragma: NO COVER
38
+ OptionalRetry = Union[retries.Retry, object, None] # type: ignore
39
+ OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore
40
+
41
+ from google.cloud.maintenance_api_v1beta.types import maintenance_service
42
+
43
+
44
+ class SummarizeMaintenancesPager:
45
+ """A pager for iterating through ``summarize_maintenances`` requests.
46
+
47
+ This class thinly wraps an initial
48
+ :class:`google.cloud.maintenance_api_v1beta.types.SummarizeMaintenancesResponse` object, and
49
+ provides an ``__iter__`` method to iterate through its
50
+ ``maintenances`` field.
51
+
52
+ If there are more pages, the ``__iter__`` method will make additional
53
+ ``SummarizeMaintenances`` requests and continue to iterate
54
+ through the ``maintenances`` field on the
55
+ corresponding responses.
56
+
57
+ All the usual :class:`google.cloud.maintenance_api_v1beta.types.SummarizeMaintenancesResponse`
58
+ attributes are available on the pager. If multiple requests are made, only
59
+ the most recent response is retained, and thus used for attribute lookup.
60
+ """
61
+
62
+ def __init__(
63
+ self,
64
+ method: Callable[..., maintenance_service.SummarizeMaintenancesResponse],
65
+ request: maintenance_service.SummarizeMaintenancesRequest,
66
+ response: maintenance_service.SummarizeMaintenancesResponse,
67
+ *,
68
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
69
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
70
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
71
+ ):
72
+ """Instantiate the pager.
73
+
74
+ Args:
75
+ method (Callable): The method that was originally called, and
76
+ which instantiated this pager.
77
+ request (google.cloud.maintenance_api_v1beta.types.SummarizeMaintenancesRequest):
78
+ The initial request object.
79
+ response (google.cloud.maintenance_api_v1beta.types.SummarizeMaintenancesResponse):
80
+ The initial response object.
81
+ retry (google.api_core.retry.Retry): Designation of what errors,
82
+ if any, should be retried.
83
+ timeout (float): The timeout for this request.
84
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
85
+ sent along with the request as metadata. Normally, each value must be of type `str`,
86
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
87
+ be of type `bytes`.
88
+ """
89
+ self._method = method
90
+ self._request = maintenance_service.SummarizeMaintenancesRequest(request)
91
+ self._response = response
92
+ self._retry = retry
93
+ self._timeout = timeout
94
+ self._metadata = metadata
95
+
96
+ def __getattr__(self, name: str) -> Any:
97
+ return getattr(self._response, name)
98
+
99
+ @property
100
+ def pages(self) -> Iterator[maintenance_service.SummarizeMaintenancesResponse]:
101
+ yield self._response
102
+ while self._response.next_page_token:
103
+ self._request.page_token = self._response.next_page_token
104
+ self._response = self._method(
105
+ self._request,
106
+ retry=self._retry,
107
+ timeout=self._timeout,
108
+ metadata=self._metadata,
109
+ )
110
+ yield self._response
111
+
112
+ def __iter__(self) -> Iterator[maintenance_service.MaintenanceSummary]:
113
+ for page in self.pages:
114
+ yield from page.maintenances
115
+
116
+ def __repr__(self) -> str:
117
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
118
+
119
+
120
+ class SummarizeMaintenancesAsyncPager:
121
+ """A pager for iterating through ``summarize_maintenances`` requests.
122
+
123
+ This class thinly wraps an initial
124
+ :class:`google.cloud.maintenance_api_v1beta.types.SummarizeMaintenancesResponse` object, and
125
+ provides an ``__aiter__`` method to iterate through its
126
+ ``maintenances`` field.
127
+
128
+ If there are more pages, the ``__aiter__`` method will make additional
129
+ ``SummarizeMaintenances`` requests and continue to iterate
130
+ through the ``maintenances`` field on the
131
+ corresponding responses.
132
+
133
+ All the usual :class:`google.cloud.maintenance_api_v1beta.types.SummarizeMaintenancesResponse`
134
+ attributes are available on the pager. If multiple requests are made, only
135
+ the most recent response is retained, and thus used for attribute lookup.
136
+ """
137
+
138
+ def __init__(
139
+ self,
140
+ method: Callable[
141
+ ..., Awaitable[maintenance_service.SummarizeMaintenancesResponse]
142
+ ],
143
+ request: maintenance_service.SummarizeMaintenancesRequest,
144
+ response: maintenance_service.SummarizeMaintenancesResponse,
145
+ *,
146
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
147
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
148
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
149
+ ):
150
+ """Instantiates the pager.
151
+
152
+ Args:
153
+ method (Callable): The method that was originally called, and
154
+ which instantiated this pager.
155
+ request (google.cloud.maintenance_api_v1beta.types.SummarizeMaintenancesRequest):
156
+ The initial request object.
157
+ response (google.cloud.maintenance_api_v1beta.types.SummarizeMaintenancesResponse):
158
+ The initial response object.
159
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
160
+ if any, should be retried.
161
+ timeout (float): The timeout for this request.
162
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
163
+ sent along with the request as metadata. Normally, each value must be of type `str`,
164
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
165
+ be of type `bytes`.
166
+ """
167
+ self._method = method
168
+ self._request = maintenance_service.SummarizeMaintenancesRequest(request)
169
+ self._response = response
170
+ self._retry = retry
171
+ self._timeout = timeout
172
+ self._metadata = metadata
173
+
174
+ def __getattr__(self, name: str) -> Any:
175
+ return getattr(self._response, name)
176
+
177
+ @property
178
+ async def pages(
179
+ self,
180
+ ) -> AsyncIterator[maintenance_service.SummarizeMaintenancesResponse]:
181
+ yield self._response
182
+ while self._response.next_page_token:
183
+ self._request.page_token = self._response.next_page_token
184
+ self._response = await self._method(
185
+ self._request,
186
+ retry=self._retry,
187
+ timeout=self._timeout,
188
+ metadata=self._metadata,
189
+ )
190
+ yield self._response
191
+
192
+ def __aiter__(self) -> AsyncIterator[maintenance_service.MaintenanceSummary]:
193
+ async def async_generator():
194
+ async for page in self.pages:
195
+ for response in page.maintenances:
196
+ yield response
197
+
198
+ return async_generator()
199
+
200
+ def __repr__(self) -> str:
201
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
202
+
203
+
204
+ class ListResourceMaintenancesPager:
205
+ """A pager for iterating through ``list_resource_maintenances`` requests.
206
+
207
+ This class thinly wraps an initial
208
+ :class:`google.cloud.maintenance_api_v1beta.types.ListResourceMaintenancesResponse` object, and
209
+ provides an ``__iter__`` method to iterate through its
210
+ ``resource_maintenances`` field.
211
+
212
+ If there are more pages, the ``__iter__`` method will make additional
213
+ ``ListResourceMaintenances`` requests and continue to iterate
214
+ through the ``resource_maintenances`` field on the
215
+ corresponding responses.
216
+
217
+ All the usual :class:`google.cloud.maintenance_api_v1beta.types.ListResourceMaintenancesResponse`
218
+ attributes are available on the pager. If multiple requests are made, only
219
+ the most recent response is retained, and thus used for attribute lookup.
220
+ """
221
+
222
+ def __init__(
223
+ self,
224
+ method: Callable[..., maintenance_service.ListResourceMaintenancesResponse],
225
+ request: maintenance_service.ListResourceMaintenancesRequest,
226
+ response: maintenance_service.ListResourceMaintenancesResponse,
227
+ *,
228
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
229
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
230
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
231
+ ):
232
+ """Instantiate the pager.
233
+
234
+ Args:
235
+ method (Callable): The method that was originally called, and
236
+ which instantiated this pager.
237
+ request (google.cloud.maintenance_api_v1beta.types.ListResourceMaintenancesRequest):
238
+ The initial request object.
239
+ response (google.cloud.maintenance_api_v1beta.types.ListResourceMaintenancesResponse):
240
+ The initial response object.
241
+ retry (google.api_core.retry.Retry): Designation of what errors,
242
+ if any, should be retried.
243
+ timeout (float): The timeout for this request.
244
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
245
+ sent along with the request as metadata. Normally, each value must be of type `str`,
246
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
247
+ be of type `bytes`.
248
+ """
249
+ self._method = method
250
+ self._request = maintenance_service.ListResourceMaintenancesRequest(request)
251
+ self._response = response
252
+ self._retry = retry
253
+ self._timeout = timeout
254
+ self._metadata = metadata
255
+
256
+ def __getattr__(self, name: str) -> Any:
257
+ return getattr(self._response, name)
258
+
259
+ @property
260
+ def pages(self) -> Iterator[maintenance_service.ListResourceMaintenancesResponse]:
261
+ yield self._response
262
+ while self._response.next_page_token:
263
+ self._request.page_token = self._response.next_page_token
264
+ self._response = self._method(
265
+ self._request,
266
+ retry=self._retry,
267
+ timeout=self._timeout,
268
+ metadata=self._metadata,
269
+ )
270
+ yield self._response
271
+
272
+ def __iter__(self) -> Iterator[maintenance_service.ResourceMaintenance]:
273
+ for page in self.pages:
274
+ yield from page.resource_maintenances
275
+
276
+ def __repr__(self) -> str:
277
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
278
+
279
+
280
+ class ListResourceMaintenancesAsyncPager:
281
+ """A pager for iterating through ``list_resource_maintenances`` requests.
282
+
283
+ This class thinly wraps an initial
284
+ :class:`google.cloud.maintenance_api_v1beta.types.ListResourceMaintenancesResponse` object, and
285
+ provides an ``__aiter__`` method to iterate through its
286
+ ``resource_maintenances`` field.
287
+
288
+ If there are more pages, the ``__aiter__`` method will make additional
289
+ ``ListResourceMaintenances`` requests and continue to iterate
290
+ through the ``resource_maintenances`` field on the
291
+ corresponding responses.
292
+
293
+ All the usual :class:`google.cloud.maintenance_api_v1beta.types.ListResourceMaintenancesResponse`
294
+ attributes are available on the pager. If multiple requests are made, only
295
+ the most recent response is retained, and thus used for attribute lookup.
296
+ """
297
+
298
+ def __init__(
299
+ self,
300
+ method: Callable[
301
+ ..., Awaitable[maintenance_service.ListResourceMaintenancesResponse]
302
+ ],
303
+ request: maintenance_service.ListResourceMaintenancesRequest,
304
+ response: maintenance_service.ListResourceMaintenancesResponse,
305
+ *,
306
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
307
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
308
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
309
+ ):
310
+ """Instantiates the pager.
311
+
312
+ Args:
313
+ method (Callable): The method that was originally called, and
314
+ which instantiated this pager.
315
+ request (google.cloud.maintenance_api_v1beta.types.ListResourceMaintenancesRequest):
316
+ The initial request object.
317
+ response (google.cloud.maintenance_api_v1beta.types.ListResourceMaintenancesResponse):
318
+ The initial response object.
319
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
320
+ if any, should be retried.
321
+ timeout (float): The timeout for this request.
322
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
323
+ sent along with the request as metadata. Normally, each value must be of type `str`,
324
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
325
+ be of type `bytes`.
326
+ """
327
+ self._method = method
328
+ self._request = maintenance_service.ListResourceMaintenancesRequest(request)
329
+ self._response = response
330
+ self._retry = retry
331
+ self._timeout = timeout
332
+ self._metadata = metadata
333
+
334
+ def __getattr__(self, name: str) -> Any:
335
+ return getattr(self._response, name)
336
+
337
+ @property
338
+ async def pages(
339
+ self,
340
+ ) -> AsyncIterator[maintenance_service.ListResourceMaintenancesResponse]:
341
+ yield self._response
342
+ while self._response.next_page_token:
343
+ self._request.page_token = self._response.next_page_token
344
+ self._response = await self._method(
345
+ self._request,
346
+ retry=self._retry,
347
+ timeout=self._timeout,
348
+ metadata=self._metadata,
349
+ )
350
+ yield self._response
351
+
352
+ def __aiter__(self) -> AsyncIterator[maintenance_service.ResourceMaintenance]:
353
+ async def async_generator():
354
+ async for page in self.pages:
355
+ for response in page.resource_maintenances:
356
+ yield response
357
+
358
+ return async_generator()
359
+
360
+ def __repr__(self) -> str:
361
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
@@ -0,0 +1,36 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2025 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
+ from collections import OrderedDict
17
+ from typing import Dict, Type
18
+
19
+ from .base import MaintenanceTransport
20
+ from .grpc import MaintenanceGrpcTransport
21
+ from .grpc_asyncio import MaintenanceGrpcAsyncIOTransport
22
+ from .rest import MaintenanceRestInterceptor, MaintenanceRestTransport
23
+
24
+ # Compile a registry of transports.
25
+ _transport_registry = OrderedDict() # type: Dict[str, Type[MaintenanceTransport]]
26
+ _transport_registry["grpc"] = MaintenanceGrpcTransport
27
+ _transport_registry["grpc_asyncio"] = MaintenanceGrpcAsyncIOTransport
28
+ _transport_registry["rest"] = MaintenanceRestTransport
29
+
30
+ __all__ = (
31
+ "MaintenanceTransport",
32
+ "MaintenanceGrpcTransport",
33
+ "MaintenanceGrpcAsyncIOTransport",
34
+ "MaintenanceRestTransport",
35
+ "MaintenanceRestInterceptor",
36
+ )
@@ -0,0 +1,234 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2025 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
+ import abc
17
+ from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
18
+
19
+ import google.api_core
20
+ from google.api_core import exceptions as core_exceptions
21
+ from google.api_core import gapic_v1
22
+ from google.api_core import retry as retries
23
+ import google.auth # type: ignore
24
+ from google.auth import credentials as ga_credentials # type: ignore
25
+ from google.cloud.location import locations_pb2 # type: ignore
26
+ from google.oauth2 import service_account # type: ignore
27
+ import google.protobuf
28
+
29
+ from google.cloud.maintenance_api_v1beta import gapic_version as package_version
30
+ from google.cloud.maintenance_api_v1beta.types import maintenance_service
31
+
32
+ DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33
+ gapic_version=package_version.__version__
34
+ )
35
+
36
+ if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
37
+ DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
38
+
39
+
40
+ class MaintenanceTransport(abc.ABC):
41
+ """Abstract transport class for Maintenance."""
42
+
43
+ AUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",)
44
+
45
+ DEFAULT_HOST: str = "maintenance.googleapis.com"
46
+
47
+ def __init__(
48
+ self,
49
+ *,
50
+ host: str = DEFAULT_HOST,
51
+ credentials: Optional[ga_credentials.Credentials] = None,
52
+ credentials_file: Optional[str] = None,
53
+ scopes: Optional[Sequence[str]] = None,
54
+ quota_project_id: Optional[str] = None,
55
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
56
+ always_use_jwt_access: Optional[bool] = False,
57
+ api_audience: Optional[str] = None,
58
+ **kwargs,
59
+ ) -> None:
60
+ """Instantiate the transport.
61
+
62
+ Args:
63
+ host (Optional[str]):
64
+ The hostname to connect to (default: 'maintenance.googleapis.com').
65
+ credentials (Optional[google.auth.credentials.Credentials]): The
66
+ authorization credentials to attach to requests. These
67
+ credentials identify the application to the service; if none
68
+ are specified, the client will attempt to ascertain the
69
+ credentials from the environment.
70
+ credentials_file (Optional[str]): A file with credentials that can
71
+ be loaded with :func:`google.auth.load_credentials_from_file`.
72
+ This argument is mutually exclusive with credentials.
73
+ scopes (Optional[Sequence[str]]): A list of scopes.
74
+ quota_project_id (Optional[str]): An optional project to use for billing
75
+ and quota.
76
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
77
+ The client info used to send a user-agent string along with
78
+ API requests. If ``None``, then default info will be used.
79
+ Generally, you only need to set this if you're developing
80
+ your own client library.
81
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
82
+ be used for service account credentials.
83
+ """
84
+
85
+ scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
86
+
87
+ # Save the scopes.
88
+ self._scopes = scopes
89
+ if not hasattr(self, "_ignore_credentials"):
90
+ self._ignore_credentials: bool = False
91
+
92
+ # If no credentials are provided, then determine the appropriate
93
+ # defaults.
94
+ if credentials and credentials_file:
95
+ raise core_exceptions.DuplicateCredentialArgs(
96
+ "'credentials_file' and 'credentials' are mutually exclusive"
97
+ )
98
+
99
+ if credentials_file is not None:
100
+ credentials, _ = google.auth.load_credentials_from_file(
101
+ credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
102
+ )
103
+ elif credentials is None and not self._ignore_credentials:
104
+ credentials, _ = google.auth.default(
105
+ **scopes_kwargs, quota_project_id=quota_project_id
106
+ )
107
+ # Don't apply audience if the credentials file passed from user.
108
+ if hasattr(credentials, "with_gdch_audience"):
109
+ credentials = credentials.with_gdch_audience(
110
+ api_audience if api_audience else host
111
+ )
112
+
113
+ # If the credentials are service account credentials, then always try to use self signed JWT.
114
+ if (
115
+ always_use_jwt_access
116
+ and isinstance(credentials, service_account.Credentials)
117
+ and hasattr(service_account.Credentials, "with_always_use_jwt_access")
118
+ ):
119
+ credentials = credentials.with_always_use_jwt_access(True)
120
+
121
+ # Save the credentials.
122
+ self._credentials = credentials
123
+
124
+ # Save the hostname. Default to port 443 (HTTPS) if none is specified.
125
+ if ":" not in host:
126
+ host += ":443"
127
+ self._host = host
128
+
129
+ @property
130
+ def host(self):
131
+ return self._host
132
+
133
+ def _prep_wrapped_messages(self, client_info):
134
+ # Precompute the wrapped methods.
135
+ self._wrapped_methods = {
136
+ self.summarize_maintenances: gapic_v1.method.wrap_method(
137
+ self.summarize_maintenances,
138
+ default_timeout=None,
139
+ client_info=client_info,
140
+ ),
141
+ self.list_resource_maintenances: gapic_v1.method.wrap_method(
142
+ self.list_resource_maintenances,
143
+ default_timeout=None,
144
+ client_info=client_info,
145
+ ),
146
+ self.get_resource_maintenance: gapic_v1.method.wrap_method(
147
+ self.get_resource_maintenance,
148
+ default_timeout=None,
149
+ client_info=client_info,
150
+ ),
151
+ self.get_location: gapic_v1.method.wrap_method(
152
+ self.get_location,
153
+ default_timeout=None,
154
+ client_info=client_info,
155
+ ),
156
+ self.list_locations: gapic_v1.method.wrap_method(
157
+ self.list_locations,
158
+ default_timeout=None,
159
+ client_info=client_info,
160
+ ),
161
+ }
162
+
163
+ def close(self):
164
+ """Closes resources associated with the transport.
165
+
166
+ .. warning::
167
+ Only call this method if the transport is NOT shared
168
+ with other clients - this may cause errors in other clients!
169
+ """
170
+ raise NotImplementedError()
171
+
172
+ @property
173
+ def summarize_maintenances(
174
+ self,
175
+ ) -> Callable[
176
+ [maintenance_service.SummarizeMaintenancesRequest],
177
+ Union[
178
+ maintenance_service.SummarizeMaintenancesResponse,
179
+ Awaitable[maintenance_service.SummarizeMaintenancesResponse],
180
+ ],
181
+ ]:
182
+ raise NotImplementedError()
183
+
184
+ @property
185
+ def list_resource_maintenances(
186
+ self,
187
+ ) -> Callable[
188
+ [maintenance_service.ListResourceMaintenancesRequest],
189
+ Union[
190
+ maintenance_service.ListResourceMaintenancesResponse,
191
+ Awaitable[maintenance_service.ListResourceMaintenancesResponse],
192
+ ],
193
+ ]:
194
+ raise NotImplementedError()
195
+
196
+ @property
197
+ def get_resource_maintenance(
198
+ self,
199
+ ) -> Callable[
200
+ [maintenance_service.GetResourceMaintenanceRequest],
201
+ Union[
202
+ maintenance_service.ResourceMaintenance,
203
+ Awaitable[maintenance_service.ResourceMaintenance],
204
+ ],
205
+ ]:
206
+ raise NotImplementedError()
207
+
208
+ @property
209
+ def get_location(
210
+ self,
211
+ ) -> Callable[
212
+ [locations_pb2.GetLocationRequest],
213
+ Union[locations_pb2.Location, Awaitable[locations_pb2.Location]],
214
+ ]:
215
+ raise NotImplementedError()
216
+
217
+ @property
218
+ def list_locations(
219
+ self,
220
+ ) -> Callable[
221
+ [locations_pb2.ListLocationsRequest],
222
+ Union[
223
+ locations_pb2.ListLocationsResponse,
224
+ Awaitable[locations_pb2.ListLocationsResponse],
225
+ ],
226
+ ]:
227
+ raise NotImplementedError()
228
+
229
+ @property
230
+ def kind(self) -> str:
231
+ raise NotImplementedError()
232
+
233
+
234
+ __all__ = ("MaintenanceTransport",)