feat: update API sources and regenerate#16998
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces several new services and client methods for the Google Ads Ad Manager API, including support for labels, linked devices, and batch operations for applications, CMS metadata keys, and labels. It also adds necessary transport and interceptor implementations for these new services. My review identified several issues in the sample code provided in the docstrings, where single objects were incorrectly assigned to repeated fields, and noted minor typos in docstring descriptions.
| requests = admanager_v1.CreateApplicationRequest() | ||
| requests.parent = "parent_value" | ||
|
|
||
| request = admanager_v1.BatchCreateApplicationsRequest( | ||
| parent="parent_value", | ||
| requests=requests, |
There was a problem hiding this comment.
The sample code incorrectly assigns a single CreateApplicationRequest object to the requests field, which is defined as a repeated field (list). This will cause a TypeError at runtime. It should be initialized as a list of requests.
| requests = admanager_v1.CreateApplicationRequest() | |
| requests.parent = "parent_value" | |
| request = admanager_v1.BatchCreateApplicationsRequest( | |
| parent="parent_value", | |
| requests=requests, | |
| requests = [ | |
| admanager_v1.CreateApplicationRequest(parent="parent_value")] | |
| request = admanager_v1.BatchCreateApplicationsRequest( | |
| parent="parent_value", | |
| requests=requests, |
| parent="parent_value", | ||
| ) |
There was a problem hiding this comment.
The sample code for batch_update_applications is missing the required requests argument in the BatchUpdateApplicationsRequest initialization.
| parent="parent_value", | |
| ) | |
| request = admanager_v1.BatchUpdateApplicationsRequest(parent="parent_value", | |
| requests=[admanager_v1.UpdateApplicationRequest()], |
| timeout: Union[float, object] = gapic_v1.method.DEFAULT, | ||
| metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), | ||
| ) -> application_service.BatchArchiveApplicationsResponse: | ||
| r"""/ API to batch archive ``Application`` objects. |
| timeout: Union[float, object] = gapic_v1.method.DEFAULT, | ||
| metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), | ||
| ) -> application_service.BatchUnarchiveApplicationsResponse: | ||
| r"""/ API to batch unarchive ``Application`` objects. |
| requests.parent = "parent_value" | ||
| requests.label.types = ['CREATIVE_WRAPPER'] | ||
|
|
||
| request = admanager_v1.BatchCreateLabelsRequest( | ||
| parent="parent_value", | ||
| requests=requests, | ||
| ) |
There was a problem hiding this comment.
The sample code incorrectly assigns a single CreateLabelRequest object to the requests field, which is a repeated field. This will result in a TypeError at runtime. It should be a list of requests.
| requests.parent = "parent_value" | |
| requests.label.types = ['CREATIVE_WRAPPER'] | |
| request = admanager_v1.BatchCreateLabelsRequest( | |
| parent="parent_value", | |
| requests=requests, | |
| ) | |
| requests = [admanager_v1.CreateLabelRequest( | |
| parent="parent_value", | |
| label=admanager_v1.Label(types=['CREATIVE_WRAPPER']))] | |
| request = admanager_v1.BatchCreateLabelsRequest( | |
| parent="parent_value", | |
| requests=requests, |
|
|
||
| # Initialize request argument(s) | ||
| requests = admanager_v1.UpdateLabelRequest() | ||
| requests.label.types = ['CREATIVE_WRAPPER'] | ||
|
|
||
| request = admanager_v1.BatchUpdateLabelsRequest( |
There was a problem hiding this comment.
The sample code incorrectly assigns a single UpdateLabelRequest object to the requests field, which is a repeated field. This will result in a TypeError at runtime. It should be a list of requests.
| # Initialize request argument(s) | |
| requests = admanager_v1.UpdateLabelRequest() | |
| requests.label.types = ['CREATIVE_WRAPPER'] | |
| request = admanager_v1.BatchUpdateLabelsRequest( | |
| requests = [admanager_v1.UpdateLabelRequest( | |
| label=admanager_v1.Label(types=['CREATIVE_WRAPPER']))] | |
| request = admanager_v1.BatchUpdateLabelsRequest( | |
| parent="parent_value", | |
| requests=requests, |
Proposal to further configure gemini assistance on the repo in the following ways: * disable `have_fun` to keep feedback concise * disable posting the help message, it's not particularly useful when we have public docs * run code review and include draft PRs * (the big one) attempt to limit the scope of review, excluding what I think would be GAPIC generate client libraries Context: Gemini posted comments to auto-generated code in #16998, which we will not address, and I'd like to reduce noise / save some compute.
Update googleapis to the latest commit and regenerate all client libraries.
Important: I disabled
warning as errorsfordocsingoogle-ads-admanagerdue to an "unexpected indentation" warning.