Skip to content

Commit 19ed3be

Browse files
feat: [Many APIs] Add support for opt-in debug logging (#13343)
BEGIN_COMMIT_OVERRIDE feat: Add support for opt-in debug logging fix: Fix typing issue with gRPC metadata when key ends in -bin chore: Update gapic-generator-python to v1.21.0 END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. fix: Fix typing issue with gRPC metadata when key ends in -bin chore: Update gapic-generator-python to v1.21.0 PiperOrigin-RevId: 705285820 Source-Link: googleapis/googleapis@f9b8b91 Source-Link: googleapis/googleapis-gen@ca1e0a1 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNoYW5uZWwvLk93bEJvdC55YW1sIiwiaCI6ImNhMWUwYTFlNDcyZDZlNmY1ZGU4ODNhNWNiNTQ3MjRmMTEyY2UzNDgifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNsb3VkY29udHJvbHNwYXJ0bmVyLy5Pd2xCb3QueWFtbCIsImgiOiJjYTFlMGExZTQ3MmQ2ZTZmNWRlODgzYTVjYjU0NzI0ZjExMmNlMzQ4In0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbW1lcmNlLWNvbnN1bWVyLXByb2N1cmVtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiJjYTFlMGExZTQ3MmQ2ZTZmNWRlODgzYTVjYjU0NzI0ZjExMmNlMzQ4In0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbmZpZGVudGlhbGNvbXB1dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiY2ExZTBhMWU0NzJkNmU2ZjVkZTg4M2E1Y2I1NDcyNGYxMTJjZTM0OCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRhY3QtY2VudGVyLWluc2lnaHRzLy5Pd2xCb3QueWFtbCIsImgiOiJjYTFlMGExZTQ3MmQ2ZTZmNWRlODgzYTVjYj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== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRlcGxveS8uT3dsQm90LnlhbWwiLCJoIjoiY2ExZTBhMWU0NzJkNmU2ZjVkZTg4M2E1Y2I1NDcyNGYxMTJjZTM0OCJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 44761a8 commit 19ed3be

File tree

452 files changed

+68843
-14087
lines changed

Some content is hidden

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

452 files changed

+68843
-14087
lines changed

packages/google-cloud-channel/google/cloud/channel/gapic_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.20.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-channel/google/cloud/channel_v1/gapic_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.20.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-channel/google/cloud/channel_v1/services/cloud_channel_reports_service/async_client.py

+67-21
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515
#
1616
from collections import OrderedDict
17+
import logging as std_logging
1718
import re
1819
from typing import (
1920
Callable,
@@ -54,6 +55,15 @@
5455
from .transports.base import DEFAULT_CLIENT_INFO, CloudChannelReportsServiceTransport
5556
from .transports.grpc_asyncio import CloudChannelReportsServiceGrpcAsyncIOTransport
5657

58+
try:
59+
from google.api_core import client_logging # type: ignore
60+
61+
CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
62+
except ImportError: # pragma: NO COVER
63+
CLIENT_LOGGING_SUPPORTED = False
64+
65+
_LOGGER = std_logging.getLogger(__name__)
66+
5767

5868
class CloudChannelReportsServiceAsyncClient:
5969
"""CloudChannelReportsService lets Google Cloud resellers and
@@ -284,13 +294,35 @@ def __init__(
284294
client_info=client_info,
285295
)
286296

297+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
298+
std_logging.DEBUG
299+
): # pragma: NO COVER
300+
_LOGGER.debug(
301+
"Created client `google.cloud.channel_v1.CloudChannelReportsServiceAsyncClient`.",
302+
extra={
303+
"serviceName": "google.cloud.channel.v1.CloudChannelReportsService",
304+
"universeDomain": getattr(
305+
self._client._transport._credentials, "universe_domain", ""
306+
),
307+
"credentialsType": f"{type(self._client._transport._credentials).__module__}.{type(self._client._transport._credentials).__qualname__}",
308+
"credentialsInfo": getattr(
309+
self.transport._credentials, "get_cred_info", lambda: None
310+
)(),
311+
}
312+
if hasattr(self._client._transport, "_credentials")
313+
else {
314+
"serviceName": "google.cloud.channel.v1.CloudChannelReportsService",
315+
"credentialsType": None,
316+
},
317+
)
318+
287319
async def run_report_job(
288320
self,
289321
request: Optional[Union[reports_service.RunReportJobRequest, dict]] = None,
290322
*,
291323
retry: OptionalRetry = gapic_v1.method.DEFAULT,
292324
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
293-
metadata: Sequence[Tuple[str, str]] = (),
325+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
294326
) -> operation_async.AsyncOperation:
295327
r"""Begins generation of data for a given report. The report
296328
identifier is a UID (for example, ``613bf59q``).
@@ -360,8 +392,10 @@ async def sample_run_report_job():
360392
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
361393
should be retried.
362394
timeout (float): The timeout for this request.
363-
metadata (Sequence[Tuple[str, str]]): Strings which should be
364-
sent along with the request as metadata.
395+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
396+
sent along with the request as metadata. Normally, each value must be of type `str`,
397+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
398+
be of type `bytes`.
365399
366400
Returns:
367401
google.api_core.operation_async.AsyncOperation:
@@ -425,7 +459,7 @@ async def fetch_report_results(
425459
report_job: Optional[str] = None,
426460
retry: OptionalRetry = gapic_v1.method.DEFAULT,
427461
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
428-
metadata: Sequence[Tuple[str, str]] = (),
462+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
429463
) -> pagers.FetchReportResultsAsyncPager:
430464
r"""Retrieves data generated by
431465
[CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob].
@@ -477,8 +511,10 @@ async def sample_fetch_report_results():
477511
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
478512
should be retried.
479513
timeout (float): The timeout for this request.
480-
metadata (Sequence[Tuple[str, str]]): Strings which should be
481-
sent along with the request as metadata.
514+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
515+
sent along with the request as metadata. Normally, each value must be of type `str`,
516+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
517+
be of type `bytes`.
482518
483519
Returns:
484520
google.cloud.channel_v1.services.cloud_channel_reports_service.pagers.FetchReportResultsAsyncPager:
@@ -562,7 +598,7 @@ async def list_reports(
562598
parent: Optional[str] = None,
563599
retry: OptionalRetry = gapic_v1.method.DEFAULT,
564600
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
565-
metadata: Sequence[Tuple[str, str]] = (),
601+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
566602
) -> pagers.ListReportsAsyncPager:
567603
r"""Lists the reports that RunReportJob can run. These reports
568604
include an ID, a description, and the list of columns that will
@@ -614,8 +650,10 @@ async def sample_list_reports():
614650
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
615651
should be retried.
616652
timeout (float): The timeout for this request.
617-
metadata (Sequence[Tuple[str, str]]): Strings which should be
618-
sent along with the request as metadata.
653+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
654+
sent along with the request as metadata. Normally, each value must be of type `str`,
655+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
656+
be of type `bytes`.
619657
620658
Returns:
621659
google.cloud.channel_v1.services.cloud_channel_reports_service.pagers.ListReportsAsyncPager:
@@ -694,7 +732,7 @@ async def list_operations(
694732
*,
695733
retry: OptionalRetry = gapic_v1.method.DEFAULT,
696734
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
697-
metadata: Sequence[Tuple[str, str]] = (),
735+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
698736
) -> operations_pb2.ListOperationsResponse:
699737
r"""Lists operations that match the specified filter in the request.
700738
@@ -705,8 +743,10 @@ async def list_operations(
705743
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
706744
if any, should be retried.
707745
timeout (float): The timeout for this request.
708-
metadata (Sequence[Tuple[str, str]]): Strings which should be
709-
sent along with the request as metadata.
746+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
747+
sent along with the request as metadata. Normally, each value must be of type `str`,
748+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
749+
be of type `bytes`.
710750
Returns:
711751
~.operations_pb2.ListOperationsResponse:
712752
Response message for ``ListOperations`` method.
@@ -747,7 +787,7 @@ async def get_operation(
747787
*,
748788
retry: OptionalRetry = gapic_v1.method.DEFAULT,
749789
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
750-
metadata: Sequence[Tuple[str, str]] = (),
790+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
751791
) -> operations_pb2.Operation:
752792
r"""Gets the latest state of a long-running operation.
753793
@@ -758,8 +798,10 @@ async def get_operation(
758798
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
759799
if any, should be retried.
760800
timeout (float): The timeout for this request.
761-
metadata (Sequence[Tuple[str, str]]): Strings which should be
762-
sent along with the request as metadata.
801+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
802+
sent along with the request as metadata. Normally, each value must be of type `str`,
803+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
804+
be of type `bytes`.
763805
Returns:
764806
~.operations_pb2.Operation:
765807
An ``Operation`` object.
@@ -800,7 +842,7 @@ async def delete_operation(
800842
*,
801843
retry: OptionalRetry = gapic_v1.method.DEFAULT,
802844
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
803-
metadata: Sequence[Tuple[str, str]] = (),
845+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
804846
) -> None:
805847
r"""Deletes a long-running operation.
806848
@@ -816,8 +858,10 @@ async def delete_operation(
816858
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
817859
if any, should be retried.
818860
timeout (float): The timeout for this request.
819-
metadata (Sequence[Tuple[str, str]]): Strings which should be
820-
sent along with the request as metadata.
861+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
862+
sent along with the request as metadata. Normally, each value must be of type `str`,
863+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
864+
be of type `bytes`.
821865
Returns:
822866
None
823867
"""
@@ -854,7 +898,7 @@ async def cancel_operation(
854898
*,
855899
retry: OptionalRetry = gapic_v1.method.DEFAULT,
856900
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
857-
metadata: Sequence[Tuple[str, str]] = (),
901+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
858902
) -> None:
859903
r"""Starts asynchronous cancellation on a long-running operation.
860904
@@ -869,8 +913,10 @@ async def cancel_operation(
869913
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
870914
if any, should be retried.
871915
timeout (float): The timeout for this request.
872-
metadata (Sequence[Tuple[str, str]]): Strings which should be
873-
sent along with the request as metadata.
916+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
917+
sent along with the request as metadata. Normally, each value must be of type `str`,
918+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
919+
be of type `bytes`.
874920
Returns:
875921
None
876922
"""

0 commit comments

Comments
 (0)