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

Commit

Permalink
feat: add kind field which is used to distinguish between response …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
yoshi-automation and Neenu1995 committed Jun 1, 2021
1 parent 1802925 commit 8b30dcd
Show file tree
Hide file tree
Showing 20 changed files with 1,692 additions and 142 deletions.
Expand Up @@ -89,6 +89,7 @@ public void runReportTest() throws Exception {
.setRowCount(1340416618)
.setMetadata(ResponseMetaData.newBuilder().build())
.setPropertyQuota(PropertyQuota.newBuilder().build())
.setKind("kind3292052")
.build();
mockBetaAnalyticsData.addResponse(expectedResponse);

Expand Down Expand Up @@ -179,6 +180,7 @@ public void runPivotReportTest() throws Exception {
.addAllAggregates(new ArrayList<Row>())
.setMetadata(ResponseMetaData.newBuilder().build())
.setPropertyQuota(PropertyQuota.newBuilder().build())
.setKind("kind3292052")
.build();
mockBetaAnalyticsData.addResponse(expectedResponse);

Expand Down Expand Up @@ -253,6 +255,7 @@ public void batchRunReportsTest() throws Exception {
BatchRunReportsResponse expectedResponse =
BatchRunReportsResponse.newBuilder()
.addAllReports(new ArrayList<RunReportResponse>())
.setKind("kind3292052")
.build();
mockBetaAnalyticsData.addResponse(expectedResponse);

Expand Down Expand Up @@ -300,6 +303,7 @@ public void batchRunPivotReportsTest() throws Exception {
BatchRunPivotReportsResponse expectedResponse =
BatchRunPivotReportsResponse.newBuilder()
.addAllPivotReports(new ArrayList<RunPivotReportResponse>())
.setKind("kind3292052")
.build();
mockBetaAnalyticsData.addResponse(expectedResponse);

Expand Down Expand Up @@ -435,6 +439,7 @@ public void runRealtimeReportTest() throws Exception {
.addAllMinimums(new ArrayList<Row>())
.setRowCount(1340416618)
.setPropertyQuota(PropertyQuota.newBuilder().build())
.setKind("kind3292052")
.build();
mockBetaAnalyticsData.addResponse(expectedResponse);

Expand Down

Large diffs are not rendered by default.

Expand Up @@ -39,6 +39,7 @@ private BatchRunPivotReportsResponse(com.google.protobuf.GeneratedMessageV3.Buil

private BatchRunPivotReportsResponse() {
pivotReports_ = java.util.Collections.emptyList();
kind_ = "";
}

@java.lang.Override
Expand Down Expand Up @@ -85,6 +86,13 @@ private BatchRunPivotReportsResponse(
extensionRegistry));
break;
}
case 18:
{
java.lang.String s = input.readStringRequireUtf8();

kind_ = s;
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
Expand Down Expand Up @@ -193,6 +201,59 @@ public com.google.analytics.data.v1beta.RunPivotReportResponseOrBuilder getPivot
return pivotReports_.get(index);
}

public static final int KIND_FIELD_NUMBER = 2;
private volatile java.lang.Object kind_;
/**
*
*
* <pre>
* Identifies what kind of resource this message is. This `kind` is always the
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
* between response types in JSON.
* </pre>
*
* <code>string kind = 2;</code>
*
* @return The kind.
*/
@java.lang.Override
public java.lang.String getKind() {
java.lang.Object ref = kind_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
kind_ = s;
return s;
}
}
/**
*
*
* <pre>
* Identifies what kind of resource this message is. This `kind` is always the
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
* between response types in JSON.
* </pre>
*
* <code>string kind = 2;</code>
*
* @return The bytes for kind.
*/
@java.lang.Override
public com.google.protobuf.ByteString getKindBytes() {
java.lang.Object ref = kind_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
kind_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand All @@ -210,6 +271,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < pivotReports_.size(); i++) {
output.writeMessage(1, pivotReports_.get(i));
}
if (!getKindBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kind_);
}
unknownFields.writeTo(output);
}

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

if (!getPivotReportsList().equals(other.getPivotReportsList())) return false;
if (!getKind().equals(other.getKind())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
Expand All @@ -254,6 +322,8 @@ public int hashCode() {
hash = (37 * hash) + PIVOT_REPORTS_FIELD_NUMBER;
hash = (53 * hash) + getPivotReportsList().hashCode();
}
hash = (37 * hash) + KIND_FIELD_NUMBER;
hash = (53 * hash) + getKind().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -408,6 +478,8 @@ public Builder clear() {
} else {
pivotReportsBuilder_.clear();
}
kind_ = "";

return this;
}

Expand Down Expand Up @@ -446,6 +518,7 @@ public com.google.analytics.data.v1beta.BatchRunPivotReportsResponse buildPartia
} else {
result.pivotReports_ = pivotReportsBuilder_.build();
}
result.kind_ = kind_;
onBuilt();
return result;
}
Expand Down Expand Up @@ -524,6 +597,10 @@ public Builder mergeFrom(com.google.analytics.data.v1beta.BatchRunPivotReportsRe
}
}
}
if (!other.getKind().isEmpty()) {
kind_ = other.kind_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
Expand Down Expand Up @@ -921,6 +998,122 @@ public com.google.analytics.data.v1beta.RunPivotReportResponse.Builder addPivotR
return pivotReportsBuilder_;
}

