Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return ((SecretManagerServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
}

/** Returns the object with the settings used for calls to enableManagedRotation. */
public UnaryCallSettings<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationSettings() {
return ((SecretManagerServiceStubSettings) getStubSettings()).enableManagedRotationSettings();
}

/** Returns the object with the settings used for calls to rotateSecret. */
public UnaryCallSettings<RotateSecretRequest, SecretVersion> rotateSecretSettings() {
return ((SecretManagerServiceStubSettings) getStubSettings()).rotateSecretSettings();
}

public static final SecretManagerServiceSettings create(SecretManagerServiceStubSettings stub)
throws IOException {
return new SecretManagerServiceSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -381,6 +392,17 @@ public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettin
return getStubSettingsBuilder().testIamPermissionsSettings();
}

/** Returns the builder for the settings used for calls to enableManagedRotation. */
public UnaryCallSettings.Builder<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationSettings() {
return getStubSettingsBuilder().enableManagedRotationSettings();
}

/** Returns the builder for the settings used for calls to rotateSecret. */
public UnaryCallSettings.Builder<RotateSecretRequest, SecretVersion> rotateSecretSettings() {
return getStubSettingsBuilder().rotateSecretSettings();
}

@Override
public SecretManagerServiceSettings build() throws IOException {
return new SecretManagerServiceSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"DisableSecretVersion": {
"methods": ["disableSecretVersion", "disableSecretVersion", "disableSecretVersion", "disableSecretVersionCallable"]
},
"EnableManagedRotation": {
"methods": ["enableManagedRotation", "enableManagedRotation", "enableManagedRotation", "enableManagedRotationCallable"]
},
"EnableSecretVersion": {
"methods": ["enableSecretVersion", "enableSecretVersion", "enableSecretVersion", "enableSecretVersionCallable"]
},
Expand All @@ -46,6 +49,9 @@
"ListSecrets": {
"methods": ["listSecrets", "listSecrets", "listSecrets", "listSecrets", "listSecretsPagedCallable", "listSecretsCallable"]
},
"RotateSecret": {
"methods": ["rotateSecret", "rotateSecret", "rotateSecret", "rotateSecretCallable"]
},
"SetIamPolicy": {
"methods": ["setIamPolicy", "setIamPolicyCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
import com.google.cloud.secretmanager.v1.DeleteSecretRequest;
import com.google.cloud.secretmanager.v1.DestroySecretVersionRequest;
import com.google.cloud.secretmanager.v1.DisableSecretVersionRequest;
import com.google.cloud.secretmanager.v1.EnableManagedRotationRequest;
import com.google.cloud.secretmanager.v1.EnableSecretVersionRequest;
import com.google.cloud.secretmanager.v1.GetSecretRequest;
import com.google.cloud.secretmanager.v1.GetSecretVersionRequest;
import com.google.cloud.secretmanager.v1.ListSecretVersionsRequest;
import com.google.cloud.secretmanager.v1.ListSecretVersionsResponse;
import com.google.cloud.secretmanager.v1.ListSecretsRequest;
import com.google.cloud.secretmanager.v1.ListSecretsResponse;
import com.google.cloud.secretmanager.v1.RotateSecretRequest;
import com.google.cloud.secretmanager.v1.Secret;
import com.google.cloud.secretmanager.v1.SecretVersion;
import com.google.cloud.secretmanager.v1.UpdateSecretRequest;
Expand Down Expand Up @@ -230,6 +232,28 @@ public class GrpcSecretManagerServiceStub extends SecretManagerServiceStub {
.setSampledToLocalTracing(true)
.build();

private static final MethodDescriptor<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationMethodDescriptor =
MethodDescriptor.<EnableManagedRotationRequest, SecretVersion>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.secretmanager.v1.SecretManagerService/EnableManagedRotation")
.setRequestMarshaller(
ProtoUtils.marshaller(EnableManagedRotationRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(SecretVersion.getDefaultInstance()))
.setSampledToLocalTracing(true)
.build();

private static final MethodDescriptor<RotateSecretRequest, SecretVersion>
rotateSecretMethodDescriptor =
MethodDescriptor.<RotateSecretRequest, SecretVersion>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.secretmanager.v1.SecretManagerService/RotateSecret")
.setRequestMarshaller(ProtoUtils.marshaller(RotateSecretRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(SecretVersion.getDefaultInstance()))
.setSampledToLocalTracing(true)
.build();

private final UnaryCallable<ListSecretsRequest, ListSecretsResponse> listSecretsCallable;
private final UnaryCallable<ListSecretsRequest, ListSecretsPagedResponse>
listSecretsPagedCallable;
Expand All @@ -255,6 +279,9 @@ public class GrpcSecretManagerServiceStub extends SecretManagerServiceStub {
private final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable;
private final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsCallable;
private final UnaryCallable<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationCallable;
private final UnaryCallable<RotateSecretRequest, SecretVersion> rotateSecretCallable;

private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
Expand Down Expand Up @@ -470,6 +497,29 @@ protected GrpcSecretManagerServiceStub(
})
.setResourceNameExtractor(request -> request.getResource())
.build();
GrpcCallSettings<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationTransportSettings =
GrpcCallSettings.<EnableManagedRotationRequest, SecretVersion>newBuilder()
.setMethodDescriptor(enableManagedRotationMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.setResourceNameExtractor(request -> request.getParent())
.build();
GrpcCallSettings<RotateSecretRequest, SecretVersion> rotateSecretTransportSettings =
GrpcCallSettings.<RotateSecretRequest, SecretVersion>newBuilder()
.setMethodDescriptor(rotateSecretMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.setResourceNameExtractor(request -> request.getParent())
.build();

this.listSecretsCallable =
callableFactory.createUnaryCallable(
Expand Down Expand Up @@ -536,6 +586,14 @@ protected GrpcSecretManagerServiceStub(
testIamPermissionsTransportSettings,
settings.testIamPermissionsSettings(),
clientContext);
this.enableManagedRotationCallable =
callableFactory.createUnaryCallable(
enableManagedRotationTransportSettings,
settings.enableManagedRotationSettings(),
clientContext);
this.rotateSecretCallable =
callableFactory.createUnaryCallable(
rotateSecretTransportSettings, settings.rotateSecretSettings(), clientContext);

this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
Expand Down Expand Up @@ -634,6 +692,17 @@ public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
return testIamPermissionsCallable;
}

@Override
public UnaryCallable<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationCallable() {
return enableManagedRotationCallable;
}

@Override
public UnaryCallable<RotateSecretRequest, SecretVersion> rotateSecretCallable() {
return rotateSecretCallable;
}

@Override
public final void close() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
import com.google.cloud.secretmanager.v1.DeleteSecretRequest;
import com.google.cloud.secretmanager.v1.DestroySecretVersionRequest;
import com.google.cloud.secretmanager.v1.DisableSecretVersionRequest;
import com.google.cloud.secretmanager.v1.EnableManagedRotationRequest;
import com.google.cloud.secretmanager.v1.EnableSecretVersionRequest;
import com.google.cloud.secretmanager.v1.GetSecretRequest;
import com.google.cloud.secretmanager.v1.GetSecretVersionRequest;
import com.google.cloud.secretmanager.v1.ListSecretVersionsRequest;
import com.google.cloud.secretmanager.v1.ListSecretVersionsResponse;
import com.google.cloud.secretmanager.v1.ListSecretsRequest;
import com.google.cloud.secretmanager.v1.ListSecretsResponse;
import com.google.cloud.secretmanager.v1.RotateSecretRequest;
import com.google.cloud.secretmanager.v1.Secret;
import com.google.cloud.secretmanager.v1.SecretVersion;
import com.google.cloud.secretmanager.v1.UpdateSecretRequest;
Expand Down Expand Up @@ -650,6 +652,85 @@ public class HttpJsonSecretManagerServiceStub extends SecretManagerServiceStub {
.build())
.build();

private static final ApiMethodDescriptor<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationMethodDescriptor =
ApiMethodDescriptor.<EnableManagedRotationRequest, SecretVersion>newBuilder()
.setFullMethodName(
"google.cloud.secretmanager.v1.SecretManagerService/EnableManagedRotation")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.<EnableManagedRotationRequest>newBuilder()
.setPath(
"/v1/{parent=projects/*/secrets/*}:enableManagedRotation",
request -> {
Map<String, String> fields = new HashMap<>();
ProtoRestSerializer<EnableManagedRotationRequest> serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setAdditionalPaths(
"/v1/{parent=projects/*/locations/*/secrets/*}:enableManagedRotation")
.setQueryParamsExtractor(
request -> {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<EnableManagedRotationRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<SecretVersion>newBuilder()
.setDefaultInstance(SecretVersion.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();

private static final ApiMethodDescriptor<RotateSecretRequest, SecretVersion>
rotateSecretMethodDescriptor =
ApiMethodDescriptor.<RotateSecretRequest, SecretVersion>newBuilder()
.setFullMethodName("google.cloud.secretmanager.v1.SecretManagerService/RotateSecret")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.<RotateSecretRequest>newBuilder()
.setPath(
"/v1/{parent=projects/*/secrets/*}:rotateSecret",
request -> {
Map<String, String> fields = new HashMap<>();
ProtoRestSerializer<RotateSecretRequest> serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setAdditionalPaths(
"/v1/{parent=projects/*/locations/*/secrets/*}:rotateSecret")
.setQueryParamsExtractor(
request -> {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<RotateSecretRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<SecretVersion>newBuilder()
.setDefaultInstance(SecretVersion.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();

private final UnaryCallable<ListSecretsRequest, ListSecretsResponse> listSecretsCallable;
private final UnaryCallable<ListSecretsRequest, ListSecretsPagedResponse>
listSecretsPagedCallable;
Expand All @@ -675,6 +756,9 @@ public class HttpJsonSecretManagerServiceStub extends SecretManagerServiceStub {
private final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable;
private final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsCallable;
private final UnaryCallable<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationCallable;
private final UnaryCallable<RotateSecretRequest, SecretVersion> rotateSecretCallable;

private final BackgroundResource backgroundResources;
private final HttpJsonStubCallableFactory callableFactory;
Expand Down Expand Up @@ -906,6 +990,31 @@ protected HttpJsonSecretManagerServiceStub(
})
.setResourceNameExtractor(request -> request.getResource())
.build();
HttpJsonCallSettings<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationTransportSettings =
HttpJsonCallSettings.<EnableManagedRotationRequest, SecretVersion>newBuilder()
.setMethodDescriptor(enableManagedRotationMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.setResourceNameExtractor(request -> request.getParent())
.build();
HttpJsonCallSettings<RotateSecretRequest, SecretVersion> rotateSecretTransportSettings =
HttpJsonCallSettings.<RotateSecretRequest, SecretVersion>newBuilder()
.setMethodDescriptor(rotateSecretMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.setResourceNameExtractor(request -> request.getParent())
.build();

this.listSecretsCallable =
callableFactory.createUnaryCallable(
Expand Down Expand Up @@ -972,6 +1081,14 @@ protected HttpJsonSecretManagerServiceStub(
testIamPermissionsTransportSettings,
settings.testIamPermissionsSettings(),
clientContext);
this.enableManagedRotationCallable =
callableFactory.createUnaryCallable(
enableManagedRotationTransportSettings,
settings.enableManagedRotationSettings(),
clientContext);
this.rotateSecretCallable =
callableFactory.createUnaryCallable(
rotateSecretTransportSettings, settings.rotateSecretSettings(), clientContext);

this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
Expand All @@ -995,6 +1112,8 @@ public static List<ApiMethodDescriptor> getMethodDescriptors() {
methodDescriptors.add(setIamPolicyMethodDescriptor);
methodDescriptors.add(getIamPolicyMethodDescriptor);
methodDescriptors.add(testIamPermissionsMethodDescriptor);
methodDescriptors.add(enableManagedRotationMethodDescriptor);
methodDescriptors.add(rotateSecretMethodDescriptor);
return methodDescriptors;
}

Expand Down Expand Up @@ -1087,6 +1206,17 @@ public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
return testIamPermissionsCallable;
}

@Override
public UnaryCallable<EnableManagedRotationRequest, SecretVersion>
enableManagedRotationCallable() {
return enableManagedRotationCallable;
}

@Override
public UnaryCallable<RotateSecretRequest, SecretVersion> rotateSecretCallable() {
return rotateSecretCallable;
}

@Override
public final void close() {
try {
Expand Down
Loading
Loading