Skip to content

Commit 8e917e9

Browse files
committed
Regenerate spi layer
Change ListLogEntries from projectIds to resourceIds Remove incorrect format and parse methods Minor format changes
1 parent 1a8a438 commit 8e917e9

25 files changed

Lines changed: 37 additions & 290 deletions

File tree

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceApi.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,13 @@ public class ErrorGroupServiceApi implements AutoCloseable {
9696
private static final PathTemplate GROUP_PATH_TEMPLATE =
9797
PathTemplate.createWithoutUrlEncoding("projects/{project}/groups/{group}");
9898

99-
private static final PathTemplate PROJECT_PATH_TEMPLATE =
100-
PathTemplate.createWithoutUrlEncoding("projects/{project}");
101-
10299
/** Formats a string containing the fully-qualified path to represent a group resource. */
103100
public static final String formatGroupName(String project, String group) {
104101
return GROUP_PATH_TEMPLATE.instantiate(
105102
"project", project,
106103
"group", group);
107104
}
108105

109-
/** Formats a string containing the fully-qualified path to represent a project resource. */
110-
public static final String formatProjectName(String project) {
111-
return PROJECT_PATH_TEMPLATE.instantiate("project", project);
112-
}
113-
114106
/** Parses the project from the given fully-qualified path which represents a group resource. */
115107
public static final String parseProjectFromGroupName(String groupName) {
116108
return GROUP_PATH_TEMPLATE.parse(groupName).get("project");
@@ -121,11 +113,6 @@ public static final String parseGroupFromGroupName(String groupName) {
121113
return GROUP_PATH_TEMPLATE.parse(groupName).get("group");
122114
}
123115

124-
/** Parses the project from the given fully-qualified path which represents a project resource. */
125-
public static final String parseProjectFromProjectName(String projectName) {
126-
return PROJECT_PATH_TEMPLATE.parse(projectName).get("project");
127-
}
128-
129116
/** Constructs an instance of ErrorGroupServiceApi with default settings. */
130117
public static final ErrorGroupServiceApi create() throws IOException {
131118
return create(ErrorGroupServiceSettings.defaultBuilder().build());
@@ -268,6 +255,7 @@ public final UnaryCallable<GetGroupRequest, ErrorGroup> getGroupCallable() {
268255
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
269256
*/
270257
public final ErrorGroup updateGroup(ErrorGroup group) {
258+
271259
UpdateGroupRequest request = UpdateGroupRequest.newBuilder().setGroup(group).build();
272260
return updateGroup(request);
273261
}

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceApi.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -105,34 +105,14 @@ public class ErrorStatsServiceApi implements AutoCloseable {
105105
private final UnaryCallable<ListEventsRequest, ListEventsPagedResponse> listEventsPagedCallable;
106106
private final UnaryCallable<DeleteEventsRequest, DeleteEventsResponse> deleteEventsCallable;
107107

108-
private static final PathTemplate GROUP_PATH_TEMPLATE =
109-
PathTemplate.createWithoutUrlEncoding("projects/{project}/groups/{group}");
110-
111108
private static final PathTemplate PROJECT_PATH_TEMPLATE =
112109
PathTemplate.createWithoutUrlEncoding("projects/{project}");
113110

114-
/** Formats a string containing the fully-qualified path to represent a group resource. */
115-
public static final String formatGroupName(String project, String group) {
116-
return GROUP_PATH_TEMPLATE.instantiate(
117-
"project", project,
118-
"group", group);
119-
}
120-
121111
/** Formats a string containing the fully-qualified path to represent a project resource. */
122112
public static final String formatProjectName(String project) {
123113
return PROJECT_PATH_TEMPLATE.instantiate("project", project);
124114
}
125115

126-
/** Parses the project from the given fully-qualified path which represents a group resource. */
127-
public static final String parseProjectFromGroupName(String groupName) {
128-
return GROUP_PATH_TEMPLATE.parse(groupName).get("project");
129-
}
130-
131-
/** Parses the group from the given fully-qualified path which represents a group resource. */
132-
public static final String parseGroupFromGroupName(String groupName) {
133-
return GROUP_PATH_TEMPLATE.parse(groupName).get("group");
134-
}
135-
136116
/** Parses the project from the given fully-qualified path which represents a project resource. */
137117
public static final String parseProjectFromProjectName(String projectName) {
138118
return PROJECT_PATH_TEMPLATE.parse(projectName).get("project");

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceApi.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -95,34 +95,14 @@ public class ReportErrorsServiceApi implements AutoCloseable {
9595
private final UnaryCallable<ReportErrorEventRequest, ReportErrorEventResponse>
9696
reportErrorEventCallable;
9797

98-
private static final PathTemplate GROUP_PATH_TEMPLATE =
99-
PathTemplate.createWithoutUrlEncoding("projects/{project}/groups/{group}");
100-
10198
private static final PathTemplate PROJECT_PATH_TEMPLATE =
10299
PathTemplate.createWithoutUrlEncoding("projects/{project}");
103100

104-
/** Formats a string containing the fully-qualified path to represent a group resource. */
105-
public static final String formatGroupName(String project, String group) {
106-
return GROUP_PATH_TEMPLATE.instantiate(
107-
"project", project,
108-
"group", group);
109-
}
110-
111101
/** Formats a string containing the fully-qualified path to represent a project resource. */
112102
public static final String formatProjectName(String project) {
113103
return PROJECT_PATH_TEMPLATE.instantiate("project", project);
114104
}
115105

116-
/** Parses the project from the given fully-qualified path which represents a group resource. */
117-
public static final String parseProjectFromGroupName(String groupName) {
118-
return GROUP_PATH_TEMPLATE.parse(groupName).get("project");
119-
}
120-
121-
/** Parses the group from the given fully-qualified path which represents a group resource. */
122-
public static final String parseGroupFromGroupName(String groupName) {
123-
return GROUP_PATH_TEMPLATE.parse(groupName).get("group");
124-
}
125-
126106
/** Parses the project from the given fully-qualified path which represents a project resource. */
127107
public static final String parseProjectFromProjectName(String projectName) {
128108
return PROJECT_PATH_TEMPLATE.parse(projectName).get("project");

google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public void addException(Exception exception) {
4343
serviceImpl.addException(exception);
4444
}
4545

46-
@Override
4746
public void setResponses(List<GeneratedMessageV3> responses) {
4847
serviceImpl.setResponses(responses);
4948
}

google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public void addException(Exception exception) {
4343
serviceImpl.addException(exception);
4444
}
4545

46-
@Override
4746
public void setResponses(List<GeneratedMessageV3> responses) {
4847
serviceImpl.setResponses(responses);
4948
}

google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public void addException(Exception exception) {
4343
serviceImpl.addException(exception);
4444
}
4545

46-
@Override
4746
public void setResponses(List<GeneratedMessageV3> responses) {
4847
serviceImpl.setResponses(responses);
4948
}

google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Api.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ public class ConfigServiceV2Api implements AutoCloseable {
111111
private static final PathTemplate SINK_PATH_TEMPLATE =
112112
PathTemplate.createWithoutUrlEncoding("projects/{project}/sinks/{sink}");
113113

114-
private static final PathTemplate METRIC_PATH_TEMPLATE =
115-
PathTemplate.createWithoutUrlEncoding("projects/{project}/metrics/{metric}");
116-
117-
private static final PathTemplate LOG_PATH_TEMPLATE =
118-
PathTemplate.createWithoutUrlEncoding("projects/{project}/logs/{log}");
119-
120114
/** Formats a string containing the fully-qualified path to represent a parent resource. */
121115
public static final String formatParentName(String project) {
122116
return PARENT_PATH_TEMPLATE.instantiate("project", project);
@@ -129,20 +123,6 @@ public static final String formatSinkName(String project, String sink) {
129123
"sink", sink);
130124
}
131125

132-
/** Formats a string containing the fully-qualified path to represent a metric resource. */
133-
public static final String formatMetricName(String project, String metric) {
134-
return METRIC_PATH_TEMPLATE.instantiate(
135-
"project", project,
136-
"metric", metric);
137-
}
138-
139-
/** Formats a string containing the fully-qualified path to represent a log resource. */
140-
public static final String formatLogName(String project, String log) {
141-
return LOG_PATH_TEMPLATE.instantiate(
142-
"project", project,
143-
"log", log);
144-
}
145-
146126
/** Parses the project from the given fully-qualified path which represents a parent resource. */
147127
public static final String parseProjectFromParentName(String parentName) {
148128
return PARENT_PATH_TEMPLATE.parse(parentName).get("project");
@@ -158,26 +138,6 @@ public static final String parseSinkFromSinkName(String sinkName) {
158138
return SINK_PATH_TEMPLATE.parse(sinkName).get("sink");
159139
}
160140

161-
/** Parses the project from the given fully-qualified path which represents a metric resource. */
162-
public static final String parseProjectFromMetricName(String metricName) {
163-
return METRIC_PATH_TEMPLATE.parse(metricName).get("project");
164-
}
165-
166-
/** Parses the metric from the given fully-qualified path which represents a metric resource. */
167-
public static final String parseMetricFromMetricName(String metricName) {
168-
return METRIC_PATH_TEMPLATE.parse(metricName).get("metric");
169-
}
170-
171-
/** Parses the project from the given fully-qualified path which represents a log resource. */
172-
public static final String parseProjectFromLogName(String logName) {
173-
return LOG_PATH_TEMPLATE.parse(logName).get("project");
174-
}
175-
176-
/** Parses the log from the given fully-qualified path which represents a log resource. */
177-
public static final String parseLogFromLogName(String logName) {
178-
return LOG_PATH_TEMPLATE.parse(logName).get("log");
179-
}
180-
181141
/** Constructs an instance of ConfigServiceV2Api with default settings. */
182142
public static final ConfigServiceV2Api create() throws IOException {
183143
return create(ConfigServiceV2Settings.defaultBuilder().build());

google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Api.java

Lines changed: 13 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,6 @@ public class LoggingServiceV2Api implements AutoCloseable {
117117
private static final PathTemplate PARENT_PATH_TEMPLATE =
118118
PathTemplate.createWithoutUrlEncoding("projects/{project}");
119119

120-
private static final PathTemplate SINK_PATH_TEMPLATE =
121-
PathTemplate.createWithoutUrlEncoding("projects/{project}/sinks/{sink}");
122-
123-
private static final PathTemplate METRIC_PATH_TEMPLATE =
124-
PathTemplate.createWithoutUrlEncoding("projects/{project}/metrics/{metric}");
125-
126120
private static final PathTemplate LOG_PATH_TEMPLATE =
127121
PathTemplate.createWithoutUrlEncoding("projects/{project}/logs/{log}");
128122

@@ -131,20 +125,6 @@ public static final String formatParentName(String project) {
131125
return PARENT_PATH_TEMPLATE.instantiate("project", project);
132126
}
133127

134-
/** Formats a string containing the fully-qualified path to represent a sink resource. */
135-
public static final String formatSinkName(String project, String sink) {
136-
return SINK_PATH_TEMPLATE.instantiate(
137-
"project", project,
138-
"sink", sink);
139-
}
140-
141-
/** Formats a string containing the fully-qualified path to represent a metric resource. */
142-
public static final String formatMetricName(String project, String metric) {
143-
return METRIC_PATH_TEMPLATE.instantiate(
144-
"project", project,
145-
"metric", metric);
146-
}
147-
148128
/** Formats a string containing the fully-qualified path to represent a log resource. */
149129
public static final String formatLogName(String project, String log) {
150130
return LOG_PATH_TEMPLATE.instantiate(
@@ -157,26 +137,6 @@ public static final String parseProjectFromParentName(String parentName) {
157137
return PARENT_PATH_TEMPLATE.parse(parentName).get("project");
158138
}
159139

160-
/** Parses the project from the given fully-qualified path which represents a sink resource. */
161-
public static final String parseProjectFromSinkName(String sinkName) {
162-
return SINK_PATH_TEMPLATE.parse(sinkName).get("project");
163-
}
164-
165-
/** Parses the sink from the given fully-qualified path which represents a sink resource. */
166-
public static final String parseSinkFromSinkName(String sinkName) {
167-
return SINK_PATH_TEMPLATE.parse(sinkName).get("sink");
168-
}
169-
170-
/** Parses the project from the given fully-qualified path which represents a metric resource. */
171-
public static final String parseProjectFromMetricName(String metricName) {
172-
return METRIC_PATH_TEMPLATE.parse(metricName).get("project");
173-
}
174-
175-
/** Parses the metric from the given fully-qualified path which represents a metric resource. */
176-
public static final String parseMetricFromMetricName(String metricName) {
177-
return METRIC_PATH_TEMPLATE.parse(metricName).get("metric");
178-
}
179-
180140
/** Parses the project from the given fully-qualified path which represents a log resource. */
181141
public static final String parseProjectFromLogName(String logName) {
182142
return LOG_PATH_TEMPLATE.parse(logName).get("project");
@@ -428,19 +388,18 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ
428388
*
429389
* <pre><code>
430390
* try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) {
431-
* List&lt;String&gt; projectIds = new ArrayList&lt;&gt;();
391+
* List&lt;String&gt; resourceNames = new ArrayList&lt;&gt;();
432392
* String filter = "";
433393
* String orderBy = "";
434-
* for (LogEntry element : loggingServiceV2Api.listLogEntries(projectIds, filter, orderBy).iterateAllElements()) {
394+
* for (LogEntry element : loggingServiceV2Api.listLogEntries(resourceNames, filter, orderBy).iterateAllElements()) {
435395
* // doThingsWith(element);
436396
* }
437397
* }
438398
* </code></pre>
439399
*
440-
* @param projectIds Deprecated. One or more project identifiers or project numbers from which to
441-
* retrieve log entries. Examples: `"my-project-1A"`, `"1234567890"`. If present, these
442-
* project identifiers are converted to resource format and added to the list of resources in
443-
* `resourceNames`. Callers should use `resourceNames` rather than this parameter.
400+
* @param resourceNames Optional. One or more cloud resources from which to retrieve log entries.
401+
* Example: `"projects/my-project-1A"`, `"projects/1234567890"`. Projects listed in
402+
* `projectIds` are added to this list.
444403
* @param filter Optional. A filter that chooses which log entries to return. See [Advanced Logs
445404
* Filters](/logging/docs/view/advanced_filters). Only log entries that match the filter are
446405
* returned. An empty filter matches all log entries.
@@ -452,10 +411,10 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ
452411
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
453412
*/
454413
public final ListLogEntriesPagedResponse listLogEntries(
455-
List<String> projectIds, String filter, String orderBy) {
414+
List<String> resourceNames, String filter, String orderBy) {
456415
ListLogEntriesRequest request =
457416
ListLogEntriesRequest.newBuilder()
458-
.addAllProjectIds(projectIds)
417+
.addAllResourceNames(resourceNames)
459418
.setFilter(filter)
460419
.setOrderBy(orderBy)
461420
.build();
@@ -471,9 +430,9 @@ public final ListLogEntriesPagedResponse listLogEntries(
471430
*
472431
* <pre><code>
473432
* try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) {
474-
* List&lt;String&gt; projectIds = new ArrayList&lt;&gt;();
433+
* List&lt;String&gt; resourceNames = new ArrayList&lt;&gt;();
475434
* ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
476-
* .addAllProjectIds(projectIds)
435+
* .addAllResourceNames(resourceNames)
477436
* .build();
478437
* for (LogEntry element : loggingServiceV2Api.listLogEntries(request).iterateAllElements()) {
479438
* // doThingsWith(element);
@@ -497,9 +456,9 @@ public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest re
497456
*
498457
* <pre><code>
499458
* try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) {
500-
* List&lt;String&gt; projectIds = new ArrayList&lt;&gt;();
459+
* List&lt;String&gt; resourceNames = new ArrayList&lt;&gt;();
501460
* ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
502-
* .addAllProjectIds(projectIds)
461+
* .addAllResourceNames(resourceNames)
503462
* .build();
504463
* ListenableFuture&lt;ListLogEntriesPagedResponse&gt; future = loggingServiceV2Api.listLogEntriesPagedCallable().futureCall(request);
505464
* // Do something
@@ -523,9 +482,9 @@ public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest re
523482
*
524483
* <pre><code>
525484
* try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) {
526-
* List&lt;String&gt; projectIds = new ArrayList&lt;&gt;();
485+
* List&lt;String&gt; resourceNames = new ArrayList&lt;&gt;();
527486
* ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
528-
* .addAllProjectIds(projectIds)
487+
* .addAllResourceNames(resourceNames)
529488
* .build();
530489
* while (true) {
531490
* ListLogEntriesResponse response = loggingServiceV2Api.listLogEntriesCallable().call(request);

0 commit comments

Comments
 (0)