Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
feat: replace java_outer_classname option with use_java_stubby_librar…
Browse files Browse the repository at this point in the history
…y, add DisableServiceAccountKey and EnableServiceAccountKey, and update comments (#170)

* feat: replace java_outer_classname option with use_java_stubby_library, add DisableServiceAccountKey and EnableServiceAccountKey, and update comments

PiperOrigin-RevId: 474647927

Source-Link: googleapis/googleapis@a0a740c

Source-Link: googleapis/googleapis-gen@5849ad1
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTg0OWFkMTEwZjI1ZWVmMWUwOGRhZjI5YmQ1YTgxZjExZmI2NTQyNCJ9

* 🦉 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 Sep 22, 2022
1 parent f3a0571 commit 9aac609
Show file tree
Hide file tree
Showing 77 changed files with 4,231 additions and 1,400 deletions.

Large diffs are not rendered by default.

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
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
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
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
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
Expand Up @@ -53,7 +53,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 @@ -162,6 +164,10 @@ public class IAMStubSettings extends StubSettings<IAMStubSettings> {
uploadServiceAccountKeySettings;
private final UnaryCallSettings<DeleteServiceAccountKeyRequest, Empty>
deleteServiceAccountKeySettings;
private final UnaryCallSettings<DisableServiceAccountKeyRequest, Empty>
disableServiceAccountKeySettings;
private final UnaryCallSettings<EnableServiceAccountKeyRequest, Empty>
enableServiceAccountKeySettings;
private final UnaryCallSettings<SignBlobRequest, SignBlobResponse> signBlobSettings;
private final UnaryCallSettings<SignJwtRequest, SignJwtResponse> signJwtSettings;
private final UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings;
Expand Down Expand Up @@ -510,6 +516,18 @@ public UnaryCallSettings<DisableServiceAccountRequest, Empty> disableServiceAcco
return deleteServiceAccountKeySettings;
}

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

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

/**
* Returns the object with the settings used for calls to signBlob.
*
Expand Down Expand Up @@ -692,6 +710,8 @@ protected IAMStubSettings(Builder settingsBuilder) throws IOException {
createServiceAccountKeySettings = settingsBuilder.createServiceAccountKeySettings().build();
uploadServiceAccountKeySettings = settingsBuilder.uploadServiceAccountKeySettings().build();
deleteServiceAccountKeySettings = settingsBuilder.deleteServiceAccountKeySettings().build();
disableServiceAccountKeySettings = settingsBuilder.disableServiceAccountKeySettings().build();
enableServiceAccountKeySettings = settingsBuilder.enableServiceAccountKeySettings().build();
signBlobSettings = settingsBuilder.signBlobSettings().build();
signJwtSettings = settingsBuilder.signJwtSettings().build();
getIamPolicySettings = settingsBuilder.getIamPolicySettings().build();
Expand Down Expand Up @@ -745,6 +765,10 @@ public static class Builder extends StubSettings.Builder<IAMStubSettings, Builde
uploadServiceAccountKeySettings;
private final UnaryCallSettings.Builder<DeleteServiceAccountKeyRequest, Empty>
deleteServiceAccountKeySettings;
private final UnaryCallSettings.Builder<DisableServiceAccountKeyRequest, Empty>
disableServiceAccountKeySettings;
private final UnaryCallSettings.Builder<EnableServiceAccountKeyRequest, Empty>
enableServiceAccountKeySettings;
private final UnaryCallSettings.Builder<SignBlobRequest, SignBlobResponse> signBlobSettings;
private final UnaryCallSettings.Builder<SignJwtRequest, SignJwtResponse> signJwtSettings;
private final UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings;
Expand Down Expand Up @@ -842,6 +866,8 @@ protected Builder(ClientContext clientContext) {
createServiceAccountKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
uploadServiceAccountKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteServiceAccountKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
disableServiceAccountKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
enableServiceAccountKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
signBlobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
signJwtSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
Expand Down Expand Up @@ -876,6 +902,8 @@ protected Builder(ClientContext clientContext) {
createServiceAccountKeySettings,
uploadServiceAccountKeySettings,
deleteServiceAccountKeySettings,
disableServiceAccountKeySettings,
enableServiceAccountKeySettings,
signBlobSettings,
signJwtSettings,
getIamPolicySettings,
Expand Down Expand Up @@ -911,6 +939,8 @@ protected Builder(IAMStubSettings settings) {
createServiceAccountKeySettings = settings.createServiceAccountKeySettings.toBuilder();
uploadServiceAccountKeySettings = settings.uploadServiceAccountKeySettings.toBuilder();
deleteServiceAccountKeySettings = settings.deleteServiceAccountKeySettings.toBuilder();
disableServiceAccountKeySettings = settings.disableServiceAccountKeySettings.toBuilder();
enableServiceAccountKeySettings = settings.enableServiceAccountKeySettings.toBuilder();
signBlobSettings = settings.signBlobSettings.toBuilder();
signJwtSettings = settings.signJwtSettings.toBuilder();
getIamPolicySettings = settings.getIamPolicySettings.toBuilder();
Expand Down Expand Up @@ -943,6 +973,8 @@ protected Builder(IAMStubSettings settings) {
createServiceAccountKeySettings,
uploadServiceAccountKeySettings,
deleteServiceAccountKeySettings,
disableServiceAccountKeySettings,
enableServiceAccountKeySettings,
signBlobSettings,
signJwtSettings,
getIamPolicySettings,
Expand Down Expand Up @@ -1044,6 +1076,16 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.disableServiceAccountKeySettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.enableServiceAccountKeySettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.signBlobSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
Expand Down Expand Up @@ -1224,6 +1266,18 @@ public Builder applyToAllUnaryMethods(
return deleteServiceAccountKeySettings;
}

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

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

/**
* Returns the builder for the settings used for calls to signBlob.
*
Expand Down

0 comments on commit 9aac609

Please sign in to comment.