Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

feat!: convert resource names to multipattern resource names #99

Merged
merged 4 commits into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
<className>com/google/cloud/securitycenter/v1/*OrBuilder</className>
<method>boolean has*(*)</method>
</difference>

<!-- TODO: remove after 0.121.0 -->
<difference>
<differenceType>5001</differenceType>
<className>com/google/cloud/securitycenter/v1/*Name</className>
<to>com/google/cloud/securitycenter/v1/*Name</to>
<differenceType>7002</differenceType>
<className>com/google/cloud/securitycenter/v1/SecurityMarksName</className>
<method>java.util.List parse(java.util.List)</method>
</difference>
<difference>
<differenceType>8001</differenceType>
<className>com/google/cloud/securitycenter/v1/*Name*</className>
<differenceType>7002</differenceType>
<className>com/google/cloud/securitycenter/v1/SecurityMarksName</className>
<method>java.util.List toStrings(java.util.List)</method>
</difference>
</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import com.google.api.resourcenames.ResourceName;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;

Expand Down Expand Up @@ -152,28 +150,6 @@ public static SecurityMarksName parse(String formattedString) {
throw new ValidationException("JobName.parse: formattedString not in valid format");
}

@BetaApi("The method will be renamed to parseList after subclasses of this class are removed.")
public static List<SecurityMarksName> parse(List<String> formattedStrings) {
List<SecurityMarksName> list = new ArrayList<>(formattedStrings.size());
for (String formattedString : formattedStrings) {
list.add(parse(formattedString));
}
return list;
}

@BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.")
public static List<String> toStrings(List<SecurityMarksName> values) {
List<String> list = new ArrayList<>(values.size());
for (SecurityMarksName value : values) {
if (value == null) {
list.add("");
} else {
list.add(value.toString());
}
}
return list;
}

public static boolean isParsableFrom(String formattedString) {
return ORGANIZATION_ASSET_PATH_TEMPLATE.matches(formattedString)
|| ORGANIZATION_SOURCE_FINDING_PATH_TEMPLATE.matches(formattedString);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<difference>
<differenceType>7012</differenceType>
<className>com/google/cloud/securitycenter/v1p1beta1/*OrBuilder</className>
<method>* get*(*)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/cloud/securitycenter/v1p1beta1/*OrBuilder</className>
<method>boolean contains*(*)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/cloud/securitycenter/v1p1beta1/*OrBuilder</className>
<method>boolean has*(*)</method>
</difference>

<!-- TODO: remove after 0.121.0 -->
<difference>
<differenceType>7002</differenceType>
<className>com/google/cloud/securitycenter/v1p1beta1/SecurityMarksName</className>
<method>*</method>
</difference>
<difference>
<differenceType>8001</differenceType>
<className>com/google/cloud/securitycenter/v1p1beta1/SecurityMarksNames</className>
</difference>
<difference>
<differenceType>8001</differenceType>
<className>com/google/cloud/securitycenter/v1p1beta1/UntypedSecurityMarksName</className>
</difference>
</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,15 @@ public static SecurityMarksName parse(String formattedString) {
throw new ValidationException("JobName.parse: formattedString not in valid format");
}

@BetaApi("The method will be renamed to parseList after subclasses of this class are removed.")
public static List<SecurityMarksName> parse(List<String> formattedStrings) {
public static List<SecurityMarksName> parseList(List<String> formattedStrings) {
List<SecurityMarksName> list = new ArrayList<>(formattedStrings.size());
for (String formattedString : formattedStrings) {
list.add(parse(formattedString));
}
return list;
}

@BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.")
public static List<String> toStrings(List<SecurityMarksName> values) {
public static List<String> toStringList(List<SecurityMarksName> values) {
List<String> list = new ArrayList<>(values.size());
for (SecurityMarksName value : values) {
if (value == null) {
Expand Down

This file was deleted.

This file was deleted.

19 changes: 9 additions & 10 deletions synth.metadata
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
{
"updateTime": "2020-03-25T18:31:45.271331Z",
"updateTime": "2020-03-26T22:41:16.428212Z",
"sources": [
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "fd83ab212176a1042e8d45ea90766b3bf59ac679",
"internalRef": "302913609"
"sha": "8bea81bfa461698981b3d3a488a95633d2f6e9ff",
"internalRef": "303197602"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "fd83ab212176a1042e8d45ea90766b3bf59ac679",
"internalRef": "302913609"
"sha": "8bea81bfa461698981b3d3a488a95633d2f6e9ff",
"internalRef": "303197602"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "fd83ab212176a1042e8d45ea90766b3bf59ac679",
"internalRef": "302913609",
"log": "fd83ab212176a1042e8d45ea90766b3bf59ac679\nfix: migrate osconfig/agentendpoint/v1 go_gapic_library target to microgen impl\n\nPiperOrigin-RevId: 302913609\n\n0e07113e776bdd8fcc0783372e08bb6e76cb1b5b\ndocs: Update documentation with links to smart home developer guides and reference pages. Remove outdated authorization instructions.\n\nPiperOrigin-RevId: 302892245\n\n"
"sha": "8bea81bfa461698981b3d3a488a95633d2f6e9ff",
"internalRef": "303197602",
"log": "8bea81bfa461698981b3d3a488a95633d2f6e9ff\nchore: use latest protoc-java-resource-name-plugin in bazel WORKSPACE.\nnew commits:\n- fix: stop generating `parseList` and `toStringList` if a multi-pattern resource name has subclasses (#79)\n\ncommitter: @hzyi-google\nPiperOrigin-RevId: 303197602\n\nb14af92e565264675d6b12cd2c0ded6c94ddd7f8\nfix talent API incorrect placeholders in two resource name patterns.\ncommitter: @hzyi-google\n\nPiperOrigin-RevId: 303189497\n\n8e22db908ae09e1f7e2802c03b4563fd6b524e0e\nchore(google/maps): Update postprocessing script for Java.\n\n- Update root build.gradle to load local plugin\n- Change com.google.api.grpc group to com.google.maps\n\nPiperOrigin-RevId: 303176850\n\n65816afa71e588252b7119dc723592abe51ea106\nbazel: update gapic-generator-go to v0.12.5 and gapic-generator hash\n\nChanges to gapic-generator-go include:\n* feat: strip invalid link references in comments\n* chore: updating Go deps in bazel repositories\n\nChanges to gapic-generator include:\n* fix: bazel go build gen check for cloud in proto pkg name\n* Revert \"feat: allow static substitution for group name\"\n\nPiperOrigin-RevId: 303150338\n\nd4aa417ed2bba89c2d216900282bddfdafef6128\nFix incorrect retry config in gapic v2 for kms.\n\nPiperOrigin-RevId: 303010132\n\nfd08334533204fdd1b33f79fcb263dbb5bf13de0\nfix: osconfig/v1 update go_gapic_library target to microgen interface\n\nPiperOrigin-RevId: 303007866\n\ne2c0f2a0e06d86b50aba98f67f9f291587d986b3\nUpdate comments for google/rpc/error_details.proto.\n\nPiperOrigin-RevId: 303002528\n\nf786c7586748e78a286b1620ff3ddbf7b4dcab92\nfeat: Add OsConfigService v1 patch APIs.\n\nPiperOrigin-RevId: 302999346\n\n0341fa3fc2f4073a1b1f260d37b2ce620799f545\nTurn on gapic config v2 for kms.\n\nCommitter: @hzyi-google\nPiperOrigin-RevId: 302980301\n\n32dc6e832039b61ac3fb82c72eb0a27570aebcd6\nredis: v1beta1 enables REDIS_5_0 as an option for redis_version field and adds two new redis configs --stream-node-max-entries --stream-node-max-bytes\n\nPiperOrigin-RevId: 302958009\n\n685f16483cc4d87c35051f21f8f13ef4fdc919b4\nredis: v1 enables REDIS_5_0 as an option for redis_version field and adds two new redis configs --stream-node-max-entries --stream-node-max-bytes\n\nPiperOrigin-RevId: 302957729\n\n733cb282ae5e64673ef86c9a5dff647df803d8b7\nAdd GAPIC cofiguration for v1 client library genetration.\n\nPiperOrigin-RevId: 302928200\n\n1b0fff5f2ec6dc4a9443d9b50e70e9c94c30c45b\ndocs: remove an internal lint declaration\n\nPiperOrigin-RevId: 302928106\n\n2be23f3f3036a6f7ce0844def3d2d3da74e5d415\nfix(google/maps): Add post-processing rules for Google Maps APIs\n\nPiperOrigin-RevId: 302925222\n\n"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "e36822bfa0acb355502dab391b8ef9c4f30208d8",
"log": "e36822bfa0acb355502dab391b8ef9c4f30208d8\nchore(java): treat samples shared configuration dependency update as chore (#457)\n\n\n1b4cc80a7aaf164f6241937dd87f3bd1f4149e0c\nfix: do not run node 8 CI (#456)\n\n\n"
"sha": "e36822bfa0acb355502dab391b8ef9c4f30208d8"
}
}
],
Expand Down