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

Commit

Permalink
fix: use Key directly rather than a resource name for Key (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and chingor13 committed Dec 26, 2019
1 parent 3bebbb2 commit 29aca28
Show file tree
Hide file tree
Showing 38 changed files with 1,518 additions and 178 deletions.
Expand Up @@ -571,9 +571,9 @@ public final UnaryCallable<GetKeyRequest, Key> getKeyCallable() {
*
* <pre><code>
* try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
* KeyName key = KeyName.of("[PROJECT]", "[KEY]");
* Key key = Key.newBuilder().build();
* UpdateKeyRequest request = UpdateKeyRequest.newBuilder()
* .setKey(key.toString())
* .setKey(key)
* .build();
* Key response = recaptchaEnterpriseServiceV1Beta1Client.updateKey(request);
* }
Expand All @@ -594,9 +594,9 @@ public final Key updateKey(UpdateKeyRequest request) {
*
* <pre><code>
* try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
* KeyName key = KeyName.of("[PROJECT]", "[KEY]");
* Key key = Key.newBuilder().build();
* UpdateKeyRequest request = UpdateKeyRequest.newBuilder()
* .setKey(key.toString())
* .setKey(key)
* .build();
* ApiFuture&lt;Key&gt; future = recaptchaEnterpriseServiceV1Beta1Client.updateKeyCallable().futureCall(request);
* // Do something
Expand Down
Expand Up @@ -41,6 +41,12 @@ private AndroidKeySettings() {
allowedPackageNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}

@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new AndroidKeySettings();
}

@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
Expand Down Expand Up @@ -123,6 +129,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @return A list containing the allowedPackageNames.
*/
public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() {
return allowedPackageNames_;
Expand All @@ -136,6 +144,8 @@ public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @return The count of allowedPackageNames.
*/
public int getAllowedPackageNamesCount() {
return allowedPackageNames_.size();
Expand All @@ -149,6 +159,9 @@ public int getAllowedPackageNamesCount() {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param index The index of the element to return.
* @return The allowedPackageNames at the given index.
*/
public java.lang.String getAllowedPackageNames(int index) {
return allowedPackageNames_.get(index);
Expand All @@ -162,6 +175,9 @@ public java.lang.String getAllowedPackageNames(int index) {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedPackageNames at the given index.
*/
public com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index) {
return allowedPackageNames_.getByteString(index);
Expand Down Expand Up @@ -524,6 +540,8 @@ private void ensureAllowedPackageNamesIsMutable() {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @return A list containing the allowedPackageNames.
*/
public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() {
return allowedPackageNames_.getUnmodifiableView();
Expand All @@ -537,6 +555,8 @@ public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @return The count of allowedPackageNames.
*/
public int getAllowedPackageNamesCount() {
return allowedPackageNames_.size();
Expand All @@ -550,6 +570,9 @@ public int getAllowedPackageNamesCount() {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param index The index of the element to return.
* @return The allowedPackageNames at the given index.
*/
public java.lang.String getAllowedPackageNames(int index) {
return allowedPackageNames_.get(index);
Expand All @@ -563,6 +586,9 @@ public java.lang.String getAllowedPackageNames(int index) {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedPackageNames at the given index.
*/
public com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index) {
return allowedPackageNames_.getByteString(index);
Expand All @@ -576,6 +602,10 @@ public com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index) {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param index The index to set the value at.
* @param value The allowedPackageNames to set.
* @return This builder for chaining.
*/
public Builder setAllowedPackageNames(int index, java.lang.String value) {
if (value == null) {
Expand All @@ -595,6 +625,9 @@ public Builder setAllowedPackageNames(int index, java.lang.String value) {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param value The allowedPackageNames to add.
* @return This builder for chaining.
*/
public Builder addAllowedPackageNames(java.lang.String value) {
if (value == null) {
Expand All @@ -614,6 +647,9 @@ public Builder addAllowedPackageNames(java.lang.String value) {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param values The allowedPackageNames to add.
* @return This builder for chaining.
*/
public Builder addAllAllowedPackageNames(java.lang.Iterable<java.lang.String> values) {
ensureAllowedPackageNamesIsMutable();
Expand All @@ -630,6 +666,8 @@ public Builder addAllAllowedPackageNames(java.lang.Iterable<java.lang.String> va
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @return This builder for chaining.
*/
public Builder clearAllowedPackageNames() {
allowedPackageNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
Expand All @@ -646,6 +684,9 @@ public Builder clearAllowedPackageNames() {
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param value The bytes of the allowedPackageNames to add.
* @return This builder for chaining.
*/
public Builder addAllowedPackageNamesBytes(com.google.protobuf.ByteString value) {
if (value == null) {
Expand Down
Expand Up @@ -32,6 +32,8 @@ public interface AndroidKeySettingsOrBuilder
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @return A list containing the allowedPackageNames.
*/
java.util.List<java.lang.String> getAllowedPackageNamesList();
/**
Expand All @@ -43,6 +45,8 @@ public interface AndroidKeySettingsOrBuilder
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @return The count of allowedPackageNames.
*/
int getAllowedPackageNamesCount();
/**
Expand All @@ -54,6 +58,9 @@ public interface AndroidKeySettingsOrBuilder
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param index The index of the element to return.
* @return The allowedPackageNames at the given index.
*/
java.lang.String getAllowedPackageNames(int index);
/**
Expand All @@ -65,6 +72,9 @@ public interface AndroidKeySettingsOrBuilder
* </pre>
*
* <code>repeated string allowed_package_names = 1;</code>
*
* @param index The index of the value to return.
* @return The bytes of the allowedPackageNames at the given index.
*/
com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index);
}
Expand Up @@ -42,6 +42,12 @@ private AnnotateAssessmentRequest() {
annotation_ = 0;
}

@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new AnnotateAssessmentRequest();
}

@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
Expand All @@ -55,7 +61,6 @@ private AnnotateAssessmentRequest(
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
Expand Down Expand Up @@ -197,12 +202,20 @@ public final int getNumber() {
return value;
}

/** @deprecated Use {@link #forNumber(int)} instead. */
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Annotation valueOf(int value) {
return forNumber(value);
}

/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Annotation forNumber(int value) {
switch (value) {
case 0:
Expand Down Expand Up @@ -275,6 +288,8 @@ private Annotation(int value) {
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
Expand All @@ -298,6 +313,8 @@ public java.lang.String getName() {
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return The bytes for name.
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
Expand All @@ -323,6 +340,8 @@ public com.google.protobuf.ByteString getNameBytes() {
* <code>
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The enum numeric value on the wire for annotation.
*/
public int getAnnotationValue() {
return annotation_;
Expand All @@ -337,6 +356,8 @@ public int getAnnotationValue() {
* <code>
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The annotation.
*/
public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation
getAnnotation() {
Expand Down Expand Up @@ -705,6 +726,8 @@ public Builder mergeFrom(
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
Expand All @@ -728,6 +751,8 @@ public java.lang.String getName() {
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return The bytes for name.
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
Expand All @@ -751,6 +776,9 @@ public com.google.protobuf.ByteString getNameBytes() {
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(java.lang.String value) {
if (value == null) {
Expand All @@ -772,6 +800,8 @@ public Builder setName(java.lang.String value) {
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @return This builder for chaining.
*/
public Builder clearName() {

Expand All @@ -790,6 +820,9 @@ public Builder clearName() {
* <code>
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
* </code>
*
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
Expand All @@ -813,6 +846,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
* <code>
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The enum numeric value on the wire for annotation.
*/
public int getAnnotationValue() {
return annotation_;
Expand All @@ -827,6 +862,9 @@ public int getAnnotationValue() {
* <code>
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @param value The enum numeric value on the wire for annotation to set.
* @return This builder for chaining.
*/
public Builder setAnnotationValue(int value) {
annotation_ = value;
Expand All @@ -843,6 +881,8 @@ public Builder setAnnotationValue(int value) {
* <code>
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The annotation.
*/
public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation
getAnnotation() {
Expand All @@ -864,6 +904,9 @@ public Builder setAnnotationValue(int value) {
* <code>
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @param value The annotation to set.
* @return This builder for chaining.
*/
public Builder setAnnotation(
com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation value) {
Expand All @@ -885,6 +928,8 @@ public Builder setAnnotation(
* <code>
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return This builder for chaining.
*/
public Builder clearAnnotation() {

Expand Down

0 comments on commit 29aca28

Please sign in to comment.