feat!: [iam-admin] replace java_outer_classname option with use_java_stubby_library, add DisableServiceAccountKey and EnableServiceAccountKey, and update comments by gcf-owl-bot[bot] · Pull Request #8412 · googleapis/google-cloud-java · GitHub
Skip to content
Merged
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
6 changes: 3 additions & 3 deletions java-iam-admin/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
import com.google.iam.admin.v1.DeleteRoleRequest;
import com.google.iam.admin.v1.DeleteServiceAccountKeyRequest;
import com.google.iam.admin.v1.DeleteServiceAccountRequest;
import com.google.iam.admin.v1.DisableServiceAccountKeyRequest;
import com.google.iam.admin.v1.DisableServiceAccountRequest;
import com.google.iam.admin.v1.EnableServiceAccountKeyRequest;
import com.google.iam.admin.v1.EnableServiceAccountRequest;
import com.google.iam.admin.v1.GetRoleRequest;
import com.google.iam.admin.v1.GetServiceAccountKeyRequest;
Expand Down Expand Up @@ -197,6 +199,18 @@ public UnaryCallSettings<DisableServiceAccountRequest, Empty> disableServiceAcco
return ((IAMStubSettings) getStubSettings()).deleteServiceAccountKeySettings();
}

/** Returns the object with the settings used for calls to disableServiceAccountKey. */
public UnaryCallSettings<DisableServiceAccountKeyRequest, Empty>
disableServiceAccountKeySettings() {
return ((IAMStubSettings) getStubSettings()).disableServiceAccountKeySettings();
}

/** Returns the object with the settings used for calls to enableServiceAccountKey. */
public UnaryCallSettings<EnableServiceAccountKeyRequest, Empty>
enableServiceAccountKeySettings() {
return ((IAMStubSettings) getStubSettings()).enableServiceAccountKeySettings();
}

/**
* Returns the object with the settings used for calls to signBlob.
*
Expand Down Expand Up @@ -474,6 +488,18 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().deleteServiceAccountKeySettings();
}

/** Returns the builder for the settings used for calls to disableServiceAccountKey. */
public UnaryCallSettings.Builder<DisableServiceAccountKeyRequest, Empty>
disableServiceAccountKeySettings() {
return getStubSettingsBuilder().disableServiceAccountKeySettings();
}

/** Returns the builder for the settings used for calls to enableServiceAccountKey. */
public UnaryCallSettings.Builder<EnableServiceAccountKeyRequest, Empty>
enableServiceAccountKeySettings() {
return getStubSettingsBuilder().enableServiceAccountKeySettings();
}

