각 서비스에는 각 REST 메서드의 동기식 메서드와 비동기식 메서드가 모두 있는 ServiceClient 객체가 있습니다. 다음 예는 Network를 읽습니다.
있습니다.
fromgoogle.adsimportadmanager_v1defsample_get_network():# Create a clientclient=admanager_v1.NetworkServiceClient()# Initialize request argument(s)request=admanager_v1.GetNetworkRequest(name="networks/[NETWORK_CODE]",)# Make the requestresponse=client.get_network(request=request)# Handle the responseprint(response)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-13(UTC)"],[[["Google provides a Python client library, `google-ads-admanager`, for seamless interactions with the Ad Manager API, installable via pip."],["The client library utilizes Application Default Credentials (ADC) for authentication, prioritizing environment variables, gcloud CLI, and Google Cloud resource service accounts."],["Developers can make requests to various Ad Manager services using synchronous or asynchronous methods provided by service-specific client objects."],["Error handling is facilitated through the `GoogleAPIError` base class and its `reason` field, enabling developers to identify and manage issues effectively."],["Proxy settings can be configured using the `http_proxy` and `https_proxy` environment variables, allowing customization of network communication."]]],["The content outlines using Google's Python client library for the Ad Manager API. Key actions include installing the `google-ads-admanager` library via PyPI and configuring credentials using OAuth2 and Application Default Credentials (ADC), with environment variables, the Google Cloud CLI, or service accounts. A request is made to read a network, demonstrating synchronous method usage. Error handling is shown using `GoogleAPIError` to get `requestId` and using `e.reason`. It details configuring the proxy settings for the library via `http_proxy` and `https_proxy`.\n"]]