Skip to content

Commit

Permalink
feat: add RetrieveLegacySecretKey method (googleapis#929)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

feat: add annotation reasons REFUND, REFUND_FRAUD, TRANSACTION_ACCEPTED, TRANSACTION_DECLINED and SOCIAL_SPAM

PiperOrigin-RevId: 480357575

Source-Link: https://togithub.com/googleapis/googleapis/commit/cbd4501e0c0f53ef459f4c54d8cc7bbf6586be55

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/7155b97d98361f3fc44cc8cb53667498736a9bde
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzE1NWI5N2Q5ODM2MWYzZmM0NGNjOGNiNTM2Njc0OTg3MzZhOWJkZSJ9
  • Loading branch information
gcf-owl-bot[bot] authored Oct 11, 2022
1 parent 581aada commit 7c4dfe5
Show file tree
Hide file tree
Showing 40 changed files with 3,161 additions and 903 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import com.google.recaptchaenterprise.v1.GetKeyRequest;
import com.google.recaptchaenterprise.v1.GetMetricsRequest;
import com.google.recaptchaenterprise.v1.Key;
import com.google.recaptchaenterprise.v1.KeyName;
import com.google.recaptchaenterprise.v1.ListKeysRequest;
import com.google.recaptchaenterprise.v1.ListKeysResponse;
import com.google.recaptchaenterprise.v1.ListRelatedAccountGroupMembershipsRequest;
Expand All @@ -52,6 +53,8 @@
import com.google.recaptchaenterprise.v1.RelatedAccountGroup;
import com.google.recaptchaenterprise.v1.RelatedAccountGroupMembership;
import com.google.recaptchaenterprise.v1.RelatedAccountGroupName;
import com.google.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest;
import com.google.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse;
import com.google.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest;
import com.google.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse;
import com.google.recaptchaenterprise.v1.UpdateKeyRequest;
Expand Down Expand Up @@ -626,6 +629,133 @@ public final UnaryCallable<ListKeysRequest, ListKeysResponse> listKeysCallable()
return stub.listKeysCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the secret key related to the specified public key. You must use the legacy secret key
* only in a 3rd party integration with legacy reCAPTCHA.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
* RecaptchaEnterpriseServiceClient.create()) {
* KeyName key = KeyName.of("[PROJECT]", "[KEY]");
* RetrieveLegacySecretKeyResponse response =
* recaptchaEnterpriseServiceClient.retrieveLegacySecretKey(key);
* }
* }</pre>
*
* @param key Required. The public key name linked to the requested secret key in the format
* "projects/{project}/keys/{key}".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final RetrieveLegacySecretKeyResponse retrieveLegacySecretKey(KeyName key) {
RetrieveLegacySecretKeyRequest request =
RetrieveLegacySecretKeyRequest.newBuilder()
.setKey(key == null ? null : key.toString())
.build();
return retrieveLegacySecretKey(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the secret key related to the specified public key. You must use the legacy secret key
* only in a 3rd party integration with legacy reCAPTCHA.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
* RecaptchaEnterpriseServiceClient.create()) {
* String key = KeyName.of("[PROJECT]", "[KEY]").toString();
* RetrieveLegacySecretKeyResponse response =
* recaptchaEnterpriseServiceClient.retrieveLegacySecretKey(key);
* }
* }</pre>
*
* @param key Required. The public key name linked to the requested secret key in the format
* "projects/{project}/keys/{key}".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final RetrieveLegacySecretKeyResponse retrieveLegacySecretKey(String key) {
RetrieveLegacySecretKeyRequest request =
RetrieveLegacySecretKeyRequest.newBuilder().setKey(key).build();
return retrieveLegacySecretKey(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the secret key related to the specified public key. You must use the legacy secret key
* only in a 3rd party integration with legacy reCAPTCHA.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
* RecaptchaEnterpriseServiceClient.create()) {
* RetrieveLegacySecretKeyRequest request =
* RetrieveLegacySecretKeyRequest.newBuilder()
* .setKey(KeyName.of("[PROJECT]", "[KEY]").toString())
* .build();
* RetrieveLegacySecretKeyResponse response =
* recaptchaEnterpriseServiceClient.retrieveLegacySecretKey(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final RetrieveLegacySecretKeyResponse retrieveLegacySecretKey(
RetrieveLegacySecretKeyRequest request) {
return retrieveLegacySecretKeyCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the secret key related to the specified public key. You must use the legacy secret key
* only in a 3rd party integration with legacy reCAPTCHA.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
* RecaptchaEnterpriseServiceClient.create()) {
* RetrieveLegacySecretKeyRequest request =
* RetrieveLegacySecretKeyRequest.newBuilder()
* .setKey(KeyName.of("[PROJECT]", "[KEY]").toString())
* .build();
* ApiFuture<RetrieveLegacySecretKeyResponse> future =
* recaptchaEnterpriseServiceClient.retrieveLegacySecretKeyCallable().futureCall(request);
* // Do something.
* RetrieveLegacySecretKeyResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>
retrieveLegacySecretKeyCallable() {
return stub.retrieveLegacySecretKeyCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the specified key.
Expand Down Expand Up @@ -1156,7 +1286,7 @@ public final ListRelatedAccountGroupsPagedResponse listRelatedAccountGroups(

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Get the memberships in a group of related accounts.
* Get memberships in a group of related accounts.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1194,7 +1324,7 @@ public final ListRelatedAccountGroupMembershipsPagedResponse listRelatedAccountG

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Get the memberships in a group of related accounts.
* Get memberships in a group of related accounts.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1229,7 +1359,7 @@ public final ListRelatedAccountGroupMembershipsPagedResponse listRelatedAccountG

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Get the memberships in a group of related accounts.
* Get memberships in a group of related accounts.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1267,7 +1397,7 @@ public final ListRelatedAccountGroupMembershipsPagedResponse listRelatedAccountG

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Get the memberships in a group of related accounts.
* Get memberships in a group of related accounts.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1306,7 +1436,7 @@ public final ListRelatedAccountGroupMembershipsPagedResponse listRelatedAccountG

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Get the memberships in a group of related accounts.
* Get memberships in a group of related accounts.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1377,10 +1507,10 @@ public final ListRelatedAccountGroupMembershipsPagedResponse listRelatedAccountG
* }</pre>
*
* @param project Required. The name of the project to search related account group memberships
* from, in the format "projects/{project}".
* from. Specify the project name in the following format: "projects/{project}".
* @param hashedAccountId Optional. The unique stable hashed user identifier we should search
* connections to. The identifier should correspond to a `hashed_account_id` provided in a
* previous CreateAssessment or AnnotateAssessment call.
* previous `CreateAssessment` or `AnnotateAssessment` call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SearchRelatedAccountGroupMembershipsPagedResponse
Expand Down Expand Up @@ -1420,10 +1550,10 @@ public final ListRelatedAccountGroupMembershipsPagedResponse listRelatedAccountG
* }</pre>
*
* @param project Required. The name of the project to search related account group memberships
* from, in the format "projects/{project}".
* from. Specify the project name in the following format: "projects/{project}".
* @param hashedAccountId Optional. The unique stable hashed user identifier we should search
* connections to. The identifier should correspond to a `hashed_account_id` provided in a
* previous CreateAssessment or AnnotateAssessment call.
* previous `CreateAssessment` or `AnnotateAssessment` call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SearchRelatedAccountGroupMembershipsPagedResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
import com.google.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse;
import com.google.recaptchaenterprise.v1.Metrics;
import com.google.recaptchaenterprise.v1.MigrateKeyRequest;
import com.google.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest;
import com.google.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse;
import com.google.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest;
import com.google.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse;
import com.google.recaptchaenterprise.v1.UpdateKeyRequest;
Expand Down Expand Up @@ -124,6 +126,13 @@ public UnaryCallSettings<CreateKeyRequest, Key> createKeySettings() {
return ((RecaptchaEnterpriseServiceStubSettings) getStubSettings()).listKeysSettings();
}

/** Returns the object with the settings used for calls to retrieveLegacySecretKey. */
public UnaryCallSettings<RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>
retrieveLegacySecretKeySettings() {
return ((RecaptchaEnterpriseServiceStubSettings) getStubSettings())
.retrieveLegacySecretKeySettings();
}

/** Returns the object with the settings used for calls to getKey. */
public UnaryCallSettings<GetKeyRequest, Key> getKeySettings() {
return ((RecaptchaEnterpriseServiceStubSettings) getStubSettings()).getKeySettings();
Expand Down Expand Up @@ -302,6 +311,13 @@ public UnaryCallSettings.Builder<CreateKeyRequest, Key> createKeySettings() {
return getStubSettingsBuilder().listKeysSettings();
}

/** Returns the builder for the settings used for calls to retrieveLegacySecretKey. */
public UnaryCallSettings.Builder<
RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>
retrieveLegacySecretKeySettings() {
return getStubSettingsBuilder().retrieveLegacySecretKeySettings();
}

/** Returns the builder for the settings used for calls to getKey. */
public UnaryCallSettings.Builder<GetKeyRequest, Key> getKeySettings() {
return getStubSettingsBuilder().getKeySettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"MigrateKey": {
"methods": ["migrateKey", "migrateKeyCallable"]
},
"RetrieveLegacySecretKey": {
"methods": ["retrieveLegacySecretKey", "retrieveLegacySecretKey", "retrieveLegacySecretKey", "retrieveLegacySecretKeyCallable"]
},
"SearchRelatedAccountGroupMemberships": {
"methods": ["searchRelatedAccountGroupMemberships", "searchRelatedAccountGroupMemberships", "searchRelatedAccountGroupMemberships", "searchRelatedAccountGroupMembershipsPagedCallable", "searchRelatedAccountGroupMembershipsCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import com.google.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse;
import com.google.recaptchaenterprise.v1.Metrics;
import com.google.recaptchaenterprise.v1.MigrateKeyRequest;
import com.google.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest;
import com.google.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse;
import com.google.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest;
import com.google.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse;
import com.google.recaptchaenterprise.v1.UpdateKeyRequest;
Expand Down Expand Up @@ -106,6 +108,20 @@ public class GrpcRecaptchaEnterpriseServiceStub extends RecaptchaEnterpriseServi
.setResponseMarshaller(ProtoUtils.marshaller(ListKeysResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<
RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>
retrieveLegacySecretKeyMethodDescriptor =
MethodDescriptor
.<RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseService/RetrieveLegacySecretKey")
.setRequestMarshaller(
ProtoUtils.marshaller(RetrieveLegacySecretKeyRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(RetrieveLegacySecretKeyResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<GetKeyRequest, Key> getKeyMethodDescriptor =
MethodDescriptor.<GetKeyRequest, Key>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
Expand Down Expand Up @@ -207,6 +223,8 @@ public class GrpcRecaptchaEnterpriseServiceStub extends RecaptchaEnterpriseServi
private final UnaryCallable<CreateKeyRequest, Key> createKeyCallable;
private final UnaryCallable<ListKeysRequest, ListKeysResponse> listKeysCallable;
private final UnaryCallable<ListKeysRequest, ListKeysPagedResponse> listKeysPagedCallable;
private final UnaryCallable<RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>
retrieveLegacySecretKeyCallable;
private final UnaryCallable<GetKeyRequest, Key> getKeyCallable;
private final UnaryCallable<UpdateKeyRequest, Key> updateKeyCallable;
private final UnaryCallable<DeleteKeyRequest, Empty> deleteKeyCallable;
Expand Down Expand Up @@ -320,6 +338,18 @@ protected GrpcRecaptchaEnterpriseServiceStub(
return params.build();
})
.build();
GrpcCallSettings<RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>
retrieveLegacySecretKeyTransportSettings =
GrpcCallSettings
.<RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>newBuilder()
.setMethodDescriptor(retrieveLegacySecretKeyMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("key", String.valueOf(request.getKey()));
return params.build();
})
.build();
GrpcCallSettings<GetKeyRequest, Key> getKeyTransportSettings =
GrpcCallSettings.<GetKeyRequest, Key>newBuilder()
.setMethodDescriptor(getKeyMethodDescriptor)
Expand Down Expand Up @@ -431,6 +461,11 @@ protected GrpcRecaptchaEnterpriseServiceStub(
this.listKeysPagedCallable =
callableFactory.createPagedCallable(
listKeysTransportSettings, settings.listKeysSettings(), clientContext);
this.retrieveLegacySecretKeyCallable =
callableFactory.createUnaryCallable(
retrieveLegacySecretKeyTransportSettings,
settings.retrieveLegacySecretKeySettings(),
clientContext);
this.getKeyCallable =
callableFactory.createUnaryCallable(
getKeyTransportSettings, settings.getKeySettings(), clientContext);
Expand Down Expand Up @@ -511,6 +546,12 @@ public UnaryCallable<ListKeysRequest, ListKeysPagedResponse> listKeysPagedCallab
return listKeysPagedCallable;
}

@Override
public UnaryCallable<RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>
retrieveLegacySecretKeyCallable() {
return retrieveLegacySecretKeyCallable;
}

@Override
public UnaryCallable<GetKeyRequest, Key> getKeyCallable() {
return getKeyCallable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import com.google.recaptchaenterprise.v1.ListRelatedAccountGroupsResponse;
import com.google.recaptchaenterprise.v1.Metrics;
import com.google.recaptchaenterprise.v1.MigrateKeyRequest;
import com.google.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest;
import com.google.recaptchaenterprise.v1.RetrieveLegacySecretKeyResponse;
import com.google.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsRequest;
import com.google.recaptchaenterprise.v1.SearchRelatedAccountGroupMembershipsResponse;
import com.google.recaptchaenterprise.v1.UpdateKeyRequest;
Expand Down Expand Up @@ -76,6 +78,11 @@ public UnaryCallable<ListKeysRequest, ListKeysResponse> listKeysCallable() {
throw new UnsupportedOperationException("Not implemented: listKeysCallable()");
}

public UnaryCallable<RetrieveLegacySecretKeyRequest, RetrieveLegacySecretKeyResponse>
retrieveLegacySecretKeyCallable() {
throw new UnsupportedOperationException("Not implemented: retrieveLegacySecretKeyCallable()");
}

public UnaryCallable<GetKeyRequest, Key> getKeyCallable() {
throw new UnsupportedOperationException("Not implemented: getKeyCallable()");
}
Expand Down
Loading

0 comments on commit 7c4dfe5

Please sign in to comment.