private java.lang.Object kind_ = "";
/**
*
*
* <pre>
* Identifies what kind of resource this message is. This `kind` is always the
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
* between response types in JSON.
* </pre>
*
* <code>string kind = 2;</code>
*
* @return The kind.
*/
public java.lang.String getKind() {
java.lang.Object ref = kind_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
kind_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* Identifies what kind of resource this message is. This `kind` is always the
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
* between response types in JSON.
* </pre>
*
* <code>string kind = 2;</code>
*
* @return The bytes for kind.
*/
public com.google.protobuf.ByteString getKindBytes() {
java.lang.Object ref = kind_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
kind_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* Identifies what kind of resource this message is. This `kind` is always the
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
* between response types in JSON.
* </pre>
*
* <code>string kind = 2;</code>
*
* @param value The kind to set.
* @return This builder for chaining.
*/
public Builder setKind(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}

kind_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Identifies what kind of resource this message is. This `kind` is always the
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
* between response types in JSON.
* </pre>
*
* <code>string kind = 2;</code>
*
* @return This builder for chaining.
*/
public Builder clearKind() {

kind_ = getDefaultInstance().getKind();
onChanged();
return this;
}
/**
*
*
* <pre>
* Identifies what kind of resource this message is. This `kind` is always the
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
* between response types in JSON.
* </pre>
*
* <code>string kind = 2;</code>
*
* @param value The bytes for kind to set.
* @return This builder for chaining.
*/
public Builder setKindBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);

kind_ = value;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Expand Up @@ -75,4 +75,33 @@ public interface BatchRunPivotReportsResponseOrBuilder
*/
com.google.analytics.data.v1beta.RunPivotReportResponseOrBuilder getPivotReportsOrBuilder(
int index);

/**
*
*
* <pre>
* Identifies what kind of resource this message is. This `kind` is always the
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
* between response types in JSON.
* </pre>
*
* <code>string kind = 2;</code>
*
* @return The kind.
*/
java.lang.String getKind();
/**
*
*
* <pre>
* Identifies what kind of resource this message is. This `kind` is always the
* fixed string "analyticsData#batchRunPivotReports". Useful to distinguish
* between response types in JSON.
* </pre>
*
* <code>string kind = 2;</code>
*
* @return The bytes for kind.
*/
com.google.protobuf.ByteString getKindBytes();
}

0 comments on commit 8b30dcd

Please sign in to comment.