Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit 8b30dcd

Browse files
feat: add kind field which is used to distinguish between response types feat: add potentially_thresholded_requests_per_hour field to PropertyQuota (#182)
PiperOrigin-RevId: 365882072 Source-Link: googleapis/googleapis@95dd249 Source-Author: Bazel Bot <bazel-bot-development[bot]@users.noreply.github.com> Source-Date: Tue Mar 30 21:37:42 2021 +0000 Source-Repo: googleapis/googleapis-gen Source-Sha: a21f1091413a260393548c1b2ac44b7347923f08 Source-Link: googleapis/googleapis-gen@a21f109 Co-authored-by: Neenu Shaji <Neenu1995@users.noreply.github.com>
1 parent 1802925 commit 8b30dcd

20 files changed

Lines changed: 1692 additions & 142 deletions

google-analytics-data/src/test/java/com/google/analytics/data/v1beta/BetaAnalyticsDataClientTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public void runReportTest() throws Exception {
8989
.setRowCount(1340416618)
9090
.setMetadata(ResponseMetaData.newBuilder().build())
9191
.setPropertyQuota(PropertyQuota.newBuilder().build())
92+
.setKind("kind3292052")
9293
.build();
9394
mockBetaAnalyticsData.addResponse(expectedResponse);
9495

@@ -179,6 +180,7 @@ public void runPivotReportTest() throws Exception {
179180
.addAllAggregates(new ArrayList<Row>())
180181
.setMetadata(ResponseMetaData.newBuilder().build())
181182
.setPropertyQuota(PropertyQuota.newBuilder().build())
183+
.setKind("kind3292052")
182184
.build();
183185
mockBetaAnalyticsData.addResponse(expectedResponse);
184186

@@ -253,6 +255,7 @@ public void batchRunReportsTest() throws Exception {
253255
BatchRunReportsResponse expectedResponse =
254256
BatchRunReportsResponse.newBuilder()
255257
.addAllReports(new ArrayList<RunReportResponse>())
258+
.setKind("kind3292052")
256259
.build();
257260
mockBetaAnalyticsData.addResponse(expectedResponse);
258261

@@ -300,6 +303,7 @@ public void batchRunPivotReportsTest() throws Exception {
300303
BatchRunPivotReportsResponse expectedResponse =
301304
BatchRunPivotReportsResponse.newBuilder()
302305
.addAllPivotReports(new ArrayList<RunPivotReportResponse>())
306+
.setKind("kind3292052")
303307
.build();
304308
mockBetaAnalyticsData.addResponse(expectedResponse);
305309

@@ -435,6 +439,7 @@ public void runRealtimeReportTest() throws Exception {
435439
.addAllMinimums(new ArrayList<Row>())
436440
.setRowCount(1340416618)
437441
.setPropertyQuota(PropertyQuota.newBuilder().build())
442+
.setKind("kind3292052")
438443
.build();
439444
mockBetaAnalyticsData.addResponse(expectedResponse);
440445

proto-google-analytics-data-v1beta/src/main/java/com/google/analytics/data/v1beta/AnalyticsDataApiProto.java

Lines changed: 106 additions & 102 deletions
Large diffs are not rendered by default.

proto-google-analytics-data-v1beta/src/main/java/com/google/analytics/data/v1beta/BatchRunPivotReportsResponse.java

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private BatchRunPivotReportsResponse(com.google.protobuf.GeneratedMessageV3.Buil
3939

4040
private BatchRunPivotReportsResponse() {
4141
pivotReports_ = java.util.Collections.emptyList();
42+
kind_ = "";
4243
}
4344

4445
@java.lang.Override
@@ -85,6 +86,13 @@ private BatchRunPivotReportsResponse(
8586
extensionRegistry));
8687
break;
8788
}
89+
case 18:
90+
{
91+
java.lang.String s = input.readStringRequireUtf8();
92+
93+
kind_ = s;
94+
break;
95+
}
8896
default:
8997
{
9098
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -193,6 +201,59 @@ public com.google.analytics.data.v1beta.RunPivotReportResponseOrBuilder getPivot
193201
return pivotReports_.get(index);
194202
}
195203

204+
public static final int KIND_FIELD_NUMBER = 2;
205+
private volatile java.lang.Object kind_;
206+
/**
207+
*
208+
*
209+
* <pre>
210+
* Identifies what kind of resource this message is. This `kind` is always the
211+
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
212+
* between response types in JSON.
213+
* </pre>
214+
*
215+
* <code>string kind = 2;</code>
216+
*
217+
* @return The kind.
218+
*/
219+
@java.lang.Override
220+
public java.lang.String getKind() {
221+
java.lang.Object ref = kind_;
222+
if (ref instanceof java.lang.String) {
223+
return (java.lang.String) ref;
224+
} else {
225+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
226+
java.lang.String s = bs.toStringUtf8();
227+
kind_ = s;
228+
return s;
229+
}
230+
}
231+
/**
232+
*
233+
*
234+
* <pre>
235+
* Identifies what kind of resource this message is. This `kind` is always the
236+
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
237+
* between response types in JSON.
238+
* </pre>
239+
*
240+
* <code>string kind = 2;</code>
241+
*
242+
* @return The bytes for kind.
243+
*/
244+
@java.lang.Override
245+
public com.google.protobuf.ByteString getKindBytes() {
246+
java.lang.Object ref = kind_;
247+
if (ref instanceof java.lang.String) {
248+
com.google.protobuf.ByteString b =
249+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
250+
kind_ = b;
251+
return b;
252+
} else {
253+
return (com.google.protobuf.ByteString) ref;
254+
}
255+
}
256+
196257
private byte memoizedIsInitialized = -1;
197258

198259
@java.lang.Override
@@ -210,6 +271,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
210271
for (int i = 0; i < pivotReports_.size(); i++) {
211272
output.writeMessage(1, pivotReports_.get(i));
212273
}
274+
if (!getKindBytes().isEmpty()) {
275+
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kind_);
276+
}
213277
unknownFields.writeTo(output);
214278
}
215279

@@ -222,6 +286,9 @@ public int getSerializedSize() {
222286
for (int i = 0; i < pivotReports_.size(); i++) {
223287
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, pivotReports_.get(i));
224288
}
289+
if (!getKindBytes().isEmpty()) {
290+
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kind_);
291+
}
225292
size += unknownFields.getSerializedSize();
226293
memoizedSize = size;
227294
return size;
@@ -239,6 +306,7 @@ public boolean equals(final java.lang.Object obj) {
239306
(com.google.analytics.data.v1beta.BatchRunPivotReportsResponse) obj;
240307

241308
if (!getPivotReportsList().equals(other.getPivotReportsList())) return false;
309+
if (!getKind().equals(other.getKind())) return false;
242310
if (!unknownFields.equals(other.unknownFields)) return false;
243311
return true;
244312
}
@@ -254,6 +322,8 @@ public int hashCode() {
254322
hash = (37 * hash) + PIVOT_REPORTS_FIELD_NUMBER;
255323
hash = (53 * hash) + getPivotReportsList().hashCode();
256324
}
325+
hash = (37 * hash) + KIND_FIELD_NUMBER;
326+
hash = (53 * hash) + getKind().hashCode();
257327
hash = (29 * hash) + unknownFields.hashCode();
258328
memoizedHashCode = hash;
259329
return hash;
@@ -408,6 +478,8 @@ public Builder clear() {
408478
} else {
409479
pivotReportsBuilder_.clear();
410480
}
481+
kind_ = "";
482+
411483
return this;
412484
}
413485

@@ -446,6 +518,7 @@ public com.google.analytics.data.v1beta.BatchRunPivotReportsResponse buildPartia
446518
} else {
447519
result.pivotReports_ = pivotReportsBuilder_.build();
448520
}
521+
result.kind_ = kind_;
449522
onBuilt();
450523
return result;
451524
}
@@ -524,6 +597,10 @@ public Builder mergeFrom(com.google.analytics.data.v1beta.BatchRunPivotReportsRe
524597
}
525598
}
526599
}
600+
if (!other.getKind().isEmpty()) {
601+
kind_ = other.kind_;
602+
onChanged();
603+
}
527604
this.mergeUnknownFields(other.unknownFields);
528605
onChanged();
529606
return this;
@@ -921,6 +998,122 @@ public com.google.analytics.data.v1beta.RunPivotReportResponse.Builder addPivotR
921998
return pivotReportsBuilder_;
922999
}
9231000

