chore: update googleapis commitish to 437254f - #13895
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces new service clients (CreativeSetServiceClient and SlateServiceClient) and adds batch methods (such as batchActivateContentBundles and batchUpdateTargetingPresets) to existing clients, alongside Javadoc documentation updates. A critical issue was identified across the newly added and modified client methods: parameters annotated with @Nullable are passed to protobuf builders via name == null ? null : name.toString(), which will throw a NullPointerException at runtime if null is passed. Since these clients are auto-generated, the generator or source metadata should be updated to resolve this pattern globally.
| * @param name Required. The resource name of the CreativeSet. Format: | ||
| * `networks/{network_code}/creativeSets/{creative_set_id}` | ||
| * @throws com.google.api.gax.rpc.ApiException if the remote call fails | ||
| */ | ||
| public final CreativeSet getCreativeSet(@Nullable CreativeSetName name) { |
There was a problem hiding this comment.
The parameter name is annotated with @Nullable, indicating it can be null. However, if null is passed, name == null ? null : name.toString() evaluates to null, and passing null to the protobuf builder's setName() method will throw a NullPointerException because protobuf string setters do not accept null values.
To prevent this, we should only call setName() if name is not null. Since this is an auto-generated file, please ensure the generator or source metadata is updated to address this pattern across all generated clients rather than editing this file manually.
| * @param name Required. The resource name of the CreativeSet. Format: | |
| * `networks/{network_code}/creativeSets/{creative_set_id}` | |
| * @throws com.google.api.gax.rpc.ApiException if the remote call fails | |
| */ | |
| public final CreativeSet getCreativeSet(@Nullable CreativeSetName name) { | |
| public final CreativeSet getCreativeSet(@Nullable CreativeSetName name) { | |
| GetCreativeSetRequest.Builder builder = GetCreativeSetRequest.newBuilder(); | |
| if (name != null) { | |
| builder.setName(name.toString()); | |
| } | |
| return getCreativeSet(builder.build()); | |
| } |
References
- Avoid manually editing auto-generated files because changes will be overwritten. Modify the generator or the source metadata instead.
| * | ||
| * @param name Required. The resource name of the Slate to retrieve. Format: | ||
| * `networks/{network_code}/slates/{slate_id}` | ||
| * @throws com.google.api.gax.rpc.ApiException if the remote call fails | ||
| */ |
There was a problem hiding this comment.
The parameter name is annotated with @Nullable, indicating it can be null. However, if null is passed, name == null ? null : name.toString() evaluates to null, and passing null to the protobuf builder's setName() method will throw a NullPointerException because protobuf string setters do not accept null values.
To prevent this, we should only call setName() if name is not null. Since this is an auto-generated file, please ensure the generator or source metadata is updated to address this pattern across all generated clients rather than editing this file manually.
| * | |
| * @param name Required. The resource name of the Slate to retrieve. Format: | |
| * `networks/{network_code}/slates/{slate_id}` | |
| * @throws com.google.api.gax.rpc.ApiException if the remote call fails | |
| */ | |
| public final Slate getSlate(@Nullable SlateName name) { | |
| GetSlateRequest.Builder builder = GetSlateRequest.newBuilder(); | |
| if (name != null) { | |
| builder.setName(name.toString()); | |
| } | |
| return getSlate(builder.build()); | |
| } |
References
- Avoid manually editing auto-generated files because changes will be overwritten. Modify the generator or the source metadata instead.
| public final BatchActivateContentBundlesResponse batchActivateContentBundles( | ||
| @Nullable NetworkName parent, List<String> names) { | ||
| BatchActivateContentBundlesRequest request = | ||
| BatchActivateContentBundlesRequest.newBuilder() | ||
| .setParent(parent == null ? null : parent.toString()) | ||
| .addAllNames(names) | ||
| .build(); | ||
| return batchActivateContentBundles(request); | ||
| } |
There was a problem hiding this comment.
The parameter parent is annotated with @Nullable, indicating it can be null. However, if null is passed, parent == null ? null : parent.toString() evaluates to null, and passing null to the protobuf builder's setParent() method will throw a NullPointerException because protobuf string setters do not accept null values.
To prevent this, we should only call setParent() if parent is not null. Since this is an auto-generated file, please ensure the generator or source metadata is updated to address this pattern across all generated clients rather than editing this file manually.
| public final BatchActivateContentBundlesResponse batchActivateContentBundles( | |
| @Nullable NetworkName parent, List<String> names) { | |
| BatchActivateContentBundlesRequest request = | |
| BatchActivateContentBundlesRequest.newBuilder() | |
| .setParent(parent == null ? null : parent.toString()) | |
| .addAllNames(names) | |
| .build(); | |
| return batchActivateContentBundles(request); | |
| } | |
| public final BatchActivateContentBundlesResponse batchActivateContentBundles( | |
| @Nullable NetworkName parent, List<String> names) { | |
| BatchActivateContentBundlesRequest.Builder builder = | |
| BatchActivateContentBundlesRequest.newBuilder(); | |
| if (parent != null) { | |
| builder.setParent(parent.toString()); | |
| } | |
| builder.addAllNames(names); | |
| return batchActivateContentBundles(builder.build()); | |
| } |
References
- Avoid manually editing auto-generated files because changes will be overwritten. Modify the generator or the source metadata instead.
| public final BatchUpdateTargetingPresetsResponse batchUpdateTargetingPresets( | ||
| @Nullable NetworkName parent, List<UpdateTargetingPresetRequest> requests) { | ||
| BatchUpdateTargetingPresetsRequest request = | ||
| BatchUpdateTargetingPresetsRequest.newBuilder() | ||
| .setParent(parent == null ? null : parent.toString()) | ||
| .addAllRequests(requests) | ||
| .build(); | ||
| return batchUpdateTargetingPresets(request); | ||
| } |
There was a problem hiding this comment.
The parameter parent is annotated with @Nullable, indicating it can be null. However, if null is passed, parent == null ? null : parent.toString() evaluates to null, and passing null to the protobuf builder's setParent() method will throw a NullPointerException because protobuf string setters do not accept null values.
To prevent this, we should only call setParent() if parent is not null. Since this is an auto-generated file, please ensure the generator or source metadata is updated to address this pattern across all generated clients rather than editing this file manually.
| public final BatchUpdateTargetingPresetsResponse batchUpdateTargetingPresets( | |
| @Nullable NetworkName parent, List<UpdateTargetingPresetRequest> requests) { | |
| BatchUpdateTargetingPresetsRequest request = | |
| BatchUpdateTargetingPresetsRequest.newBuilder() | |
| .setParent(parent == null ? null : parent.toString()) | |
| .addAllRequests(requests) | |
| .build(); | |
| return batchUpdateTargetingPresets(request); | |
| } | |
| public final BatchUpdateTargetingPresetsResponse batchUpdateTargetingPresets( | |
| @Nullable NetworkName parent, List<UpdateTargetingPresetRequest> requests) { | |
| BatchUpdateTargetingPresetsRequest.Builder builder = | |
| BatchUpdateTargetingPresetsRequest.newBuilder(); | |
| if (parent != null) { | |
| builder.setParent(parent.toString()); | |
| } | |
| builder.addAllRequests(requests); | |
| return batchUpdateTargetingPresets(builder.build()); | |
| } |
References
- Avoid manually editing auto-generated files because changes will be overwritten. Modify the generator or the source metadata instead.
Updated googleapis commitish in librarian.yaml to googleapis/googleapis@437254f
💡 Note: If this PR is still open when the daily update workflow runs next, it will be closed and replaced with a new PR containing the latest updates.