Skip to content

Commit

Permalink
feat: [cloudkms] add support for Coordinated External Keys (#9197)
Browse files Browse the repository at this point in the history
* feat: add support for Coordinated External Keys

PiperOrigin-RevId: 514450927

Source-Link: googleapis/googleapis@de50ec6

Source-Link: googleapis/googleapis-gen@8a0f354
Copy-Tag: eyJwIjoiamF2YS1rbXMvLk93bEJvdC55YW1sIiwiaCI6IjhhMGYzNTRkNDc3M2UzNjkwMjhjODEwOWEwNTMzZmMzMDM4Njg0NGIifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Mar 15, 2023
1 parent f31a54d commit 8f2119d
Show file tree
Hide file tree
Showing 36 changed files with 5,947 additions and 155 deletions.
2 changes: 0 additions & 2 deletions java-kms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Java idiomatic client for [Cloud Key Management Service][product-docs].

If you are using Maven, add this to your pom.xml file:

<!--- {x-version-update-start:google-cloud-kms:released} -->

```xml
<dependency>
Expand All @@ -35,7 +34,6 @@ If you are using SBT, add this to your dependencies:
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-kms" % "2.15.0"
```
<!--- {x-version-update-end} -->

## Authentication

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,212 @@ public final EkmConnection updateEkmConnection(UpdateEkmConnectionRequest reques
return stub.updateEkmConnectionCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
* and location.
*
* <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 (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
* EkmConfigName name = EkmConfigName.of("[PROJECT]", "[LOCATION]");
* EkmConfig response = ekmServiceClient.getEkmConfig(name);
* }
* }</pre>
*
* @param name Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the
* [EkmConfig][google.cloud.kms.v1.EkmConfig] to get.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final EkmConfig getEkmConfig(EkmConfigName name) {
GetEkmConfigRequest request =
GetEkmConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getEkmConfig(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
* and location.
*
* <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 (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
* String name = EkmConfigName.of("[PROJECT]", "[LOCATION]").toString();
* EkmConfig response = ekmServiceClient.getEkmConfig(name);
* }
* }</pre>
*
* @param name Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the
* [EkmConfig][google.cloud.kms.v1.EkmConfig] to get.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final EkmConfig getEkmConfig(String name) {
GetEkmConfigRequest request = GetEkmConfigRequest.newBuilder().setName(name).build();
return getEkmConfig(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
* and location.
*
* <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 (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
* GetEkmConfigRequest request =
* GetEkmConfigRequest.newBuilder()
* .setName(EkmConfigName.of("[PROJECT]", "[LOCATION]").toString())
* .build();
* EkmConfig response = ekmServiceClient.getEkmConfig(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 EkmConfig getEkmConfig(GetEkmConfigRequest request) {
return getEkmConfigCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
* and location.
*
* <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 (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
* GetEkmConfigRequest request =
* GetEkmConfigRequest.newBuilder()
* .setName(EkmConfigName.of("[PROJECT]", "[LOCATION]").toString())
* .build();
* ApiFuture<EkmConfig> future = ekmServiceClient.getEkmConfigCallable().futureCall(request);
* // Do something.
* EkmConfig response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<GetEkmConfigRequest, EkmConfig> getEkmConfigCallable() {
return stub.getEkmConfigCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
* and location.
*
* <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 (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
* EkmConfig ekmConfig = EkmConfig.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* EkmConfig response = ekmServiceClient.updateEkmConfig(ekmConfig, updateMask);
* }
* }</pre>
*
* @param ekmConfig Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values.
* @param updateMask Required. List of fields to be updated in this request.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final EkmConfig updateEkmConfig(EkmConfig ekmConfig, FieldMask updateMask) {
UpdateEkmConfigRequest request =
UpdateEkmConfigRequest.newBuilder()
.setEkmConfig(ekmConfig)
.setUpdateMask(updateMask)
.build();
return updateEkmConfig(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
* and location.
*
* <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 (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
* UpdateEkmConfigRequest request =
* UpdateEkmConfigRequest.newBuilder()
* .setEkmConfig(EkmConfig.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* EkmConfig response = ekmServiceClient.updateEkmConfig(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 EkmConfig updateEkmConfig(UpdateEkmConfigRequest request) {
return updateEkmConfigCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
* and location.
*
* <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 (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
* UpdateEkmConfigRequest request =
* UpdateEkmConfigRequest.newBuilder()
* .setEkmConfig(EkmConfig.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<EkmConfig> future = ekmServiceClient.updateEkmConfigCallable().futureCall(request);
* // Do something.
* EkmConfig response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigCallable() {
return stub.updateEkmConfigCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ public UnaryCallSettings<GetEkmConnectionRequest, EkmConnection> getEkmConnectio
return ((EkmServiceStubSettings) getStubSettings()).updateEkmConnectionSettings();
}

/** Returns the object with the settings used for calls to getEkmConfig. */
public UnaryCallSettings<GetEkmConfigRequest, EkmConfig> getEkmConfigSettings() {
return ((EkmServiceStubSettings) getStubSettings()).getEkmConfigSettings();
}

/** Returns the object with the settings used for calls to updateEkmConfig. */
public UnaryCallSettings<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigSettings() {
return ((EkmServiceStubSettings) getStubSettings()).updateEkmConfigSettings();
}

/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
Expand Down Expand Up @@ -274,6 +284,16 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().updateEkmConnectionSettings();
}

/** Returns the builder for the settings used for calls to getEkmConfig. */
public UnaryCallSettings.Builder<GetEkmConfigRequest, EkmConfig> getEkmConfigSettings() {
return getStubSettingsBuilder().getEkmConfigSettings();
}

/** Returns the builder for the settings used for calls to updateEkmConfig. */
public UnaryCallSettings.Builder<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigSettings() {
return getStubSettingsBuilder().updateEkmConfigSettings();
}

/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"CreateEkmConnection": {
"methods": ["createEkmConnection", "createEkmConnection", "createEkmConnection", "createEkmConnectionCallable"]
},
"GetEkmConfig": {
"methods": ["getEkmConfig", "getEkmConfig", "getEkmConfig", "getEkmConfigCallable"]
},
"GetEkmConnection": {
"methods": ["getEkmConnection", "getEkmConnection", "getEkmConnection", "getEkmConnectionCallable"]
},
Expand All @@ -34,6 +37,9 @@
"TestIamPermissions": {
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
},
"UpdateEkmConfig": {
"methods": ["updateEkmConfig", "updateEkmConfig", "updateEkmConfigCallable"]
},
"UpdateEkmConnection": {
"methods": ["updateEkmConnection", "updateEkmConnection", "updateEkmConnectionCallable"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.kms.v1.CreateEkmConnectionRequest;
import com.google.cloud.kms.v1.EkmConfig;
import com.google.cloud.kms.v1.EkmConnection;
import com.google.cloud.kms.v1.GetEkmConfigRequest;
import com.google.cloud.kms.v1.GetEkmConnectionRequest;
import com.google.cloud.kms.v1.ListEkmConnectionsRequest;
import com.google.cloud.kms.v1.ListEkmConnectionsResponse;
import com.google.cloud.kms.v1.UpdateEkmConfigRequest;
import com.google.cloud.kms.v1.UpdateEkmConnectionRequest;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
Expand Down Expand Up @@ -69,6 +72,14 @@ public UnaryCallable<UpdateEkmConnectionRequest, EkmConnection> updateEkmConnect
throw new UnsupportedOperationException("Not implemented: updateEkmConnectionCallable()");
}

public UnaryCallable<GetEkmConfigRequest, EkmConfig> getEkmConfigCallable() {
throw new UnsupportedOperationException("Not implemented: getEkmConfigCallable()");
}

public UnaryCallable<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigCallable() {
throw new UnsupportedOperationException("Not implemented: updateEkmConfigCallable()");
}

public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
listLocationsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");
Expand Down
Loading

0 comments on commit 8f2119d

Please sign in to comment.