Skip to content

Commit 8f2119d

Browse files
feat: [cloudkms] add support for Coordinated External Keys (#9197)
* feat: add support for Coordinated External Keys PiperOrigin-RevId: 514450927 Source-Link: googleapis/googleapis@de50ec6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/8a0f354d4773e369028c8109a0533fc30386844b 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>
1 parent f31a54d commit 8f2119d

36 files changed

+5947
-155
lines changed

java-kms/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Java idiomatic client for [Cloud Key Management Service][product-docs].
1414

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

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

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

4038
## Authentication
4139

java-kms/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/EkmServiceClient.java

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,212 @@ public final EkmConnection updateEkmConnection(UpdateEkmConnectionRequest reques
714714
return stub.updateEkmConnectionCallable();
715715
}
716716

717+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
718+
/**
719+
* Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
720+
* and location.
721+
*
722+
* <p>Sample code:
723+
*
724+
* <pre>{@code
725+
* // This snippet has been automatically generated and should be regarded as a code template only.
726+
* // It will require modifications to work:
727+
* // - It may require correct/in-range values for request initialization.
728+
* // - It may require specifying regional endpoints when creating the service client as shown in
729+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
730+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
731+
* EkmConfigName name = EkmConfigName.of("[PROJECT]", "[LOCATION]");
732+
* EkmConfig response = ekmServiceClient.getEkmConfig(name);
733+
* }
734+
* }</pre>
735+
*
736+
* @param name Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the
737+
* [EkmConfig][google.cloud.kms.v1.EkmConfig] to get.
738+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
739+
*/
740+
public final EkmConfig getEkmConfig(EkmConfigName name) {
741+
GetEkmConfigRequest request =
742+
GetEkmConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build();
743+
return getEkmConfig(request);
744+
}
745+
746+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
747+
/**
748+
* Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
749+
* and location.
750+
*
751+
* <p>Sample code:
752+
*
753+
* <pre>{@code
754+
* // This snippet has been automatically generated and should be regarded as a code template only.
755+
* // It will require modifications to work:
756+
* // - It may require correct/in-range values for request initialization.
757+
* // - It may require specifying regional endpoints when creating the service client as shown in
758+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
759+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
760+
* String name = EkmConfigName.of("[PROJECT]", "[LOCATION]").toString();
761+
* EkmConfig response = ekmServiceClient.getEkmConfig(name);
762+
* }
763+
* }</pre>
764+
*
765+
* @param name Required. The [name][google.cloud.kms.v1.EkmConfig.name] of the
766+
* [EkmConfig][google.cloud.kms.v1.EkmConfig] to get.
767+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
768+
*/
769+
public final EkmConfig getEkmConfig(String name) {
770+
GetEkmConfigRequest request = GetEkmConfigRequest.newBuilder().setName(name).build();
771+
return getEkmConfig(request);
772+
}
773+
774+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
775+
/**
776+
* Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
777+
* and location.
778+
*
779+
* <p>Sample code:
780+
*
781+
* <pre>{@code
782+
* // This snippet has been automatically generated and should be regarded as a code template only.
783+
* // It will require modifications to work:
784+
* // - It may require correct/in-range values for request initialization.
785+
* // - It may require specifying regional endpoints when creating the service client as shown in
786+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
787+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
788+
* GetEkmConfigRequest request =
789+
* GetEkmConfigRequest.newBuilder()
790+
* .setName(EkmConfigName.of("[PROJECT]", "[LOCATION]").toString())
791+
* .build();
792+
* EkmConfig response = ekmServiceClient.getEkmConfig(request);
793+
* }
794+
* }</pre>
795+
*
796+
* @param request The request object containing all of the parameters for the API call.
797+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
798+
*/
799+
public final EkmConfig getEkmConfig(GetEkmConfigRequest request) {
800+
return getEkmConfigCallable().call(request);
801+
}
802+
803+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
804+
/**
805+
* Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
806+
* and location.
807+
*
808+
* <p>Sample code:
809+
*
810+
* <pre>{@code
811+
* // This snippet has been automatically generated and should be regarded as a code template only.
812+
* // It will require modifications to work:
813+
* // - It may require correct/in-range values for request initialization.
814+
* // - It may require specifying regional endpoints when creating the service client as shown in
815+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
816+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
817+
* GetEkmConfigRequest request =
818+
* GetEkmConfigRequest.newBuilder()
819+
* .setName(EkmConfigName.of("[PROJECT]", "[LOCATION]").toString())
820+
* .build();
821+
* ApiFuture<EkmConfig> future = ekmServiceClient.getEkmConfigCallable().futureCall(request);
822+
* // Do something.
823+
* EkmConfig response = future.get();
824+
* }
825+
* }</pre>
826+
*/
827+
public final UnaryCallable<GetEkmConfigRequest, EkmConfig> getEkmConfigCallable() {
828+
return stub.getEkmConfigCallable();
829+
}
830+
831+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
832+
/**
833+
* Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
834+
* and location.
835+
*
836+
* <p>Sample code:
837+
*
838+
* <pre>{@code
839+
* // This snippet has been automatically generated and should be regarded as a code template only.
840+
* // It will require modifications to work:
841+
* // - It may require correct/in-range values for request initialization.
842+
* // - It may require specifying regional endpoints when creating the service client as shown in
843+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
844+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
845+
* EkmConfig ekmConfig = EkmConfig.newBuilder().build();
846+
* FieldMask updateMask = FieldMask.newBuilder().build();
847+
* EkmConfig response = ekmServiceClient.updateEkmConfig(ekmConfig, updateMask);
848+
* }
849+
* }</pre>
850+
*
851+
* @param ekmConfig Required. [EkmConfig][google.cloud.kms.v1.EkmConfig] with updated values.
852+
* @param updateMask Required. List of fields to be updated in this request.
853+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
854+
*/
855+
public final EkmConfig updateEkmConfig(EkmConfig ekmConfig, FieldMask updateMask) {
856+
UpdateEkmConfigRequest request =
857+
UpdateEkmConfigRequest.newBuilder()
858+
.setEkmConfig(ekmConfig)
859+
.setUpdateMask(updateMask)
860+
.build();
861+
return updateEkmConfig(request);
862+
}
863+
864+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
865+
/**
866+
* Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
867+
* and location.
868+
*
869+
* <p>Sample code:
870+
*
871+
* <pre>{@code
872+
* // This snippet has been automatically generated and should be regarded as a code template only.
873+
* // It will require modifications to work:
874+
* // - It may require correct/in-range values for request initialization.
875+
* // - It may require specifying regional endpoints when creating the service client as shown in
876+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
877+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
878+
* UpdateEkmConfigRequest request =
879+
* UpdateEkmConfigRequest.newBuilder()
880+
* .setEkmConfig(EkmConfig.newBuilder().build())
881+
* .setUpdateMask(FieldMask.newBuilder().build())
882+
* .build();
883+
* EkmConfig response = ekmServiceClient.updateEkmConfig(request);
884+
* }
885+
* }</pre>
886+
*
887+
* @param request The request object containing all of the parameters for the API call.
888+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
889+
*/
890+
public final EkmConfig updateEkmConfig(UpdateEkmConfigRequest request) {
891+
return updateEkmConfigCallable().call(request);
892+
}
893+
894+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
895+
/**
896+
* Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource for a given project
897+
* and location.
898+
*
899+
* <p>Sample code:
900+
*
901+
* <pre>{@code
902+
* // This snippet has been automatically generated and should be regarded as a code template only.
903+
* // It will require modifications to work:
904+
* // - It may require correct/in-range values for request initialization.
905+
* // - It may require specifying regional endpoints when creating the service client as shown in
906+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
907+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
908+
* UpdateEkmConfigRequest request =
909+
* UpdateEkmConfigRequest.newBuilder()
910+
* .setEkmConfig(EkmConfig.newBuilder().build())
911+
* .setUpdateMask(FieldMask.newBuilder().build())
912+
* .build();
913+
* ApiFuture<EkmConfig> future = ekmServiceClient.updateEkmConfigCallable().futureCall(request);
914+
* // Do something.
915+
* EkmConfig response = future.get();
916+
* }
917+
* }</pre>
918+
*/
919+
public final UnaryCallable<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigCallable() {
920+
return stub.updateEkmConfigCallable();
921+
}
922+
717923
// AUTO-GENERATED DOCUMENTATION AND METHOD.
718924
/**
719925
* Lists information about the supported locations for this service.

java-kms/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/EkmServiceSettings.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ public UnaryCallSettings<GetEkmConnectionRequest, EkmConnection> getEkmConnectio
108108
return ((EkmServiceStubSettings) getStubSettings()).updateEkmConnectionSettings();
109109
}
110110

111+
/** Returns the object with the settings used for calls to getEkmConfig. */
112+
public UnaryCallSettings<GetEkmConfigRequest, EkmConfig> getEkmConfigSettings() {
113+
return ((EkmServiceStubSettings) getStubSettings()).getEkmConfigSettings();
114+
}
115+
116+
/** Returns the object with the settings used for calls to updateEkmConfig. */
117+
public UnaryCallSettings<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigSettings() {
118+
return ((EkmServiceStubSettings) getStubSettings()).updateEkmConfigSettings();
119+
}
120+
111121
/** Returns the object with the settings used for calls to listLocations. */
112122
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
113123
listLocationsSettings() {
@@ -274,6 +284,16 @@ public Builder applyToAllUnaryMethods(
274284
return getStubSettingsBuilder().updateEkmConnectionSettings();
275285
}
276286

287+
/** Returns the builder for the settings used for calls to getEkmConfig. */
288+
public UnaryCallSettings.Builder<GetEkmConfigRequest, EkmConfig> getEkmConfigSettings() {
289+
return getStubSettingsBuilder().getEkmConfigSettings();
290+
}
291+
292+
/** Returns the builder for the settings used for calls to updateEkmConfig. */
293+
public UnaryCallSettings.Builder<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigSettings() {
294+
return getStubSettingsBuilder().updateEkmConfigSettings();
295+
}
296+
277297
/** Returns the builder for the settings used for calls to listLocations. */
278298
public PagedCallSettings.Builder<
279299
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>

java-kms/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/gapic_metadata.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"CreateEkmConnection": {
1414
"methods": ["createEkmConnection", "createEkmConnection", "createEkmConnection", "createEkmConnectionCallable"]
1515
},
16+
"GetEkmConfig": {
17+
"methods": ["getEkmConfig", "getEkmConfig", "getEkmConfig", "getEkmConfigCallable"]
18+
},
1619
"GetEkmConnection": {
1720
"methods": ["getEkmConnection", "getEkmConnection", "getEkmConnection", "getEkmConnectionCallable"]
1821
},
@@ -34,6 +37,9 @@
3437
"TestIamPermissions": {
3538
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
3639
},
40+
"UpdateEkmConfig": {
41+
"methods": ["updateEkmConfig", "updateEkmConfig", "updateEkmConfigCallable"]
42+
},
3743
"UpdateEkmConnection": {
3844
"methods": ["updateEkmConnection", "updateEkmConnection", "updateEkmConnectionCallable"]
3945
}

java-kms/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/EkmServiceStub.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
import com.google.api.gax.core.BackgroundResource;
2323
import com.google.api.gax.rpc.UnaryCallable;
2424
import com.google.cloud.kms.v1.CreateEkmConnectionRequest;
25+
import com.google.cloud.kms.v1.EkmConfig;
2526
import com.google.cloud.kms.v1.EkmConnection;
27+
import com.google.cloud.kms.v1.GetEkmConfigRequest;
2628
import com.google.cloud.kms.v1.GetEkmConnectionRequest;
2729
import com.google.cloud.kms.v1.ListEkmConnectionsRequest;
2830
import com.google.cloud.kms.v1.ListEkmConnectionsResponse;
31+
import com.google.cloud.kms.v1.UpdateEkmConfigRequest;
2932
import com.google.cloud.kms.v1.UpdateEkmConnectionRequest;
3033
import com.google.cloud.location.GetLocationRequest;
3134
import com.google.cloud.location.ListLocationsRequest;
@@ -69,6 +72,14 @@ public UnaryCallable<UpdateEkmConnectionRequest, EkmConnection> updateEkmConnect
6972
throw new UnsupportedOperationException("Not implemented: updateEkmConnectionCallable()");
7073
}
7174

75+
public UnaryCallable<GetEkmConfigRequest, EkmConfig> getEkmConfigCallable() {
76+
throw new UnsupportedOperationException("Not implemented: getEkmConfigCallable()");
77+
}
78+
79+
public UnaryCallable<UpdateEkmConfigRequest, EkmConfig> updateEkmConfigCallable() {
80+
throw new UnsupportedOperationException("Not implemented: updateEkmConfigCallable()");
81+
}
82+
7283
public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
7384
listLocationsPagedCallable() {
7485
throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");

0 commit comments

Comments
 (0)