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

feat: add location_id in preparation for regionalization #30

Merged
merged 1 commit into from Nov 27, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -521,6 +521,15 @@ public Map<String, String> extract(ReidentifyContentRequest request) {
GrpcCallSettings<ListInfoTypesRequest, ListInfoTypesResponse> listInfoTypesTransportSettings =
GrpcCallSettings.<ListInfoTypesRequest, ListInfoTypesResponse>newBuilder()
.setMethodDescriptor(listInfoTypesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListInfoTypesRequest>() {
@Override
public Map<String, String> extract(ListInfoTypesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("location_id", String.valueOf(request.getLocationId()));
return params.build();
}
})
.build();
GrpcCallSettings<CreateInspectTemplateRequest, InspectTemplate>
createInspectTemplateTransportSettings =
Expand Down
Expand Up @@ -41,6 +41,7 @@ private CreateDeidentifyTemplateRequest(
private CreateDeidentifyTemplateRequest() {
parent_ = "";
templateId_ = "";
locationId_ = "";
}

@java.lang.Override
Expand Down Expand Up @@ -97,6 +98,13 @@ private CreateDeidentifyTemplateRequest(
templateId_ = s;
break;
}
case 34:
{
java.lang.String s = input.readStringRequireUtf8();

locationId_ = s;
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
Expand Down Expand Up @@ -270,6 +278,51 @@ public com.google.protobuf.ByteString getTemplateIdBytes() {
}
}

public static final int LOCATION_ID_FIELD_NUMBER = 4;
private volatile java.lang.Object locationId_;
/**
*
*
* <pre>
* The geographic location to store the deidentification template. Reserved
* for future extensions.
* </pre>
*
* <code>string location_id = 4;</code>
*/
public java.lang.String getLocationId() {
java.lang.Object ref = locationId_;
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();
locationId_ = s;
return s;
}
}
/**
*
*
* <pre>
* The geographic location to store the deidentification template. Reserved
* for future extensions.
* </pre>
*
* <code>string location_id = 4;</code>
*/
public com.google.protobuf.ByteString getLocationIdBytes() {
java.lang.Object ref = locationId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
locationId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand All @@ -293,6 +346,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (!getTemplateIdBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, templateId_);
}
if (!getLocationIdBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, locationId_);
}
unknownFields.writeTo(output);
}

Expand All @@ -311,6 +367,9 @@ public int getSerializedSize() {
if (!getTemplateIdBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, templateId_);
}
if (!getLocationIdBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, locationId_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -333,6 +392,7 @@ public boolean equals(final java.lang.Object obj) {
if (!getDeidentifyTemplate().equals(other.getDeidentifyTemplate())) return false;
}
if (!getTemplateId().equals(other.getTemplateId())) return false;
if (!getLocationId().equals(other.getLocationId())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
Expand All @@ -352,6 +412,8 @@ public int hashCode() {
}
hash = (37 * hash) + TEMPLATE_ID_FIELD_NUMBER;
hash = (53 * hash) + getTemplateId().hashCode();
hash = (37 * hash) + LOCATION_ID_FIELD_NUMBER;
hash = (53 * hash) + getLocationId().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -508,6 +570,8 @@ public Builder clear() {
}
templateId_ = "";

locationId_ = "";

return this;
}

Expand Down Expand Up @@ -542,6 +606,7 @@ public com.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest buildPartial()
result.deidentifyTemplate_ = deidentifyTemplateBuilder_.build();
}
result.templateId_ = templateId_;
result.locationId_ = locationId_;
onBuilt();
return result;
}
Expand Down Expand Up @@ -603,6 +668,10 @@ public Builder mergeFrom(com.google.privacy.dlp.v2.CreateDeidentifyTemplateReque
templateId_ = other.templateId_;
onChanged();
}
if (!other.getLocationId().isEmpty()) {
locationId_ = other.locationId_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
Expand Down Expand Up @@ -1033,6 +1102,105 @@ public Builder setTemplateIdBytes(com.google.protobuf.ByteString value) {
return this;
}

private java.lang.Object locationId_ = "";
/**
*
*
* <pre>
* The geographic location to store the deidentification template. Reserved
* for future extensions.
* </pre>
*
* <code>string location_id = 4;</code>
*/
public java.lang.String getLocationId() {
java.lang.Object ref = locationId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
locationId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The geographic location to store the deidentification template. Reserved
* for future extensions.
* </pre>
*
* <code>string location_id = 4;</code>
*/
public com.google.protobuf.ByteString getLocationIdBytes() {
java.lang.Object ref = locationId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
locationId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The geographic location to store the deidentification template. Reserved
* for future extensions.
* </pre>
*
* <code>string location_id = 4;</code>
*/
public Builder setLocationId(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}

locationId_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The geographic location to store the deidentification template. Reserved
* for future extensions.
* </pre>
*
* <code>string location_id = 4;</code>
*/
public Builder clearLocationId() {

locationId_ = getDefaultInstance().getLocationId();
onChanged();
return this;
}
/**
*
*
* <pre>
* The geographic location to store the deidentification template. Reserved
* for future extensions.
* </pre>
*
* <code>string location_id = 4;</code>
*/
public Builder setLocationIdBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);

locationId_ = 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 @@ -107,4 +107,27 @@ public interface CreateDeidentifyTemplateRequestOrBuilder
* <code>string template_id = 3;</code>
*/
com.google.protobuf.ByteString getTemplateIdBytes();

/**
*
*
* <pre>
* The geographic location to store the deidentification template. Reserved
* for future extensions.
* </pre>
*
* <code>string location_id = 4;</code>
*/
java.lang.String getLocationId();
/**
*
*
* <pre>
* The geographic location to store the deidentification template. Reserved
* for future extensions.
* </pre>
*
* <code>string location_id = 4;</code>
*/
com.google.protobuf.ByteString getLocationIdBytes();
}