1001+
private java.lang.Object kind_ = "";
1002+
/**
1003+
*
1004+
*
1005+
* <pre>
1006+
* Identifies what kind of resource this message is. This `kind` is always the
1007+
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
1008+
* between response types in JSON.
1009+
* </pre>
1010+
*
1011+
* <code>string kind = 2;</code>
1012+
*
1013+
* @return The kind.
1014+
*/
1015+
public java.lang.String getKind() {
1016+
java.lang.Object ref = kind_;
1017+
if (!(ref instanceof java.lang.String)) {
1018+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1019+
java.lang.String s = bs.toStringUtf8();
1020+
kind_ = s;
1021+
return s;
1022+
} else {
1023+
return (java.lang.String) ref;
1024+
}
1025+
}
1026+
/**
1027+
*
1028+
*
1029+
* <pre>
1030+
* Identifies what kind of resource this message is. This `kind` is always the
1031+
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
1032+
* between response types in JSON.
1033+
* </pre>
1034+
*
1035+
* <code>string kind = 2;</code>
1036+
*
1037+
* @return The bytes for kind.
1038+
*/
1039+
public com.google.protobuf.ByteString getKindBytes() {
1040+
java.lang.Object ref = kind_;
1041+
if (ref instanceof String) {
1042+
com.google.protobuf.ByteString b =
1043+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1044+
kind_ = b;
1045+
return b;
1046+
} else {
1047+
return (com.google.protobuf.ByteString) ref;
1048+
}
1049+
}
1050+
/**
1051+
*
1052+
*
1053+
* <pre>
1054+
* Identifies what kind of resource this message is. This `kind` is always the
1055+
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
1056+
* between response types in JSON.
1057+
* </pre>
1058+
*
1059+
* <code>string kind = 2;</code>
1060+
*
1061+
* @param value The kind to set.
1062+
* @return This builder for chaining.
1063+
*/
1064+
public Builder setKind(java.lang.String value) {
1065+
if (value == null) {
1066+
throw new NullPointerException();
1067+
}
1068+
1069+
kind_ = value;
1070+
onChanged();
1071+
return this;
1072+
}
1073+
/**
1074+
*
1075+
*
1076+
* <pre>
1077+
* Identifies what kind of resource this message is. This `kind` is always the
1078+
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
1079+
* between response types in JSON.
1080+
* </pre>
1081+
*
1082+
* <code>string kind = 2;</code>
1083+
*
1084+
* @return This builder for chaining.
1085+
*/
1086+
public Builder clearKind() {
1087+
1088+
kind_ = getDefaultInstance().getKind();
1089+
onChanged();
1090+
return this;
1091+
}
1092+
/**
1093+
*
1094+
*
1095+
* <pre>
1096+
* Identifies what kind of resource this message is. This `kind` is always the
1097+
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
1098+
* between response types in JSON.
1099+
* </pre>
1100+
*
1101+
* <code>string kind = 2;</code>
1102+
*
1103+
* @param value The bytes for kind to set.
1104+
* @return This builder for chaining.
1105+
*/
1106+
public Builder setKindBytes(com.google.protobuf.ByteString value) {
1107+
if (value == null) {
1108+
throw new NullPointerException();
1109+
}
1110+
checkByteStringIsUtf8(value);
1111+
1112+
kind_ = value;
1113+
onChanged();
1114+
return this;
1115+
}
1116+
9241117
@java.lang.Override
9251118
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
9261119
return super.setUnknownFields(unknownFields);

proto-google-analytics-data-v1beta/src/main/java/com/google/analytics/data/v1beta/BatchRunPivotReportsResponseOrBuilder.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,33 @@ public interface BatchRunPivotReportsResponseOrBuilder
7575
*/
7676
com.google.analytics.data.v1beta.RunPivotReportResponseOrBuilder getPivotReportsOrBuilder(
7777
int index);
78+
79+
/**
80+
*
81+
*
82+
* <pre>
83+
* Identifies what kind of resource this message is. This `kind` is always the
84+
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
85+
* between response types in JSON.
86+
* </pre>
87+
*
88+
* <code>string kind = 2;</code>
89+
*
90+
* @return The kind.
91+
*/
92+
java.lang.String getKind();
93+
/**
94+
*
95+
*
96+
* <pre>
97+
* Identifies what kind of resource this message is. This `kind` is always the
98+
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
99+
* between response types in JSON.
100+
* </pre>
101+
*
102+
* <code>string kind = 2;</code>
103+
*
104+
* @return The bytes for kind.
105+
*/
106+
com.google.protobuf.ByteString getKindBytes();
78107
}

0 commit comments

Comments
 (0)