/**
* Returns the builder for the settings used for calls to signBlob.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@
"DisableServiceAccount": {
"methods": ["disableServiceAccount", "disableServiceAccountCallable"]
},
"DisableServiceAccountKey": {
"methods": ["disableServiceAccountKey", "disableServiceAccountKey", "disableServiceAccountKey", "disableServiceAccountKeyCallable"]
},
"EnableServiceAccount": {
"methods": ["enableServiceAccount", "enableServiceAccountCallable"]
},
"EnableServiceAccountKey": {
"methods": ["enableServiceAccountKey", "enableServiceAccountKey", "enableServiceAccountKey", "enableServiceAccountKeyCallable"]
},
"GetIamPolicy": {
"methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/

/**
* The interfaces provided are listed below, along with usage samples.
* A client to Identity and Access Management (IAM) API
*
* <p>The interfaces provided are listed below, along with usage samples.
*
* <p>======================= IAMClient =======================
*
Expand All @@ -29,9 +31,9 @@
* <li>&#42;&#42;Service account keys&#42;&#42;, which service accounts use to authenticate with
* Google APIs
* <li>&#42;&#42;IAM policies for service accounts&#42;&#42;, which specify the roles that a
* member has for the service account
* principal has for the service account
* <li>&#42;&#42;IAM custom roles&#42;&#42;, which help you limit the number of permissions that
* you grant to members
* you grant to principals
* </ul>
*
* <p>In addition, you can use this service to complete the following tasks, among others:
Expand All @@ -42,6 +44,14 @@
* <li>Lint, or validate, condition expressions in an IAM policy
* </ul>
*
* <p>When you read data from the IAM API, each read is eventually consistent. In other words, if
* you write data with the IAM API, then immediately read that data, the read operation might return
* an older version of the data. To deal with this behavior, your application can retry the request
* with truncated exponential backoff.
*
* <p>In contrast, writing data to the IAM API is sequentially consistent. In other words, write
* operations are always processed in the order in which they were received.
*
* <p>Sample for IAMClient:
*
* <pre>{@code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
import com.google.iam.admin.v1.DeleteRoleRequest;
import com.google.iam.admin.v1.DeleteServiceAccountKeyRequest;
import com.google.iam.admin.v1.DeleteServiceAccountRequest;
import com.google.iam.admin.v1.DisableServiceAccountKeyRequest;
import com.google.iam.admin.v1.DisableServiceAccountRequest;
import com.google.iam.admin.v1.EnableServiceAccountKeyRequest;
import com.google.iam.admin.v1.EnableServiceAccountRequest;
import com.google.iam.admin.v1.GetRoleRequest;
import com.google.iam.admin.v1.GetServiceAccountKeyRequest;
Expand Down Expand Up @@ -233,6 +235,26 @@ public class GrpcIAMStub extends IAMStub {
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();

private static final MethodDescriptor<DisableServiceAccountKeyRequest, Empty>
disableServiceAccountKeyMethodDescriptor =
MethodDescriptor.<DisableServiceAccountKeyRequest, Empty>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/DisableServiceAccountKey")
.setRequestMarshaller(
ProtoUtils.marshaller(DisableServiceAccountKeyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();

private static final MethodDescriptor<EnableServiceAccountKeyRequest, Empty>
enableServiceAccountKeyMethodDescriptor =
MethodDescriptor.<EnableServiceAccountKeyRequest, Empty>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.iam.admin.v1.IAM/EnableServiceAccountKey")
.setRequestMarshaller(
ProtoUtils.marshaller(EnableServiceAccountKeyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();

private static final MethodDescriptor<SignBlobRequest, SignBlobResponse>
signBlobMethodDescriptor =
MethodDescriptor.<SignBlobRequest, SignBlobResponse>newBuilder()
Expand Down Expand Up @@ -397,6 +419,10 @@ public class GrpcIAMStub extends IAMStub {
uploadServiceAccountKeyCallable;
private final UnaryCallable<DeleteServiceAccountKeyRequest, Empty>
deleteServiceAccountKeyCallable;
private final UnaryCallable<DisableServiceAccountKeyRequest, Empty>
disableServiceAccountKeyCallable;
private final UnaryCallable<EnableServiceAccountKeyRequest, Empty>
enableServiceAccountKeyCallable;
private final UnaryCallable<SignBlobRequest, SignBlobResponse> signBlobCallable;
private final UnaryCallable<SignJwtRequest, SignJwtResponse> signJwtCallable;
private final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable;
Expand Down Expand Up @@ -613,6 +639,28 @@ protected GrpcIAMStub(
return params.build();
})
.build();
GrpcCallSettings<DisableServiceAccountKeyRequest, Empty>
disableServiceAccountKeyTransportSettings =
GrpcCallSettings.<DisableServiceAccountKeyRequest, Empty>newBuilder()
.setMethodDescriptor(disableServiceAccountKeyMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<EnableServiceAccountKeyRequest, Empty>
enableServiceAccountKeyTransportSettings =
GrpcCallSettings.<EnableServiceAccountKeyRequest, Empty>newBuilder()
.setMethodDescriptor(enableServiceAccountKeyMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<SignBlobRequest, SignBlobResponse> signBlobTransportSettings =
GrpcCallSettings.<SignBlobRequest, SignBlobResponse>newBuilder()
.setMethodDescriptor(signBlobMethodDescriptor)
Expand Down Expand Up @@ -821,6 +869,16 @@ protected GrpcIAMStub(
deleteServiceAccountKeyTransportSettings,
settings.deleteServiceAccountKeySettings(),
clientContext);
this.disableServiceAccountKeyCallable =
callableFactory.createUnaryCallable(
disableServiceAccountKeyTransportSettings,
settings.disableServiceAccountKeySettings(),
clientContext);
this.enableServiceAccountKeyCallable =
callableFactory.createUnaryCallable(
enableServiceAccountKeyTransportSettings,
settings.enableServiceAccountKeySettings(),
clientContext);
this.signBlobCallable =
callableFactory.createUnaryCallable(
signBlobTransportSettings, settings.signBlobSettings(), clientContext);
Expand Down Expand Up @@ -978,6 +1036,16 @@ public UnaryCallable<DeleteServiceAccountKeyRequest, Empty> deleteServiceAccount
return deleteServiceAccountKeyCallable;
}

@Override
public UnaryCallable<DisableServiceAccountKeyRequest, Empty> disableServiceAccountKeyCallable() {
return disableServiceAccountKeyCallable;
}

@Override
public UnaryCallable<EnableServiceAccountKeyRequest, Empty> enableServiceAccountKeyCallable() {
return enableServiceAccountKeyCallable;
}

@Override
public UnaryCallable<SignBlobRequest, SignBlobResponse> signBlobCallable() {
return signBlobCallable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
import com.google.iam.admin.v1.DeleteRoleRequest;
import com.google.iam.admin.v1.DeleteServiceAccountKeyRequest;
import com.google.iam.admin.v1.DeleteServiceAccountRequest;
import com.google.iam.admin.v1.DisableServiceAccountKeyRequest;
import com.google.iam.admin.v1.DisableServiceAccountRequest;
import com.google.iam.admin.v1.EnableServiceAccountKeyRequest;
import com.google.iam.admin.v1.EnableServiceAccountRequest;
import com.google.iam.admin.v1.GetRoleRequest;
import com.google.iam.admin.v1.GetServiceAccountKeyRequest;
Expand Down Expand Up @@ -145,6 +147,14 @@ public UnaryCallable<DeleteServiceAccountKeyRequest, Empty> deleteServiceAccount
throw new UnsupportedOperationException("Not implemented: deleteServiceAccountKeyCallable()");
}

public UnaryCallable<DisableServiceAccountKeyRequest, Empty> disableServiceAccountKeyCallable() {
throw new UnsupportedOperationException("Not implemented: disableServiceAccountKeyCallable()");
}

public UnaryCallable<EnableServiceAccountKeyRequest, Empty> enableServiceAccountKeyCallable() {
throw new UnsupportedOperationException("Not implemented: enableServiceAccountKeyCallable()");
}

@Deprecated
public UnaryCallable<SignBlobRequest, SignBlobResponse> signBlobCallable() {
throw new UnsupportedOperationException("Not implemented: signBlobCallable()");
Expand Down
Loading