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

Commit 29aca28

Browse files
yoshi-automationchingor13
authored andcommitted
fix: use Key directly rather than a resource name for Key (#25)
1 parent 3bebbb2 commit 29aca28

38 files changed

Lines changed: 1518 additions & 178 deletions

google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,9 @@ public final UnaryCallable<GetKeyRequest, Key> getKeyCallable() {
571571
*
572572
* <pre><code>
573573
* try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
574-
* KeyName key = KeyName.of("[PROJECT]", "[KEY]");
574+
* Key key = Key.newBuilder().build();
575575
* UpdateKeyRequest request = UpdateKeyRequest.newBuilder()
576-
* .setKey(key.toString())
576+
* .setKey(key)
577577
* .build();
578578
* Key response = recaptchaEnterpriseServiceV1Beta1Client.updateKey(request);
579579
* }
@@ -594,9 +594,9 @@ public final Key updateKey(UpdateKeyRequest request) {
594594
*
595595
* <pre><code>
596596
* try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
597-
* KeyName key = KeyName.of("[PROJECT]", "[KEY]");
597+
* Key key = Key.newBuilder().build();
598598
* UpdateKeyRequest request = UpdateKeyRequest.newBuilder()
599-
* .setKey(key.toString())
599+
* .setKey(key)
600600
* .build();
601601
* ApiFuture&lt;Key&gt; future = recaptchaEnterpriseServiceV1Beta1Client.updateKeyCallable().futureCall(request);
602602
* // Do something

proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AndroidKeySettings.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ private AndroidKeySettings() {
4141
allowedPackageNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
4242
}
4343

44+
@java.lang.Override
45+
@SuppressWarnings({"unused"})
46+
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
47+
return new AndroidKeySettings();
48+
}
49+
4450
@java.lang.Override
4551
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
4652
return this.unknownFields;
@@ -123,6 +129,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
123129
* </pre>
124130
*
125131
* <code>repeated string allowed_package_names = 1;</code>
132+
*
133+
* @return A list containing the allowedPackageNames.
126134
*/
127135
public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() {
128136
return allowedPackageNames_;
@@ -136,6 +144,8 @@ public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() {
136144
* </pre>
137145
*
138146
* <code>repeated string allowed_package_names = 1;</code>
147+
*
148+
* @return The count of allowedPackageNames.
139149
*/
140150
public int getAllowedPackageNamesCount() {
141151
return allowedPackageNames_.size();
@@ -149,6 +159,9 @@ public int getAllowedPackageNamesCount() {
149159
* </pre>
150160
*
151161
* <code>repeated string allowed_package_names = 1;</code>
162+
*
163+
* @param index The index of the element to return.
164+
* @return The allowedPackageNames at the given index.
152165
*/
153166
public java.lang.String getAllowedPackageNames(int index) {
154167
return allowedPackageNames_.get(index);
@@ -162,6 +175,9 @@ public java.lang.String getAllowedPackageNames(int index) {
162175
* </pre>
163176
*
164177
* <code>repeated string allowed_package_names = 1;</code>
178+
*
179+
* @param index The index of the value to return.
180+
* @return The bytes of the allowedPackageNames at the given index.
165181
*/
166182
public com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index) {
167183
return allowedPackageNames_.getByteString(index);
@@ -524,6 +540,8 @@ private void ensureAllowedPackageNamesIsMutable() {
524540
* </pre>
525541
*
526542
* <code>repeated string allowed_package_names = 1;</code>
543+
*
544+
* @return A list containing the allowedPackageNames.
527545
*/
528546
public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() {
529547
return allowedPackageNames_.getUnmodifiableView();
@@ -537,6 +555,8 @@ public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() {
537555
* </pre>
538556
*
539557
* <code>repeated string allowed_package_names = 1;</code>
558+
*
559+
* @return The count of allowedPackageNames.
540560
*/
541561
public int getAllowedPackageNamesCount() {
542562
return allowedPackageNames_.size();
@@ -550,6 +570,9 @@ public int getAllowedPackageNamesCount() {
550570
* </pre>
551571
*
552572
* <code>repeated string allowed_package_names = 1;</code>
573+
*
574+
* @param index The index of the element to return.
575+
* @return The allowedPackageNames at the given index.
553576
*/
554577
public java.lang.String getAllowedPackageNames(int index) {
555578
return allowedPackageNames_.get(index);
@@ -563,6 +586,9 @@ public java.lang.String getAllowedPackageNames(int index) {
563586
* </pre>
564587
*
565588
* <code>repeated string allowed_package_names = 1;</code>
589+
*
590+
* @param index The index of the value to return.
591+
* @return The bytes of the allowedPackageNames at the given index.
566592
*/
567593
public com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index) {
568594
return allowedPackageNames_.getByteString(index);
@@ -576,6 +602,10 @@ public com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index) {
576602
* </pre>
577603
*
578604
* <code>repeated string allowed_package_names = 1;</code>
605+
*
606+
* @param index The index to set the value at.
607+
* @param value The allowedPackageNames to set.
608+
* @return This builder for chaining.
579609
*/
580610
public Builder setAllowedPackageNames(int index, java.lang.String value) {
581611
if (value == null) {
@@ -595,6 +625,9 @@ public Builder setAllowedPackageNames(int index, java.lang.String value) {
595625
* </pre>
596626
*
597627
* <code>repeated string allowed_package_names = 1;</code>
628+
*
629+
* @param value The allowedPackageNames to add.
630+
* @return This builder for chaining.
598631
*/
599632
public Builder addAllowedPackageNames(java.lang.String value) {
600633
if (value == null) {
@@ -614,6 +647,9 @@ public Builder addAllowedPackageNames(java.lang.String value) {
614647
* </pre>
615648
*
616649
* <code>repeated string allowed_package_names = 1;</code>
650+
*
651+
* @param values The allowedPackageNames to add.
652+
* @return This builder for chaining.
617653
*/
618654
public Builder addAllAllowedPackageNames(java.lang.Iterable<java.lang.String> values) {
619655
ensureAllowedPackageNamesIsMutable();
@@ -630,6 +666,8 @@ public Builder addAllAllowedPackageNames(java.lang.Iterable<java.lang.String> va
630666
* </pre>
631667
*
632668
* <code>repeated string allowed_package_names = 1;</code>
669+
*
670+
* @return This builder for chaining.
633671
*/
634672
public Builder clearAllowedPackageNames() {
635673
allowedPackageNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
@@ -646,6 +684,9 @@ public Builder clearAllowedPackageNames() {
646684
* </pre>
647685
*
648686
* <code>repeated string allowed_package_names = 1;</code>
687+
*
688+
* @param value The bytes of the allowedPackageNames to add.
689+
* @return This builder for chaining.
649690
*/
650691
public Builder addAllowedPackageNamesBytes(com.google.protobuf.ByteString value) {
651692
if (value == null) {

proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AndroidKeySettingsOrBuilder.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public interface AndroidKeySettingsOrBuilder
3232
* </pre>
3333
*
3434
* <code>repeated string allowed_package_names = 1;</code>
35+
*
36+
* @return A list containing the allowedPackageNames.
3537
*/
3638
java.util.List<java.lang.String> getAllowedPackageNamesList();
3739
/**
@@ -43,6 +45,8 @@ public interface AndroidKeySettingsOrBuilder
4345
* </pre>
4446
*
4547
* <code>repeated string allowed_package_names = 1;</code>
48+
*
49+
* @return The count of allowedPackageNames.
4650
*/
4751
int getAllowedPackageNamesCount();
4852
/**
@@ -54,6 +58,9 @@ public interface AndroidKeySettingsOrBuilder
5458
* </pre>
5559
*
5660
* <code>repeated string allowed_package_names = 1;</code>
61+
*
62+
* @param index The index of the element to return.
63+
* @return The allowedPackageNames at the given index.
5764
*/
5865
java.lang.String getAllowedPackageNames(int index);
5966
/**
@@ -65,6 +72,9 @@ public interface AndroidKeySettingsOrBuilder
6572
* </pre>
6673
*
6774
* <code>repeated string allowed_package_names = 1;</code>
75+
*
76+
* @param index The index of the value to return.
77+
* @return The bytes of the allowedPackageNames at the given index.
6878
*/
6979
com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index);
7080
}

proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentRequest.java

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ private AnnotateAssessmentRequest() {
4242
annotation_ = 0;
4343
}
4444

45+
@java.lang.Override
46+
@SuppressWarnings({"unused"})
47+
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
48+
return new AnnotateAssessmentRequest();
49+
}
50+
4551
@java.lang.Override
4652
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
4753
return this.unknownFields;
@@ -55,7 +61,6 @@ private AnnotateAssessmentRequest(
5561
if (extensionRegistry == null) {
5662
throw new java.lang.NullPointerException();
5763
}
58-
int mutable_bitField0_ = 0;
5964
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
6065
com.google.protobuf.UnknownFieldSet.newBuilder();
6166
try {
@@ -197,12 +202,20 @@ public final int getNumber() {
197202
return value;
198203
}
199204

200-
/** @deprecated Use {@link #forNumber(int)} instead. */
205+
/**
206+
* @param value The numeric wire value of the corresponding enum entry.
207+
* @return The enum associated with the given numeric wire value.
208+
* @deprecated Use {@link #forNumber(int)} instead.
209+
*/
201210
@java.lang.Deprecated
202211
public static Annotation valueOf(int value) {
203212
return forNumber(value);
204213
}
205214

215+
/**
216+
* @param value The numeric wire value of the corresponding enum entry.
217+
* @return The enum associated with the given numeric wire value.
218+
*/
206219
public static Annotation forNumber(int value) {
207220
switch (value) {
208221
case 0:
@@ -275,6 +288,8 @@ private Annotation(int value) {
275288
* <code>
276289
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
277290
* </code>
291+
*
292+
* @return The name.
278293
*/
279294
public java.lang.String getName() {
280295
java.lang.Object ref = name_;
@@ -298,6 +313,8 @@ public java.lang.String getName() {
298313
* <code>
299314
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
300315
* </code>
316+
*
317+
* @return The bytes for name.
301318
*/
302319
public com.google.protobuf.ByteString getNameBytes() {
303320
java.lang.Object ref = name_;
@@ -323,6 +340,8 @@ public com.google.protobuf.ByteString getNameBytes() {
323340
* <code>
324341
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
325342
* </code>
343+
*
344+
* @return The enum numeric value on the wire for annotation.
326345
*/
327346
public int getAnnotationValue() {
328347
return annotation_;
@@ -337,6 +356,8 @@ public int getAnnotationValue() {
337356
* <code>
338357
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
339358
* </code>
359+
*
360+
* @return The annotation.
340361
*/
341362
public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation
342363
getAnnotation() {
@@ -705,6 +726,8 @@ public Builder mergeFrom(
705726
* <code>
706727
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
707728
* </code>
729+
*
730+
* @return The name.
708731
*/
709732
public java.lang.String getName() {
710733
java.lang.Object ref = name_;
@@ -728,6 +751,8 @@ public java.lang.String getName() {
728751
* <code>
729752
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
730753
* </code>
754+
*
755+
* @return The bytes for name.
731756
*/
732757
public com.google.protobuf.ByteString getNameBytes() {
733758
java.lang.Object ref = name_;
@@ -751,6 +776,9 @@ public com.google.protobuf.ByteString getNameBytes() {
751776
* <code>
752777
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
753778
* </code>
779+
*
780+
* @param value The name to set.
781+
* @return This builder for chaining.
754782
*/
755783
public Builder setName(java.lang.String value) {
756784
if (value == null) {
@@ -772,6 +800,8 @@ public Builder setName(java.lang.String value) {
772800
* <code>
773801
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
774802
* </code>
803+
*
804+
* @return This builder for chaining.
775805
*/
776806
public Builder clearName() {
777807

@@ -790,6 +820,9 @@ public Builder clearName() {
790820
* <code>
791821
* string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
792822
* </code>
823+
*
824+
* @param value The bytes for name to set.
825+
* @return This builder for chaining.
793826
*/
794827
public Builder setNameBytes(com.google.protobuf.ByteString value) {
795828
if (value == null) {
@@ -813,6 +846,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
813846
* <code>
814847
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
815848
* </code>
849+
*
850+
* @return The enum numeric value on the wire for annotation.
816851
*/
817852
public int getAnnotationValue() {
818853
return annotation_;
@@ -827,6 +862,9 @@ public int getAnnotationValue() {
827862
* <code>
828863
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
829864
* </code>
865+
*
866+
* @param value The enum numeric value on the wire for annotation to set.
867+
* @return This builder for chaining.
830868
*/
831869
public Builder setAnnotationValue(int value) {
832870
annotation_ = value;
@@ -843,6 +881,8 @@ public Builder setAnnotationValue(int value) {
843881
* <code>
844882
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
845883
* </code>
884+
*
885+
* @return The annotation.
846886
*/
847887
public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation
848888
getAnnotation() {
@@ -864,6 +904,9 @@ public Builder setAnnotationValue(int value) {
864904
* <code>
865905
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
866906
* </code>
907+
*
908+
* @param value The annotation to set.
909+
* @return This builder for chaining.
867910
*/
868911
public Builder setAnnotation(
869912
com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation value) {
@@ -885,6 +928,8 @@ public Builder setAnnotation(
885928
* <code>
886929
* .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED];
887930
* </code>
931+
*
932+
* @return This builder for chaining.
888933
*/
889934
public Builder clearAnnotation() {
890935

0 commit comments

Comments
 (0)