diff --git a/google-api-grpc/grpc-google-cloud-iamcredentials-v1/src/main/java/google/iam/credentials/v1/IAMCredentialsGrpc.java b/google-api-grpc/grpc-google-cloud-iamcredentials-v1/src/main/java/google/iam/credentials/v1/IAMCredentialsGrpc.java new file mode 100644 index 000000000000..2d2d7166a441 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-iamcredentials-v1/src/main/java/google/iam/credentials/v1/IAMCredentialsGrpc.java @@ -0,0 +1,929 @@ +package google.iam.credentials.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * A service account is a special type of Google account that belongs to your
+ * application or a virtual machine (VM), instead of to an individual end user.
+ * Your application assumes the identity of the service account to call Google
+ * APIs, so that the users aren't directly involved.
+ * Service account credentials are used to temporarily assume the identity
+ * of the service account. Supported credential types include OAuth 2.0 access
+ * tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and
+ * more.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/iam/credentials/v1/iamcredentials.proto") +public final class IAMCredentialsGrpc { + + private IAMCredentialsGrpc() {} + + public static final String SERVICE_NAME = "google.iam.credentials.v1.IAMCredentials"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGenerateAccessTokenMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateAccessTokenRequest, + com.google.iam.credentials.v1.GenerateAccessTokenResponse> + METHOD_GENERATE_ACCESS_TOKEN = getGenerateAccessTokenMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateAccessTokenRequest, + com.google.iam.credentials.v1.GenerateAccessTokenResponse> + getGenerateAccessTokenMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateAccessTokenRequest, + com.google.iam.credentials.v1.GenerateAccessTokenResponse> + getGenerateAccessTokenMethod() { + return getGenerateAccessTokenMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateAccessTokenRequest, + com.google.iam.credentials.v1.GenerateAccessTokenResponse> + getGenerateAccessTokenMethodHelper() { + io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateAccessTokenRequest, + com.google.iam.credentials.v1.GenerateAccessTokenResponse> + getGenerateAccessTokenMethod; + if ((getGenerateAccessTokenMethod = IAMCredentialsGrpc.getGenerateAccessTokenMethod) == null) { + synchronized (IAMCredentialsGrpc.class) { + if ((getGenerateAccessTokenMethod = IAMCredentialsGrpc.getGenerateAccessTokenMethod) + == null) { + IAMCredentialsGrpc.getGenerateAccessTokenMethod = + getGenerateAccessTokenMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.iam.credentials.v1.IAMCredentials", "GenerateAccessToken")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1.GenerateAccessTokenRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1.GenerateAccessTokenResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new IAMCredentialsMethodDescriptorSupplier("GenerateAccessToken")) + .build(); + } + } + } + return getGenerateAccessTokenMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGenerateIdTokenMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdTokenRequest, + com.google.iam.credentials.v1.GenerateIdTokenResponse> + METHOD_GENERATE_ID_TOKEN = getGenerateIdTokenMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdTokenRequest, + com.google.iam.credentials.v1.GenerateIdTokenResponse> + getGenerateIdTokenMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdTokenRequest, + com.google.iam.credentials.v1.GenerateIdTokenResponse> + getGenerateIdTokenMethod() { + return getGenerateIdTokenMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdTokenRequest, + com.google.iam.credentials.v1.GenerateIdTokenResponse> + getGenerateIdTokenMethodHelper() { + io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdTokenRequest, + com.google.iam.credentials.v1.GenerateIdTokenResponse> + getGenerateIdTokenMethod; + if ((getGenerateIdTokenMethod = IAMCredentialsGrpc.getGenerateIdTokenMethod) == null) { + synchronized (IAMCredentialsGrpc.class) { + if ((getGenerateIdTokenMethod = IAMCredentialsGrpc.getGenerateIdTokenMethod) == null) { + IAMCredentialsGrpc.getGenerateIdTokenMethod = + getGenerateIdTokenMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.iam.credentials.v1.IAMCredentials", "GenerateIdToken")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1.GenerateIdTokenRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1.GenerateIdTokenResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new IAMCredentialsMethodDescriptorSupplier("GenerateIdToken")) + .build(); + } + } + } + return getGenerateIdTokenMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getSignBlobMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignBlobRequest, + com.google.iam.credentials.v1.SignBlobResponse> + METHOD_SIGN_BLOB = getSignBlobMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignBlobRequest, + com.google.iam.credentials.v1.SignBlobResponse> + getSignBlobMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignBlobRequest, + com.google.iam.credentials.v1.SignBlobResponse> + getSignBlobMethod() { + return getSignBlobMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignBlobRequest, + com.google.iam.credentials.v1.SignBlobResponse> + getSignBlobMethodHelper() { + io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignBlobRequest, + com.google.iam.credentials.v1.SignBlobResponse> + getSignBlobMethod; + if ((getSignBlobMethod = IAMCredentialsGrpc.getSignBlobMethod) == null) { + synchronized (IAMCredentialsGrpc.class) { + if ((getSignBlobMethod = IAMCredentialsGrpc.getSignBlobMethod) == null) { + IAMCredentialsGrpc.getSignBlobMethod = + getSignBlobMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.iam.credentials.v1.IAMCredentials", "SignBlob")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1.SignBlobRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1.SignBlobResponse.getDefaultInstance())) + .setSchemaDescriptor(new IAMCredentialsMethodDescriptorSupplier("SignBlob")) + .build(); + } + } + } + return getSignBlobMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getSignJwtMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignJwtRequest, + com.google.iam.credentials.v1.SignJwtResponse> + METHOD_SIGN_JWT = getSignJwtMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignJwtRequest, + com.google.iam.credentials.v1.SignJwtResponse> + getSignJwtMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignJwtRequest, + com.google.iam.credentials.v1.SignJwtResponse> + getSignJwtMethod() { + return getSignJwtMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignJwtRequest, + com.google.iam.credentials.v1.SignJwtResponse> + getSignJwtMethodHelper() { + io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.SignJwtRequest, + com.google.iam.credentials.v1.SignJwtResponse> + getSignJwtMethod; + if ((getSignJwtMethod = IAMCredentialsGrpc.getSignJwtMethod) == null) { + synchronized (IAMCredentialsGrpc.class) { + if ((getSignJwtMethod = IAMCredentialsGrpc.getSignJwtMethod) == null) { + IAMCredentialsGrpc.getSignJwtMethod = + getSignJwtMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.iam.credentials.v1.IAMCredentials", "SignJwt")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1.SignJwtRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1.SignJwtResponse.getDefaultInstance())) + .setSchemaDescriptor(new IAMCredentialsMethodDescriptorSupplier("SignJwt")) + .build(); + } + } + } + return getSignJwtMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGenerateIdentityBindingAccessTokenMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> + METHOD_GENERATE_IDENTITY_BINDING_ACCESS_TOKEN = + getGenerateIdentityBindingAccessTokenMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> + getGenerateIdentityBindingAccessTokenMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> + getGenerateIdentityBindingAccessTokenMethod() { + return getGenerateIdentityBindingAccessTokenMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> + getGenerateIdentityBindingAccessTokenMethodHelper() { + io.grpc.MethodDescriptor< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> + getGenerateIdentityBindingAccessTokenMethod; + if ((getGenerateIdentityBindingAccessTokenMethod = + IAMCredentialsGrpc.getGenerateIdentityBindingAccessTokenMethod) + == null) { + synchronized (IAMCredentialsGrpc.class) { + if ((getGenerateIdentityBindingAccessTokenMethod = + IAMCredentialsGrpc.getGenerateIdentityBindingAccessTokenMethod) + == null) { + IAMCredentialsGrpc.getGenerateIdentityBindingAccessTokenMethod = + getGenerateIdentityBindingAccessTokenMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.iam.credentials.v1.IAMCredentials", + "GenerateIdentityBindingAccessToken")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1 + .GenerateIdentityBindingAccessTokenRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.credentials.v1 + .GenerateIdentityBindingAccessTokenResponse.getDefaultInstance())) + .setSchemaDescriptor( + new IAMCredentialsMethodDescriptorSupplier( + "GenerateIdentityBindingAccessToken")) + .build(); + } + } + } + return getGenerateIdentityBindingAccessTokenMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static IAMCredentialsStub newStub(io.grpc.Channel channel) { + return new IAMCredentialsStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static IAMCredentialsBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new IAMCredentialsBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static IAMCredentialsFutureStub newFutureStub(io.grpc.Channel channel) { + return new IAMCredentialsFutureStub(channel); + } + + /** + * + * + *
+   * A service account is a special type of Google account that belongs to your
+   * application or a virtual machine (VM), instead of to an individual end user.
+   * Your application assumes the identity of the service account to call Google
+   * APIs, so that the users aren't directly involved.
+   * Service account credentials are used to temporarily assume the identity
+   * of the service account. Supported credential types include OAuth 2.0 access
+   * tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and
+   * more.
+   * 
+ */ + public abstract static class IAMCredentialsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Generates an OAuth 2.0 access token for a service account.
+     * 
+ */ + public void generateAccessToken( + com.google.iam.credentials.v1.GenerateAccessTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGenerateAccessTokenMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Generates an OpenID Connect ID token for a service account.
+     * 
+ */ + public void generateIdToken( + com.google.iam.credentials.v1.GenerateIdTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGenerateIdTokenMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Signs a blob using a service account's system-managed private key.
+     * 
+ */ + public void signBlob( + com.google.iam.credentials.v1.SignBlobRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getSignBlobMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Signs a JWT using a service account's system-managed private key.
+     * 
+ */ + public void signJwt( + com.google.iam.credentials.v1.SignJwtRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getSignJwtMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Exchange a JWT signed by third party identity provider to an OAuth 2.0
+     * access token
+     * 
+ */ + public void generateIdentityBindingAccessToken( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest request, + io.grpc.stub.StreamObserver< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> + responseObserver) { + asyncUnimplementedUnaryCall( + getGenerateIdentityBindingAccessTokenMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGenerateAccessTokenMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.credentials.v1.GenerateAccessTokenRequest, + com.google.iam.credentials.v1.GenerateAccessTokenResponse>( + this, METHODID_GENERATE_ACCESS_TOKEN))) + .addMethod( + getGenerateIdTokenMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.credentials.v1.GenerateIdTokenRequest, + com.google.iam.credentials.v1.GenerateIdTokenResponse>( + this, METHODID_GENERATE_ID_TOKEN))) + .addMethod( + getSignBlobMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.credentials.v1.SignBlobRequest, + com.google.iam.credentials.v1.SignBlobResponse>(this, METHODID_SIGN_BLOB))) + .addMethod( + getSignJwtMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.credentials.v1.SignJwtRequest, + com.google.iam.credentials.v1.SignJwtResponse>(this, METHODID_SIGN_JWT))) + .addMethod( + getGenerateIdentityBindingAccessTokenMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse>( + this, METHODID_GENERATE_IDENTITY_BINDING_ACCESS_TOKEN))) + .build(); + } + } + + /** + * + * + *
+   * A service account is a special type of Google account that belongs to your
+   * application or a virtual machine (VM), instead of to an individual end user.
+   * Your application assumes the identity of the service account to call Google
+   * APIs, so that the users aren't directly involved.
+   * Service account credentials are used to temporarily assume the identity
+   * of the service account. Supported credential types include OAuth 2.0 access
+   * tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and
+   * more.
+   * 
+ */ + public static final class IAMCredentialsStub + extends io.grpc.stub.AbstractStub { + private IAMCredentialsStub(io.grpc.Channel channel) { + super(channel); + } + + private IAMCredentialsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IAMCredentialsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IAMCredentialsStub(channel, callOptions); + } + + /** + * + * + *
+     * Generates an OAuth 2.0 access token for a service account.
+     * 
+ */ + public void generateAccessToken( + com.google.iam.credentials.v1.GenerateAccessTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGenerateAccessTokenMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Generates an OpenID Connect ID token for a service account.
+     * 
+ */ + public void generateIdToken( + com.google.iam.credentials.v1.GenerateIdTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGenerateIdTokenMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Signs a blob using a service account's system-managed private key.
+     * 
+ */ + public void signBlob( + com.google.iam.credentials.v1.SignBlobRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSignBlobMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Signs a JWT using a service account's system-managed private key.
+     * 
+ */ + public void signJwt( + com.google.iam.credentials.v1.SignJwtRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSignJwtMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Exchange a JWT signed by third party identity provider to an OAuth 2.0
+     * access token
+     * 
+ */ + public void generateIdentityBindingAccessToken( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest request, + io.grpc.stub.StreamObserver< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> + responseObserver) { + asyncUnaryCall( + getChannel() + .newCall(getGenerateIdentityBindingAccessTokenMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * A service account is a special type of Google account that belongs to your
+   * application or a virtual machine (VM), instead of to an individual end user.
+   * Your application assumes the identity of the service account to call Google
+   * APIs, so that the users aren't directly involved.
+   * Service account credentials are used to temporarily assume the identity
+   * of the service account. Supported credential types include OAuth 2.0 access
+   * tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and
+   * more.
+   * 
+ */ + public static final class IAMCredentialsBlockingStub + extends io.grpc.stub.AbstractStub { + private IAMCredentialsBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private IAMCredentialsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IAMCredentialsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IAMCredentialsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Generates an OAuth 2.0 access token for a service account.
+     * 
+ */ + public com.google.iam.credentials.v1.GenerateAccessTokenResponse generateAccessToken( + com.google.iam.credentials.v1.GenerateAccessTokenRequest request) { + return blockingUnaryCall( + getChannel(), getGenerateAccessTokenMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Generates an OpenID Connect ID token for a service account.
+     * 
+ */ + public com.google.iam.credentials.v1.GenerateIdTokenResponse generateIdToken( + com.google.iam.credentials.v1.GenerateIdTokenRequest request) { + return blockingUnaryCall( + getChannel(), getGenerateIdTokenMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Signs a blob using a service account's system-managed private key.
+     * 
+ */ + public com.google.iam.credentials.v1.SignBlobResponse signBlob( + com.google.iam.credentials.v1.SignBlobRequest request) { + return blockingUnaryCall(getChannel(), getSignBlobMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Signs a JWT using a service account's system-managed private key.
+     * 
+ */ + public com.google.iam.credentials.v1.SignJwtResponse signJwt( + com.google.iam.credentials.v1.SignJwtRequest request) { + return blockingUnaryCall(getChannel(), getSignJwtMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Exchange a JWT signed by third party identity provider to an OAuth 2.0
+     * access token
+     * 
+ */ + public com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse + generateIdentityBindingAccessToken( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest request) { + return blockingUnaryCall( + getChannel(), + getGenerateIdentityBindingAccessTokenMethodHelper(), + getCallOptions(), + request); + } + } + + /** + * + * + *
+   * A service account is a special type of Google account that belongs to your
+   * application or a virtual machine (VM), instead of to an individual end user.
+   * Your application assumes the identity of the service account to call Google
+   * APIs, so that the users aren't directly involved.
+   * Service account credentials are used to temporarily assume the identity
+   * of the service account. Supported credential types include OAuth 2.0 access
+   * tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and
+   * more.
+   * 
+ */ + public static final class IAMCredentialsFutureStub + extends io.grpc.stub.AbstractStub { + private IAMCredentialsFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private IAMCredentialsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IAMCredentialsFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IAMCredentialsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Generates an OAuth 2.0 access token for a service account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.credentials.v1.GenerateAccessTokenResponse> + generateAccessToken(com.google.iam.credentials.v1.GenerateAccessTokenRequest request) { + return futureUnaryCall( + getChannel().newCall(getGenerateAccessTokenMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Generates an OpenID Connect ID token for a service account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.credentials.v1.GenerateIdTokenResponse> + generateIdToken(com.google.iam.credentials.v1.GenerateIdTokenRequest request) { + return futureUnaryCall( + getChannel().newCall(getGenerateIdTokenMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Signs a blob using a service account's system-managed private key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.credentials.v1.SignBlobResponse> + signBlob(com.google.iam.credentials.v1.SignBlobRequest request) { + return futureUnaryCall( + getChannel().newCall(getSignBlobMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Signs a JWT using a service account's system-managed private key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.credentials.v1.SignJwtResponse> + signJwt(com.google.iam.credentials.v1.SignJwtRequest request) { + return futureUnaryCall( + getChannel().newCall(getSignJwtMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Exchange a JWT signed by third party identity provider to an OAuth 2.0
+     * access token
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessToken( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest request) { + return futureUnaryCall( + getChannel() + .newCall(getGenerateIdentityBindingAccessTokenMethodHelper(), getCallOptions()), + request); + } + } + + private static final int METHODID_GENERATE_ACCESS_TOKEN = 0; + private static final int METHODID_GENERATE_ID_TOKEN = 1; + private static final int METHODID_SIGN_BLOB = 2; + private static final int METHODID_SIGN_JWT = 3; + private static final int METHODID_GENERATE_IDENTITY_BINDING_ACCESS_TOKEN = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final IAMCredentialsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(IAMCredentialsImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GENERATE_ACCESS_TOKEN: + serviceImpl.generateAccessToken( + (com.google.iam.credentials.v1.GenerateAccessTokenRequest) request, + (io.grpc.stub.StreamObserver< + com.google.iam.credentials.v1.GenerateAccessTokenResponse>) + responseObserver); + break; + case METHODID_GENERATE_ID_TOKEN: + serviceImpl.generateIdToken( + (com.google.iam.credentials.v1.GenerateIdTokenRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SIGN_BLOB: + serviceImpl.signBlob( + (com.google.iam.credentials.v1.SignBlobRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SIGN_JWT: + serviceImpl.signJwt( + (com.google.iam.credentials.v1.SignJwtRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GENERATE_IDENTITY_BINDING_ACCESS_TOKEN: + serviceImpl.generateIdentityBindingAccessToken( + (com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) request, + (io.grpc.stub.StreamObserver< + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class IAMCredentialsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + IAMCredentialsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return google.iam.credentials.v1.Iamcredentials.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("IAMCredentials"); + } + } + + private static final class IAMCredentialsFileDescriptorSupplier + extends IAMCredentialsBaseDescriptorSupplier { + IAMCredentialsFileDescriptorSupplier() {} + } + + private static final class IAMCredentialsMethodDescriptorSupplier + extends IAMCredentialsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + IAMCredentialsMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (IAMCredentialsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new IAMCredentialsFileDescriptorSupplier()) + .addMethod(getGenerateAccessTokenMethodHelper()) + .addMethod(getGenerateIdTokenMethodHelper()) + .addMethod(getSignBlobMethodHelper()) + .addMethod(getSignJwtMethodHelper()) + .addMethod(getGenerateIdentityBindingAccessTokenMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenRequest.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenRequest.java new file mode 100644 index 000000000000..aa3fb47e0d57 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenRequest.java @@ -0,0 +1,1509 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.GenerateAccessTokenRequest} */ +public final class GenerateAccessTokenRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.GenerateAccessTokenRequest) + GenerateAccessTokenRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateAccessTokenRequest.newBuilder() to construct. + private GenerateAccessTokenRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateAccessTokenRequest() { + name_ = ""; + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + scope_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateAccessTokenRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + delegates_.add(s); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + scope_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + scope_.add(s); + break; + } + case 58: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (lifetime_ != null) { + subBuilder = lifetime_.toBuilder(); + } + lifetime_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lifetime_); + lifetime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = delegates_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + scope_ = scope_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateAccessTokenRequest.class, + com.google.iam.credentials.v1.GenerateAccessTokenRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELEGATES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList delegates_; + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + public com.google.protobuf.ProtocolStringList getDelegatesList() { + return delegates_; + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + public int getDelegatesCount() { + return delegates_.size(); + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + public java.lang.String getDelegates(int index) { + return delegates_.get(index); + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + public com.google.protobuf.ByteString getDelegatesBytes(int index) { + return delegates_.getByteString(index); + } + + public static final int SCOPE_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList scope_; + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 4; + */ + public com.google.protobuf.ProtocolStringList getScopeList() { + return scope_; + } + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 4; + */ + public int getScopeCount() { + return scope_.size(); + } + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 4; + */ + public java.lang.String getScope(int index) { + return scope_.get(index); + } + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 4; + */ + public com.google.protobuf.ByteString getScopeBytes(int index) { + return scope_.getByteString(index); + } + + public static final int LIFETIME_FIELD_NUMBER = 7; + private com.google.protobuf.Duration lifetime_; + /** + * + * + *
+   * The desired lifetime duration of the access token in seconds.
+   * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+   * not specified, the token's lifetime will be set to a default value of one
+   * hour.
+   * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public boolean hasLifetime() { + return lifetime_ != null; + } + /** + * + * + *
+   * The desired lifetime duration of the access token in seconds.
+   * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+   * not specified, the token's lifetime will be set to a default value of one
+   * hour.
+   * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public com.google.protobuf.Duration getLifetime() { + return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_; + } + /** + * + * + *
+   * The desired lifetime duration of the access token in seconds.
+   * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+   * not specified, the token's lifetime will be set to a default value of one
+   * hour.
+   * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public com.google.protobuf.DurationOrBuilder getLifetimeOrBuilder() { + return getLifetime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < delegates_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, delegates_.getRaw(i)); + } + for (int i = 0; i < scope_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, scope_.getRaw(i)); + } + if (lifetime_ != null) { + output.writeMessage(7, getLifetime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < delegates_.size(); i++) { + dataSize += computeStringSizeNoTag(delegates_.getRaw(i)); + } + size += dataSize; + size += 1 * getDelegatesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < scope_.size(); i++) { + dataSize += computeStringSizeNoTag(scope_.getRaw(i)); + } + size += dataSize; + size += 1 * getScopeList().size(); + } + if (lifetime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getLifetime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.credentials.v1.GenerateAccessTokenRequest)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.GenerateAccessTokenRequest other = + (com.google.iam.credentials.v1.GenerateAccessTokenRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && getDelegatesList().equals(other.getDelegatesList()); + result = result && getScopeList().equals(other.getScopeList()); + result = result && (hasLifetime() == other.hasLifetime()); + if (hasLifetime()) { + result = result && getLifetime().equals(other.getLifetime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getDelegatesCount() > 0) { + hash = (37 * hash) + DELEGATES_FIELD_NUMBER; + hash = (53 * hash) + getDelegatesList().hashCode(); + } + if (getScopeCount() > 0) { + hash = (37 * hash) + SCOPE_FIELD_NUMBER; + hash = (53 * hash) + getScopeList().hashCode(); + } + if (hasLifetime()) { + hash = (37 * hash) + LIFETIME_FIELD_NUMBER; + hash = (53 * hash) + getLifetime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.iam.credentials.v1.GenerateAccessTokenRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.GenerateAccessTokenRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.GenerateAccessTokenRequest) + com.google.iam.credentials.v1.GenerateAccessTokenRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateAccessTokenRequest.class, + com.google.iam.credentials.v1.GenerateAccessTokenRequest.Builder.class); + } + + // Construct using com.google.iam.credentials.v1.GenerateAccessTokenRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + scope_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + if (lifetimeBuilder_ == null) { + lifetime_ = null; + } else { + lifetime_ = null; + lifetimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateAccessTokenRequest getDefaultInstanceForType() { + return com.google.iam.credentials.v1.GenerateAccessTokenRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateAccessTokenRequest build() { + com.google.iam.credentials.v1.GenerateAccessTokenRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateAccessTokenRequest buildPartial() { + com.google.iam.credentials.v1.GenerateAccessTokenRequest result = + new com.google.iam.credentials.v1.GenerateAccessTokenRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = delegates_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.delegates_ = delegates_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + scope_ = scope_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.scope_ = scope_; + if (lifetimeBuilder_ == null) { + result.lifetime_ = lifetime_; + } else { + result.lifetime_ = lifetimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.credentials.v1.GenerateAccessTokenRequest) { + return mergeFrom((com.google.iam.credentials.v1.GenerateAccessTokenRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.credentials.v1.GenerateAccessTokenRequest other) { + if (other == com.google.iam.credentials.v1.GenerateAccessTokenRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.delegates_.isEmpty()) { + if (delegates_.isEmpty()) { + delegates_ = other.delegates_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDelegatesIsMutable(); + delegates_.addAll(other.delegates_); + } + onChanged(); + } + if (!other.scope_.isEmpty()) { + if (scope_.isEmpty()) { + scope_ = other.scope_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureScopeIsMutable(); + scope_.addAll(other.scope_); + } + onChanged(); + } + if (other.hasLifetime()) { + mergeLifetime(other.getLifetime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.GenerateAccessTokenRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.iam.credentials.v1.GenerateAccessTokenRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList delegates_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDelegatesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = new com.google.protobuf.LazyStringArrayList(delegates_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public com.google.protobuf.ProtocolStringList getDelegatesList() { + return delegates_.getUnmodifiableView(); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public int getDelegatesCount() { + return delegates_.size(); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public java.lang.String getDelegates(int index) { + return delegates_.get(index); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public com.google.protobuf.ByteString getDelegatesBytes(int index) { + return delegates_.getByteString(index); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder setDelegates(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDelegatesIsMutable(); + delegates_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder addDelegates(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDelegatesIsMutable(); + delegates_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder addAllDelegates(java.lang.Iterable values) { + ensureDelegatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, delegates_); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder clearDelegates() { + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder addDelegatesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDelegatesIsMutable(); + delegates_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList scope_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureScopeIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + scope_ = new com.google.protobuf.LazyStringArrayList(scope_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 4; + */ + public com.google.protobuf.ProtocolStringList getScopeList() { + return scope_.getUnmodifiableView(); + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 4; + */ + public int getScopeCount() { + return scope_.size(); + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 4; + */ + public java.lang.String getScope(int index) { + return scope_.get(index); + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 4; + */ + public com.google.protobuf.ByteString getScopeBytes(int index) { + return scope_.getByteString(index); + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 4; + */ + public Builder setScope(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScopeIsMutable(); + scope_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 4; + */ + public Builder addScope(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScopeIsMutable(); + scope_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 4; + */ + public Builder addAllScope(java.lang.Iterable values) { + ensureScopeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scope_); + onChanged(); + return this; + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 4; + */ + public Builder clearScope() { + scope_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 4; + */ + public Builder addScopeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureScopeIsMutable(); + scope_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Duration lifetime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + lifetimeBuilder_; + /** + * + * + *
+     * The desired lifetime duration of the access token in seconds.
+     * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+     * not specified, the token's lifetime will be set to a default value of one
+     * hour.
+     * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public boolean hasLifetime() { + return lifetimeBuilder_ != null || lifetime_ != null; + } + /** + * + * + *
+     * The desired lifetime duration of the access token in seconds.
+     * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+     * not specified, the token's lifetime will be set to a default value of one
+     * hour.
+     * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public com.google.protobuf.Duration getLifetime() { + if (lifetimeBuilder_ == null) { + return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_; + } else { + return lifetimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The desired lifetime duration of the access token in seconds.
+     * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+     * not specified, the token's lifetime will be set to a default value of one
+     * hour.
+     * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public Builder setLifetime(com.google.protobuf.Duration value) { + if (lifetimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lifetime_ = value; + onChanged(); + } else { + lifetimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The desired lifetime duration of the access token in seconds.
+     * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+     * not specified, the token's lifetime will be set to a default value of one
+     * hour.
+     * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public Builder setLifetime(com.google.protobuf.Duration.Builder builderForValue) { + if (lifetimeBuilder_ == null) { + lifetime_ = builderForValue.build(); + onChanged(); + } else { + lifetimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The desired lifetime duration of the access token in seconds.
+     * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+     * not specified, the token's lifetime will be set to a default value of one
+     * hour.
+     * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public Builder mergeLifetime(com.google.protobuf.Duration value) { + if (lifetimeBuilder_ == null) { + if (lifetime_ != null) { + lifetime_ = + com.google.protobuf.Duration.newBuilder(lifetime_).mergeFrom(value).buildPartial(); + } else { + lifetime_ = value; + } + onChanged(); + } else { + lifetimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The desired lifetime duration of the access token in seconds.
+     * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+     * not specified, the token's lifetime will be set to a default value of one
+     * hour.
+     * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public Builder clearLifetime() { + if (lifetimeBuilder_ == null) { + lifetime_ = null; + onChanged(); + } else { + lifetime_ = null; + lifetimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The desired lifetime duration of the access token in seconds.
+     * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+     * not specified, the token's lifetime will be set to a default value of one
+     * hour.
+     * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public com.google.protobuf.Duration.Builder getLifetimeBuilder() { + + onChanged(); + return getLifetimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The desired lifetime duration of the access token in seconds.
+     * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+     * not specified, the token's lifetime will be set to a default value of one
+     * hour.
+     * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + public com.google.protobuf.DurationOrBuilder getLifetimeOrBuilder() { + if (lifetimeBuilder_ != null) { + return lifetimeBuilder_.getMessageOrBuilder(); + } else { + return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_; + } + } + /** + * + * + *
+     * The desired lifetime duration of the access token in seconds.
+     * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+     * not specified, the token's lifetime will be set to a default value of one
+     * hour.
+     * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getLifetimeFieldBuilder() { + if (lifetimeBuilder_ == null) { + lifetimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getLifetime(), getParentForChildren(), isClean()); + lifetime_ = null; + } + return lifetimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.GenerateAccessTokenRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateAccessTokenRequest) + private static final com.google.iam.credentials.v1.GenerateAccessTokenRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.credentials.v1.GenerateAccessTokenRequest(); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateAccessTokenRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateAccessTokenRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateAccessTokenRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenRequestOrBuilder.java new file mode 100644 index 000000000000..aca2a446b240 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenRequestOrBuilder.java @@ -0,0 +1,197 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface GenerateAccessTokenRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.GenerateAccessTokenRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + java.util.List getDelegatesList(); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + int getDelegatesCount(); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + java.lang.String getDelegates(int index); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + com.google.protobuf.ByteString getDelegatesBytes(int index); + + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 4; + */ + java.util.List getScopeList(); + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 4; + */ + int getScopeCount(); + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 4; + */ + java.lang.String getScope(int index); + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 4; + */ + com.google.protobuf.ByteString getScopeBytes(int index); + + /** + * + * + *
+   * The desired lifetime duration of the access token in seconds.
+   * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+   * not specified, the token's lifetime will be set to a default value of one
+   * hour.
+   * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + boolean hasLifetime(); + /** + * + * + *
+   * The desired lifetime duration of the access token in seconds.
+   * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+   * not specified, the token's lifetime will be set to a default value of one
+   * hour.
+   * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + com.google.protobuf.Duration getLifetime(); + /** + * + * + *
+   * The desired lifetime duration of the access token in seconds.
+   * Must be set to a value less than or equal to 3600 (1 hour). If a value is
+   * not specified, the token's lifetime will be set to a default value of one
+   * hour.
+   * 
+ * + * .google.protobuf.Duration lifetime = 7; + */ + com.google.protobuf.DurationOrBuilder getLifetimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenResponse.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenResponse.java new file mode 100644 index 000000000000..a2ae6e4a04b7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenResponse.java @@ -0,0 +1,857 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.GenerateAccessTokenResponse} */ +public final class GenerateAccessTokenResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.GenerateAccessTokenResponse) + GenerateAccessTokenResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateAccessTokenResponse.newBuilder() to construct. + private GenerateAccessTokenResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateAccessTokenResponse() { + accessToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateAccessTokenResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + accessToken_ = s; + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expireTime_ != null) { + subBuilder = expireTime_.toBuilder(); + } + expireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expireTime_); + expireTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateAccessTokenResponse.class, + com.google.iam.credentials.v1.GenerateAccessTokenResponse.Builder.class); + } + + public static final int ACCESS_TOKEN_FIELD_NUMBER = 1; + private volatile java.lang.Object accessToken_; + /** + * + * + *
+   * The OAuth 2.0 access token.
+   * 
+ * + * string access_token = 1; + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } + } + /** + * + * + *
+   * The OAuth 2.0 access token.
+   * 
+ * + * string access_token = 1; + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public boolean hasExpireTime() { + return expireTime_ != null; + } + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return getExpireTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getAccessTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, accessToken_); + } + if (expireTime_ != null) { + output.writeMessage(3, getExpireTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAccessTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, accessToken_); + } + if (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExpireTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.credentials.v1.GenerateAccessTokenResponse)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.GenerateAccessTokenResponse other = + (com.google.iam.credentials.v1.GenerateAccessTokenResponse) obj; + + boolean result = true; + result = result && getAccessToken().equals(other.getAccessToken()); + result = result && (hasExpireTime() == other.hasExpireTime()); + if (hasExpireTime()) { + result = result && getExpireTime().equals(other.getExpireTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ACCESS_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAccessToken().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.iam.credentials.v1.GenerateAccessTokenResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.GenerateAccessTokenResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.GenerateAccessTokenResponse) + com.google.iam.credentials.v1.GenerateAccessTokenResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateAccessTokenResponse.class, + com.google.iam.credentials.v1.GenerateAccessTokenResponse.Builder.class); + } + + // Construct using com.google.iam.credentials.v1.GenerateAccessTokenResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + accessToken_ = ""; + + if (expireTimeBuilder_ == null) { + expireTime_ = null; + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateAccessTokenResponse getDefaultInstanceForType() { + return com.google.iam.credentials.v1.GenerateAccessTokenResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateAccessTokenResponse build() { + com.google.iam.credentials.v1.GenerateAccessTokenResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateAccessTokenResponse buildPartial() { + com.google.iam.credentials.v1.GenerateAccessTokenResponse result = + new com.google.iam.credentials.v1.GenerateAccessTokenResponse(this); + result.accessToken_ = accessToken_; + if (expireTimeBuilder_ == null) { + result.expireTime_ = expireTime_; + } else { + result.expireTime_ = expireTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.credentials.v1.GenerateAccessTokenResponse) { + return mergeFrom((com.google.iam.credentials.v1.GenerateAccessTokenResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.credentials.v1.GenerateAccessTokenResponse other) { + if (other == com.google.iam.credentials.v1.GenerateAccessTokenResponse.getDefaultInstance()) + return this; + if (!other.getAccessToken().isEmpty()) { + accessToken_ = other.accessToken_; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.GenerateAccessTokenResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.iam.credentials.v1.GenerateAccessTokenResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object accessToken_ = ""; + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public Builder setAccessToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + accessToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public Builder clearAccessToken() { + + accessToken_ = getDefaultInstance().getAccessToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public Builder setAccessTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + accessToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public boolean hasExpireTime() { + return expireTimeBuilder_ != null || expireTime_ != null; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expireTime_ != null) { + expireTime_ = + com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + } else { + expireTime_ = value; + } + onChanged(); + } else { + expireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + expireTime_ = null; + onChanged(); + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.GenerateAccessTokenResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateAccessTokenResponse) + private static final com.google.iam.credentials.v1.GenerateAccessTokenResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.credentials.v1.GenerateAccessTokenResponse(); + } + + public static com.google.iam.credentials.v1.GenerateAccessTokenResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateAccessTokenResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateAccessTokenResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateAccessTokenResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenResponseOrBuilder.java new file mode 100644 index 000000000000..26d6d49b40db --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateAccessTokenResponseOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface GenerateAccessTokenResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.GenerateAccessTokenResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The OAuth 2.0 access token.
+   * 
+ * + * string access_token = 1; + */ + java.lang.String getAccessToken(); + /** + * + * + *
+   * The OAuth 2.0 access token.
+   * 
+ * + * string access_token = 1; + */ + com.google.protobuf.ByteString getAccessTokenBytes(); + + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + boolean hasExpireTime(); + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenRequest.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenRequest.java new file mode 100644 index 000000000000..6f9b5538fcd8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenRequest.java @@ -0,0 +1,1187 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.GenerateIdTokenRequest} */ +public final class GenerateIdTokenRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.GenerateIdTokenRequest) + GenerateIdTokenRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateIdTokenRequest.newBuilder() to construct. + private GenerateIdTokenRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateIdTokenRequest() { + name_ = ""; + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + audience_ = ""; + includeEmail_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateIdTokenRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + delegates_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + audience_ = s; + break; + } + case 32: + { + includeEmail_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = delegates_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateIdTokenRequest.class, + com.google.iam.credentials.v1.GenerateIdTokenRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELEGATES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList delegates_; + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + public com.google.protobuf.ProtocolStringList getDelegatesList() { + return delegates_; + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + public int getDelegatesCount() { + return delegates_.size(); + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + public java.lang.String getDelegates(int index) { + return delegates_.get(index); + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + public com.google.protobuf.ByteString getDelegatesBytes(int index) { + return delegates_.getByteString(index); + } + + public static final int AUDIENCE_FIELD_NUMBER = 3; + private volatile java.lang.Object audience_; + /** + * + * + *
+   * The audience for the token, such as the API or account that this token
+   * grants access to.
+   * 
+ * + * string audience = 3; + */ + public java.lang.String getAudience() { + java.lang.Object ref = audience_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audience_ = s; + return s; + } + } + /** + * + * + *
+   * The audience for the token, such as the API or account that this token
+   * grants access to.
+   * 
+ * + * string audience = 3; + */ + public com.google.protobuf.ByteString getAudienceBytes() { + java.lang.Object ref = audience_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + audience_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INCLUDE_EMAIL_FIELD_NUMBER = 4; + private boolean includeEmail_; + /** + * + * + *
+   * Include the service account email in the token. If set to `true`, the
+   * token will contain `email` and `email_verified` claims.
+   * 
+ * + * bool include_email = 4; + */ + public boolean getIncludeEmail() { + return includeEmail_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < delegates_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, delegates_.getRaw(i)); + } + if (!getAudienceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, audience_); + } + if (includeEmail_ != false) { + output.writeBool(4, includeEmail_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < delegates_.size(); i++) { + dataSize += computeStringSizeNoTag(delegates_.getRaw(i)); + } + size += dataSize; + size += 1 * getDelegatesList().size(); + } + if (!getAudienceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, audience_); + } + if (includeEmail_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, includeEmail_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.credentials.v1.GenerateIdTokenRequest)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.GenerateIdTokenRequest other = + (com.google.iam.credentials.v1.GenerateIdTokenRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && getDelegatesList().equals(other.getDelegatesList()); + result = result && getAudience().equals(other.getAudience()); + result = result && (getIncludeEmail() == other.getIncludeEmail()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getDelegatesCount() > 0) { + hash = (37 * hash) + DELEGATES_FIELD_NUMBER; + hash = (53 * hash) + getDelegatesList().hashCode(); + } + hash = (37 * hash) + AUDIENCE_FIELD_NUMBER; + hash = (53 * hash) + getAudience().hashCode(); + hash = (37 * hash) + INCLUDE_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeEmail()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.credentials.v1.GenerateIdTokenRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.GenerateIdTokenRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.GenerateIdTokenRequest) + com.google.iam.credentials.v1.GenerateIdTokenRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateIdTokenRequest.class, + com.google.iam.credentials.v1.GenerateIdTokenRequest.Builder.class); + } + + // Construct using com.google.iam.credentials.v1.GenerateIdTokenRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + audience_ = ""; + + includeEmail_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdTokenRequest getDefaultInstanceForType() { + return com.google.iam.credentials.v1.GenerateIdTokenRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdTokenRequest build() { + com.google.iam.credentials.v1.GenerateIdTokenRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdTokenRequest buildPartial() { + com.google.iam.credentials.v1.GenerateIdTokenRequest result = + new com.google.iam.credentials.v1.GenerateIdTokenRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = delegates_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.delegates_ = delegates_; + result.audience_ = audience_; + result.includeEmail_ = includeEmail_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.credentials.v1.GenerateIdTokenRequest) { + return mergeFrom((com.google.iam.credentials.v1.GenerateIdTokenRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.credentials.v1.GenerateIdTokenRequest other) { + if (other == com.google.iam.credentials.v1.GenerateIdTokenRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.delegates_.isEmpty()) { + if (delegates_.isEmpty()) { + delegates_ = other.delegates_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDelegatesIsMutable(); + delegates_.addAll(other.delegates_); + } + onChanged(); + } + if (!other.getAudience().isEmpty()) { + audience_ = other.audience_; + onChanged(); + } + if (other.getIncludeEmail() != false) { + setIncludeEmail(other.getIncludeEmail()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.GenerateIdTokenRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.iam.credentials.v1.GenerateIdTokenRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList delegates_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDelegatesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = new com.google.protobuf.LazyStringArrayList(delegates_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public com.google.protobuf.ProtocolStringList getDelegatesList() { + return delegates_.getUnmodifiableView(); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public int getDelegatesCount() { + return delegates_.size(); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public java.lang.String getDelegates(int index) { + return delegates_.get(index); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public com.google.protobuf.ByteString getDelegatesBytes(int index) { + return delegates_.getByteString(index); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder setDelegates(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDelegatesIsMutable(); + delegates_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder addDelegates(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDelegatesIsMutable(); + delegates_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder addAllDelegates(java.lang.Iterable values) { + ensureDelegatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, delegates_); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder clearDelegates() { + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 2; + */ + public Builder addDelegatesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDelegatesIsMutable(); + delegates_.add(value); + onChanged(); + return this; + } + + private java.lang.Object audience_ = ""; + /** + * + * + *
+     * The audience for the token, such as the API or account that this token
+     * grants access to.
+     * 
+ * + * string audience = 3; + */ + public java.lang.String getAudience() { + java.lang.Object ref = audience_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audience_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The audience for the token, such as the API or account that this token
+     * grants access to.
+     * 
+ * + * string audience = 3; + */ + public com.google.protobuf.ByteString getAudienceBytes() { + java.lang.Object ref = audience_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + audience_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The audience for the token, such as the API or account that this token
+     * grants access to.
+     * 
+ * + * string audience = 3; + */ + public Builder setAudience(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + audience_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The audience for the token, such as the API or account that this token
+     * grants access to.
+     * 
+ * + * string audience = 3; + */ + public Builder clearAudience() { + + audience_ = getDefaultInstance().getAudience(); + onChanged(); + return this; + } + /** + * + * + *
+     * The audience for the token, such as the API or account that this token
+     * grants access to.
+     * 
+ * + * string audience = 3; + */ + public Builder setAudienceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + audience_ = value; + onChanged(); + return this; + } + + private boolean includeEmail_; + /** + * + * + *
+     * Include the service account email in the token. If set to `true`, the
+     * token will contain `email` and `email_verified` claims.
+     * 
+ * + * bool include_email = 4; + */ + public boolean getIncludeEmail() { + return includeEmail_; + } + /** + * + * + *
+     * Include the service account email in the token. If set to `true`, the
+     * token will contain `email` and `email_verified` claims.
+     * 
+ * + * bool include_email = 4; + */ + public Builder setIncludeEmail(boolean value) { + + includeEmail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Include the service account email in the token. If set to `true`, the
+     * token will contain `email` and `email_verified` claims.
+     * 
+ * + * bool include_email = 4; + */ + public Builder clearIncludeEmail() { + + includeEmail_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.GenerateIdTokenRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateIdTokenRequest) + private static final com.google.iam.credentials.v1.GenerateIdTokenRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.credentials.v1.GenerateIdTokenRequest(); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateIdTokenRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateIdTokenRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdTokenRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenRequestOrBuilder.java new file mode 100644 index 000000000000..34a2ac599983 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenRequestOrBuilder.java @@ -0,0 +1,139 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface GenerateIdTokenRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.GenerateIdTokenRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + java.util.List getDelegatesList(); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + int getDelegatesCount(); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + java.lang.String getDelegates(int index); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 2; + */ + com.google.protobuf.ByteString getDelegatesBytes(int index); + + /** + * + * + *
+   * The audience for the token, such as the API or account that this token
+   * grants access to.
+   * 
+ * + * string audience = 3; + */ + java.lang.String getAudience(); + /** + * + * + *
+   * The audience for the token, such as the API or account that this token
+   * grants access to.
+   * 
+ * + * string audience = 3; + */ + com.google.protobuf.ByteString getAudienceBytes(); + + /** + * + * + *
+   * Include the service account email in the token. If set to `true`, the
+   * token will contain `email` and `email_verified` claims.
+   * 
+ * + * bool include_email = 4; + */ + boolean getIncludeEmail(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenResponse.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenResponse.java new file mode 100644 index 000000000000..ae0e41a68087 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenResponse.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.GenerateIdTokenResponse} */ +public final class GenerateIdTokenResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.GenerateIdTokenResponse) + GenerateIdTokenResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateIdTokenResponse.newBuilder() to construct. + private GenerateIdTokenResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateIdTokenResponse() { + token_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateIdTokenResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + token_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateIdTokenResponse.class, + com.google.iam.credentials.v1.GenerateIdTokenResponse.Builder.class); + } + + public static final int TOKEN_FIELD_NUMBER = 1; + private volatile java.lang.Object token_; + /** + * + * + *
+   * The OpenId Connect ID token.
+   * 
+ * + * string token = 1; + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } + } + /** + * + * + *
+   * The OpenId Connect ID token.
+   * 
+ * + * string token = 1; + */ + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, token_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, token_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.credentials.v1.GenerateIdTokenResponse)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.GenerateIdTokenResponse other = + (com.google.iam.credentials.v1.GenerateIdTokenResponse) obj; + + boolean result = true; + result = result && getToken().equals(other.getToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.iam.credentials.v1.GenerateIdTokenResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.GenerateIdTokenResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.GenerateIdTokenResponse) + com.google.iam.credentials.v1.GenerateIdTokenResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateIdTokenResponse.class, + com.google.iam.credentials.v1.GenerateIdTokenResponse.Builder.class); + } + + // Construct using com.google.iam.credentials.v1.GenerateIdTokenResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + token_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdTokenResponse getDefaultInstanceForType() { + return com.google.iam.credentials.v1.GenerateIdTokenResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdTokenResponse build() { + com.google.iam.credentials.v1.GenerateIdTokenResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdTokenResponse buildPartial() { + com.google.iam.credentials.v1.GenerateIdTokenResponse result = + new com.google.iam.credentials.v1.GenerateIdTokenResponse(this); + result.token_ = token_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.credentials.v1.GenerateIdTokenResponse) { + return mergeFrom((com.google.iam.credentials.v1.GenerateIdTokenResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.credentials.v1.GenerateIdTokenResponse other) { + if (other == com.google.iam.credentials.v1.GenerateIdTokenResponse.getDefaultInstance()) + return this; + if (!other.getToken().isEmpty()) { + token_ = other.token_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.GenerateIdTokenResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.iam.credentials.v1.GenerateIdTokenResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object token_ = ""; + /** + * + * + *
+     * The OpenId Connect ID token.
+     * 
+ * + * string token = 1; + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The OpenId Connect ID token.
+     * 
+ * + * string token = 1; + */ + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The OpenId Connect ID token.
+     * 
+ * + * string token = 1; + */ + public Builder setToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + token_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The OpenId Connect ID token.
+     * 
+ * + * string token = 1; + */ + public Builder clearToken() { + + token_ = getDefaultInstance().getToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The OpenId Connect ID token.
+     * 
+ * + * string token = 1; + */ + public Builder setTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + token_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.GenerateIdTokenResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateIdTokenResponse) + private static final com.google.iam.credentials.v1.GenerateIdTokenResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.credentials.v1.GenerateIdTokenResponse(); + } + + public static com.google.iam.credentials.v1.GenerateIdTokenResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateIdTokenResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateIdTokenResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdTokenResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenResponseOrBuilder.java new file mode 100644 index 000000000000..658110adba56 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdTokenResponseOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface GenerateIdTokenResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.GenerateIdTokenResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The OpenId Connect ID token.
+   * 
+ * + * string token = 1; + */ + java.lang.String getToken(); + /** + * + * + *
+   * The OpenId Connect ID token.
+   * 
+ * + * string token = 1; + */ + com.google.protobuf.ByteString getTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequest.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequest.java new file mode 100644 index 000000000000..b008196e84e3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequest.java @@ -0,0 +1,1357 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest} */ +public final class GenerateIdentityBindingAccessTokenRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) + GenerateIdentityBindingAccessTokenRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateIdentityBindingAccessTokenRequest.newBuilder() to construct. + private GenerateIdentityBindingAccessTokenRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateIdentityBindingAccessTokenRequest() { + name_ = ""; + scope_ = com.google.protobuf.LazyStringArrayList.EMPTY; + jwt_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateIdentityBindingAccessTokenRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + scope_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + scope_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + jwt_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + scope_ = scope_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest.class, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCOPE_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList scope_; + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 2; + */ + public com.google.protobuf.ProtocolStringList getScopeList() { + return scope_; + } + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 2; + */ + public int getScopeCount() { + return scope_.size(); + } + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 2; + */ + public java.lang.String getScope(int index) { + return scope_.get(index); + } + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 2; + */ + public com.google.protobuf.ByteString getScopeBytes(int index) { + return scope_.getByteString(index); + } + + public static final int JWT_FIELD_NUMBER = 3; + private volatile java.lang.Object jwt_; + /** + * + * + *
+   * Required. Input token.
+   * Must be in JWT format according to
+   * RFC7523 (https://tools.ietf.org/html/rfc7523)
+   * and must have 'kid' field in the header.
+   * Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
+   * Mandatory payload fields (along the lines of RFC 7523, section 3):
+   * - iss: issuer of the token. Must provide a discovery document at
+   *        $iss/.well-known/openid-configuration . The document needs to be
+   *        formatted according to section 4.2 of the OpenID Connect Discovery
+   *        1.0 specification.
+   * - iat: Issue time in seconds since epoch. Must be in the past.
+   * - exp: Expiration time in seconds since epoch. Must be less than 48 hours
+   *        after iat. We recommend to create tokens that last shorter than 6
+   *        hours to improve security unless business reasons mandate longer
+   *        expiration times. Shorter token lifetimes are generally more secure
+   *        since tokens that have been exfiltrated by attackers can be used for
+   *        a shorter time. you can configure the maximum lifetime of the
+   *        incoming token in the configuration of the mapper.
+   *        The resulting Google token will expire within an hour or at "exp",
+   *        whichever is earlier.
+   * - sub: JWT subject, identity asserted in the JWT.
+   * - aud: Configured in the mapper policy. By default the service account
+   *        email.
+   * Claims from the incoming token can be transferred into the output token
+   * accoding to the mapper configuration. The outgoing claim size is limited.
+   * Outgoing claims size must be less than 4kB serialized as JSON without
+   * whitespace.
+   * Example header:
+   * {
+   *   "alg": "RS256",
+   *   "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
+   * }
+   * Example payload:
+   * {
+   *   "iss": "https://accounts.google.com",
+   *   "iat": 1517963104,
+   *   "exp": 1517966704,
+   *   "aud": "https://iamcredentials.googleapis.com/",
+   *   "sub": "113475438248934895348",
+   *   "my_claims": {
+   *     "additional_claim": "value"
+   *   }
+   * }
+   * 
+ * + * string jwt = 3; + */ + public java.lang.String getJwt() { + java.lang.Object ref = jwt_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + jwt_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Input token.
+   * Must be in JWT format according to
+   * RFC7523 (https://tools.ietf.org/html/rfc7523)
+   * and must have 'kid' field in the header.
+   * Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
+   * Mandatory payload fields (along the lines of RFC 7523, section 3):
+   * - iss: issuer of the token. Must provide a discovery document at
+   *        $iss/.well-known/openid-configuration . The document needs to be
+   *        formatted according to section 4.2 of the OpenID Connect Discovery
+   *        1.0 specification.
+   * - iat: Issue time in seconds since epoch. Must be in the past.
+   * - exp: Expiration time in seconds since epoch. Must be less than 48 hours
+   *        after iat. We recommend to create tokens that last shorter than 6
+   *        hours to improve security unless business reasons mandate longer
+   *        expiration times. Shorter token lifetimes are generally more secure
+   *        since tokens that have been exfiltrated by attackers can be used for
+   *        a shorter time. you can configure the maximum lifetime of the
+   *        incoming token in the configuration of the mapper.
+   *        The resulting Google token will expire within an hour or at "exp",
+   *        whichever is earlier.
+   * - sub: JWT subject, identity asserted in the JWT.
+   * - aud: Configured in the mapper policy. By default the service account
+   *        email.
+   * Claims from the incoming token can be transferred into the output token
+   * accoding to the mapper configuration. The outgoing claim size is limited.
+   * Outgoing claims size must be less than 4kB serialized as JSON without
+   * whitespace.
+   * Example header:
+   * {
+   *   "alg": "RS256",
+   *   "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
+   * }
+   * Example payload:
+   * {
+   *   "iss": "https://accounts.google.com",
+   *   "iat": 1517963104,
+   *   "exp": 1517966704,
+   *   "aud": "https://iamcredentials.googleapis.com/",
+   *   "sub": "113475438248934895348",
+   *   "my_claims": {
+   *     "additional_claim": "value"
+   *   }
+   * }
+   * 
+ * + * string jwt = 3; + */ + public com.google.protobuf.ByteString getJwtBytes() { + java.lang.Object ref = jwt_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + jwt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < scope_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, scope_.getRaw(i)); + } + if (!getJwtBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, jwt_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < scope_.size(); i++) { + dataSize += computeStringSizeNoTag(scope_.getRaw(i)); + } + size += dataSize; + size += 1 * getScopeList().size(); + } + if (!getJwtBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, jwt_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest other = + (com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && getScopeList().equals(other.getScopeList()); + result = result && getJwt().equals(other.getJwt()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getScopeCount() > 0) { + hash = (37 * hash) + SCOPE_FIELD_NUMBER; + hash = (53 * hash) + getScopeList().hashCode(); + } + hash = (37 * hash) + JWT_FIELD_NUMBER; + hash = (53 * hash) + getJwt().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest.class, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest.Builder + .class); + } + + // Construct using + // com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + scope_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + jwt_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest + getDefaultInstanceForType() { + return com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest build() { + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest buildPartial() { + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest result = + new com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + scope_ = scope_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.scope_ = scope_; + result.jwt_ = jwt_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) { + return mergeFrom( + (com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest other) { + if (other + == com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.scope_.isEmpty()) { + if (scope_.isEmpty()) { + scope_ = other.scope_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureScopeIsMutable(); + scope_.addAll(other.scope_); + } + onChanged(); + } + if (!other.getJwt().isEmpty()) { + jwt_ = other.jwt_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList scope_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureScopeIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + scope_ = new com.google.protobuf.LazyStringArrayList(scope_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 2; + */ + public com.google.protobuf.ProtocolStringList getScopeList() { + return scope_.getUnmodifiableView(); + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 2; + */ + public int getScopeCount() { + return scope_.size(); + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 2; + */ + public java.lang.String getScope(int index) { + return scope_.get(index); + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 2; + */ + public com.google.protobuf.ByteString getScopeBytes(int index) { + return scope_.getByteString(index); + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 2; + */ + public Builder setScope(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScopeIsMutable(); + scope_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 2; + */ + public Builder addScope(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureScopeIsMutable(); + scope_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 2; + */ + public Builder addAllScope(java.lang.Iterable values) { + ensureScopeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scope_); + onChanged(); + return this; + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 2; + */ + public Builder clearScope() { + scope_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Code to identify the scopes to be included in the OAuth 2.0 access token.
+     * See https://developers.google.com/identity/protocols/googlescopes for more
+     * information.
+     * At least one value required.
+     * 
+ * + * repeated string scope = 2; + */ + public Builder addScopeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureScopeIsMutable(); + scope_.add(value); + onChanged(); + return this; + } + + private java.lang.Object jwt_ = ""; + /** + * + * + *
+     * Required. Input token.
+     * Must be in JWT format according to
+     * RFC7523 (https://tools.ietf.org/html/rfc7523)
+     * and must have 'kid' field in the header.
+     * Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
+     * Mandatory payload fields (along the lines of RFC 7523, section 3):
+     * - iss: issuer of the token. Must provide a discovery document at
+     *        $iss/.well-known/openid-configuration . The document needs to be
+     *        formatted according to section 4.2 of the OpenID Connect Discovery
+     *        1.0 specification.
+     * - iat: Issue time in seconds since epoch. Must be in the past.
+     * - exp: Expiration time in seconds since epoch. Must be less than 48 hours
+     *        after iat. We recommend to create tokens that last shorter than 6
+     *        hours to improve security unless business reasons mandate longer
+     *        expiration times. Shorter token lifetimes are generally more secure
+     *        since tokens that have been exfiltrated by attackers can be used for
+     *        a shorter time. you can configure the maximum lifetime of the
+     *        incoming token in the configuration of the mapper.
+     *        The resulting Google token will expire within an hour or at "exp",
+     *        whichever is earlier.
+     * - sub: JWT subject, identity asserted in the JWT.
+     * - aud: Configured in the mapper policy. By default the service account
+     *        email.
+     * Claims from the incoming token can be transferred into the output token
+     * accoding to the mapper configuration. The outgoing claim size is limited.
+     * Outgoing claims size must be less than 4kB serialized as JSON without
+     * whitespace.
+     * Example header:
+     * {
+     *   "alg": "RS256",
+     *   "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
+     * }
+     * Example payload:
+     * {
+     *   "iss": "https://accounts.google.com",
+     *   "iat": 1517963104,
+     *   "exp": 1517966704,
+     *   "aud": "https://iamcredentials.googleapis.com/",
+     *   "sub": "113475438248934895348",
+     *   "my_claims": {
+     *     "additional_claim": "value"
+     *   }
+     * }
+     * 
+ * + * string jwt = 3; + */ + public java.lang.String getJwt() { + java.lang.Object ref = jwt_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + jwt_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Input token.
+     * Must be in JWT format according to
+     * RFC7523 (https://tools.ietf.org/html/rfc7523)
+     * and must have 'kid' field in the header.
+     * Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
+     * Mandatory payload fields (along the lines of RFC 7523, section 3):
+     * - iss: issuer of the token. Must provide a discovery document at
+     *        $iss/.well-known/openid-configuration . The document needs to be
+     *        formatted according to section 4.2 of the OpenID Connect Discovery
+     *        1.0 specification.
+     * - iat: Issue time in seconds since epoch. Must be in the past.
+     * - exp: Expiration time in seconds since epoch. Must be less than 48 hours
+     *        after iat. We recommend to create tokens that last shorter than 6
+     *        hours to improve security unless business reasons mandate longer
+     *        expiration times. Shorter token lifetimes are generally more secure
+     *        since tokens that have been exfiltrated by attackers can be used for
+     *        a shorter time. you can configure the maximum lifetime of the
+     *        incoming token in the configuration of the mapper.
+     *        The resulting Google token will expire within an hour or at "exp",
+     *        whichever is earlier.
+     * - sub: JWT subject, identity asserted in the JWT.
+     * - aud: Configured in the mapper policy. By default the service account
+     *        email.
+     * Claims from the incoming token can be transferred into the output token
+     * accoding to the mapper configuration. The outgoing claim size is limited.
+     * Outgoing claims size must be less than 4kB serialized as JSON without
+     * whitespace.
+     * Example header:
+     * {
+     *   "alg": "RS256",
+     *   "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
+     * }
+     * Example payload:
+     * {
+     *   "iss": "https://accounts.google.com",
+     *   "iat": 1517963104,
+     *   "exp": 1517966704,
+     *   "aud": "https://iamcredentials.googleapis.com/",
+     *   "sub": "113475438248934895348",
+     *   "my_claims": {
+     *     "additional_claim": "value"
+     *   }
+     * }
+     * 
+ * + * string jwt = 3; + */ + public com.google.protobuf.ByteString getJwtBytes() { + java.lang.Object ref = jwt_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + jwt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Input token.
+     * Must be in JWT format according to
+     * RFC7523 (https://tools.ietf.org/html/rfc7523)
+     * and must have 'kid' field in the header.
+     * Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
+     * Mandatory payload fields (along the lines of RFC 7523, section 3):
+     * - iss: issuer of the token. Must provide a discovery document at
+     *        $iss/.well-known/openid-configuration . The document needs to be
+     *        formatted according to section 4.2 of the OpenID Connect Discovery
+     *        1.0 specification.
+     * - iat: Issue time in seconds since epoch. Must be in the past.
+     * - exp: Expiration time in seconds since epoch. Must be less than 48 hours
+     *        after iat. We recommend to create tokens that last shorter than 6
+     *        hours to improve security unless business reasons mandate longer
+     *        expiration times. Shorter token lifetimes are generally more secure
+     *        since tokens that have been exfiltrated by attackers can be used for
+     *        a shorter time. you can configure the maximum lifetime of the
+     *        incoming token in the configuration of the mapper.
+     *        The resulting Google token will expire within an hour or at "exp",
+     *        whichever is earlier.
+     * - sub: JWT subject, identity asserted in the JWT.
+     * - aud: Configured in the mapper policy. By default the service account
+     *        email.
+     * Claims from the incoming token can be transferred into the output token
+     * accoding to the mapper configuration. The outgoing claim size is limited.
+     * Outgoing claims size must be less than 4kB serialized as JSON without
+     * whitespace.
+     * Example header:
+     * {
+     *   "alg": "RS256",
+     *   "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
+     * }
+     * Example payload:
+     * {
+     *   "iss": "https://accounts.google.com",
+     *   "iat": 1517963104,
+     *   "exp": 1517966704,
+     *   "aud": "https://iamcredentials.googleapis.com/",
+     *   "sub": "113475438248934895348",
+     *   "my_claims": {
+     *     "additional_claim": "value"
+     *   }
+     * }
+     * 
+ * + * string jwt = 3; + */ + public Builder setJwt(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + jwt_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Input token.
+     * Must be in JWT format according to
+     * RFC7523 (https://tools.ietf.org/html/rfc7523)
+     * and must have 'kid' field in the header.
+     * Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
+     * Mandatory payload fields (along the lines of RFC 7523, section 3):
+     * - iss: issuer of the token. Must provide a discovery document at
+     *        $iss/.well-known/openid-configuration . The document needs to be
+     *        formatted according to section 4.2 of the OpenID Connect Discovery
+     *        1.0 specification.
+     * - iat: Issue time in seconds since epoch. Must be in the past.
+     * - exp: Expiration time in seconds since epoch. Must be less than 48 hours
+     *        after iat. We recommend to create tokens that last shorter than 6
+     *        hours to improve security unless business reasons mandate longer
+     *        expiration times. Shorter token lifetimes are generally more secure
+     *        since tokens that have been exfiltrated by attackers can be used for
+     *        a shorter time. you can configure the maximum lifetime of the
+     *        incoming token in the configuration of the mapper.
+     *        The resulting Google token will expire within an hour or at "exp",
+     *        whichever is earlier.
+     * - sub: JWT subject, identity asserted in the JWT.
+     * - aud: Configured in the mapper policy. By default the service account
+     *        email.
+     * Claims from the incoming token can be transferred into the output token
+     * accoding to the mapper configuration. The outgoing claim size is limited.
+     * Outgoing claims size must be less than 4kB serialized as JSON without
+     * whitespace.
+     * Example header:
+     * {
+     *   "alg": "RS256",
+     *   "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
+     * }
+     * Example payload:
+     * {
+     *   "iss": "https://accounts.google.com",
+     *   "iat": 1517963104,
+     *   "exp": 1517966704,
+     *   "aud": "https://iamcredentials.googleapis.com/",
+     *   "sub": "113475438248934895348",
+     *   "my_claims": {
+     *     "additional_claim": "value"
+     *   }
+     * }
+     * 
+ * + * string jwt = 3; + */ + public Builder clearJwt() { + + jwt_ = getDefaultInstance().getJwt(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Input token.
+     * Must be in JWT format according to
+     * RFC7523 (https://tools.ietf.org/html/rfc7523)
+     * and must have 'kid' field in the header.
+     * Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
+     * Mandatory payload fields (along the lines of RFC 7523, section 3):
+     * - iss: issuer of the token. Must provide a discovery document at
+     *        $iss/.well-known/openid-configuration . The document needs to be
+     *        formatted according to section 4.2 of the OpenID Connect Discovery
+     *        1.0 specification.
+     * - iat: Issue time in seconds since epoch. Must be in the past.
+     * - exp: Expiration time in seconds since epoch. Must be less than 48 hours
+     *        after iat. We recommend to create tokens that last shorter than 6
+     *        hours to improve security unless business reasons mandate longer
+     *        expiration times. Shorter token lifetimes are generally more secure
+     *        since tokens that have been exfiltrated by attackers can be used for
+     *        a shorter time. you can configure the maximum lifetime of the
+     *        incoming token in the configuration of the mapper.
+     *        The resulting Google token will expire within an hour or at "exp",
+     *        whichever is earlier.
+     * - sub: JWT subject, identity asserted in the JWT.
+     * - aud: Configured in the mapper policy. By default the service account
+     *        email.
+     * Claims from the incoming token can be transferred into the output token
+     * accoding to the mapper configuration. The outgoing claim size is limited.
+     * Outgoing claims size must be less than 4kB serialized as JSON without
+     * whitespace.
+     * Example header:
+     * {
+     *   "alg": "RS256",
+     *   "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
+     * }
+     * Example payload:
+     * {
+     *   "iss": "https://accounts.google.com",
+     *   "iat": 1517963104,
+     *   "exp": 1517966704,
+     *   "aud": "https://iamcredentials.googleapis.com/",
+     *   "sub": "113475438248934895348",
+     *   "my_claims": {
+     *     "additional_claim": "value"
+     *   }
+     * }
+     * 
+ * + * string jwt = 3; + */ + public Builder setJwtBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + jwt_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) + private static final com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest(); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateIdentityBindingAccessTokenRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateIdentityBindingAccessTokenRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequestOrBuilder.java new file mode 100644 index 000000000000..6b1de7d64816 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequestOrBuilder.java @@ -0,0 +1,193 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface GenerateIdentityBindingAccessTokenRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 2; + */ + java.util.List getScopeList(); + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 2; + */ + int getScopeCount(); + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 2; + */ + java.lang.String getScope(int index); + /** + * + * + *
+   * Code to identify the scopes to be included in the OAuth 2.0 access token.
+   * See https://developers.google.com/identity/protocols/googlescopes for more
+   * information.
+   * At least one value required.
+   * 
+ * + * repeated string scope = 2; + */ + com.google.protobuf.ByteString getScopeBytes(int index); + + /** + * + * + *
+   * Required. Input token.
+   * Must be in JWT format according to
+   * RFC7523 (https://tools.ietf.org/html/rfc7523)
+   * and must have 'kid' field in the header.
+   * Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
+   * Mandatory payload fields (along the lines of RFC 7523, section 3):
+   * - iss: issuer of the token. Must provide a discovery document at
+   *        $iss/.well-known/openid-configuration . The document needs to be
+   *        formatted according to section 4.2 of the OpenID Connect Discovery
+   *        1.0 specification.
+   * - iat: Issue time in seconds since epoch. Must be in the past.
+   * - exp: Expiration time in seconds since epoch. Must be less than 48 hours
+   *        after iat. We recommend to create tokens that last shorter than 6
+   *        hours to improve security unless business reasons mandate longer
+   *        expiration times. Shorter token lifetimes are generally more secure
+   *        since tokens that have been exfiltrated by attackers can be used for
+   *        a shorter time. you can configure the maximum lifetime of the
+   *        incoming token in the configuration of the mapper.
+   *        The resulting Google token will expire within an hour or at "exp",
+   *        whichever is earlier.
+   * - sub: JWT subject, identity asserted in the JWT.
+   * - aud: Configured in the mapper policy. By default the service account
+   *        email.
+   * Claims from the incoming token can be transferred into the output token
+   * accoding to the mapper configuration. The outgoing claim size is limited.
+   * Outgoing claims size must be less than 4kB serialized as JSON without
+   * whitespace.
+   * Example header:
+   * {
+   *   "alg": "RS256",
+   *   "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
+   * }
+   * Example payload:
+   * {
+   *   "iss": "https://accounts.google.com",
+   *   "iat": 1517963104,
+   *   "exp": 1517966704,
+   *   "aud": "https://iamcredentials.googleapis.com/",
+   *   "sub": "113475438248934895348",
+   *   "my_claims": {
+   *     "additional_claim": "value"
+   *   }
+   * }
+   * 
+ * + * string jwt = 3; + */ + java.lang.String getJwt(); + /** + * + * + *
+   * Required. Input token.
+   * Must be in JWT format according to
+   * RFC7523 (https://tools.ietf.org/html/rfc7523)
+   * and must have 'kid' field in the header.
+   * Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon).
+   * Mandatory payload fields (along the lines of RFC 7523, section 3):
+   * - iss: issuer of the token. Must provide a discovery document at
+   *        $iss/.well-known/openid-configuration . The document needs to be
+   *        formatted according to section 4.2 of the OpenID Connect Discovery
+   *        1.0 specification.
+   * - iat: Issue time in seconds since epoch. Must be in the past.
+   * - exp: Expiration time in seconds since epoch. Must be less than 48 hours
+   *        after iat. We recommend to create tokens that last shorter than 6
+   *        hours to improve security unless business reasons mandate longer
+   *        expiration times. Shorter token lifetimes are generally more secure
+   *        since tokens that have been exfiltrated by attackers can be used for
+   *        a shorter time. you can configure the maximum lifetime of the
+   *        incoming token in the configuration of the mapper.
+   *        The resulting Google token will expire within an hour or at "exp",
+   *        whichever is earlier.
+   * - sub: JWT subject, identity asserted in the JWT.
+   * - aud: Configured in the mapper policy. By default the service account
+   *        email.
+   * Claims from the incoming token can be transferred into the output token
+   * accoding to the mapper configuration. The outgoing claim size is limited.
+   * Outgoing claims size must be less than 4kB serialized as JSON without
+   * whitespace.
+   * Example header:
+   * {
+   *   "alg": "RS256",
+   *   "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8"
+   * }
+   * Example payload:
+   * {
+   *   "iss": "https://accounts.google.com",
+   *   "iat": 1517963104,
+   *   "exp": 1517966704,
+   *   "aud": "https://iamcredentials.googleapis.com/",
+   *   "sub": "113475438248934895348",
+   *   "my_claims": {
+   *     "additional_claim": "value"
+   *   }
+   * }
+   * 
+ * + * string jwt = 3; + */ + com.google.protobuf.ByteString getJwtBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponse.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponse.java new file mode 100644 index 000000000000..9f341f1d2422 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponse.java @@ -0,0 +1,876 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse} */ +public final class GenerateIdentityBindingAccessTokenResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) + GenerateIdentityBindingAccessTokenResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateIdentityBindingAccessTokenResponse.newBuilder() to construct. + private GenerateIdentityBindingAccessTokenResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateIdentityBindingAccessTokenResponse() { + accessToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateIdentityBindingAccessTokenResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + accessToken_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expireTime_ != null) { + subBuilder = expireTime_.toBuilder(); + } + expireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expireTime_); + expireTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse.class, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse.Builder.class); + } + + public static final int ACCESS_TOKEN_FIELD_NUMBER = 1; + private volatile java.lang.Object accessToken_; + /** + * + * + *
+   * The OAuth 2.0 access token.
+   * 
+ * + * string access_token = 1; + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } + } + /** + * + * + *
+   * The OAuth 2.0 access token.
+   * 
+ * + * string access_token = 1; + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public boolean hasExpireTime() { + return expireTime_ != null; + } + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return getExpireTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getAccessTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, accessToken_); + } + if (expireTime_ != null) { + output.writeMessage(2, getExpireTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAccessTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, accessToken_); + } + if (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpireTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse other = + (com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) obj; + + boolean result = true; + result = result && getAccessToken().equals(other.getAccessToken()); + result = result && (hasExpireTime() == other.hasExpireTime()); + if (hasExpireTime()) { + result = result && getExpireTime().equals(other.getExpireTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ACCESS_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getAccessToken().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse.class, + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse.Builder + .class); + } + + // Construct using + // com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + accessToken_ = ""; + + if (expireTimeBuilder_ == null) { + expireTime_ = null; + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse + getDefaultInstanceForType() { + return com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse build() { + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse buildPartial() { + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse result = + new com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse(this); + result.accessToken_ = accessToken_; + if (expireTimeBuilder_ == null) { + result.expireTime_ = expireTime_; + } else { + result.expireTime_ = expireTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) { + return mergeFrom( + (com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse other) { + if (other + == com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse + .getDefaultInstance()) return this; + if (!other.getAccessToken().isEmpty()) { + accessToken_ = other.accessToken_; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object accessToken_ = ""; + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public java.lang.String getAccessToken() { + java.lang.Object ref = accessToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + accessToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public com.google.protobuf.ByteString getAccessTokenBytes() { + java.lang.Object ref = accessToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + accessToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public Builder setAccessToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + accessToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public Builder clearAccessToken() { + + accessToken_ = getDefaultInstance().getAccessToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The OAuth 2.0 access token.
+     * 
+ * + * string access_token = 1; + */ + public Builder setAccessTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + accessToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public boolean hasExpireTime() { + return expireTimeBuilder_ != null || expireTime_ != null; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expireTime_ != null) { + expireTime_ = + com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + } else { + expireTime_ = value; + } + onChanged(); + } else { + expireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + expireTime_ = null; + onChanged(); + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * Token expiration time.
+     * The expiration time is always set.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) + private static final com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse(); + } + + public static com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateIdentityBindingAccessTokenResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateIdentityBindingAccessTokenResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponseOrBuilder.java new file mode 100644 index 000000000000..cf224ea961c5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponseOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface GenerateIdentityBindingAccessTokenResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The OAuth 2.0 access token.
+   * 
+ * + * string access_token = 1; + */ + java.lang.String getAccessToken(); + /** + * + * + *
+   * The OAuth 2.0 access token.
+   * 
+ * + * string access_token = 1; + */ + com.google.protobuf.ByteString getAccessTokenBytes(); + + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + boolean hasExpireTime(); + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * Token expiration time.
+   * The expiration time is always set.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/IAMCredentialsCommonProto.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/IAMCredentialsCommonProto.java new file mode 100644 index 000000000000..3bda3890d96f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/IAMCredentialsCommonProto.java @@ -0,0 +1,193 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public final class IAMCredentialsCommonProto { + private IAMCredentialsCommonProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_SignBlobRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_SignBlobRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_SignBlobResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_SignBlobResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_SignJwtRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_SignJwtRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_SignJwtResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_SignJwtResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n&google/iam/credentials/v1/common.proto" + + "\022\031google.iam.credentials.v1\032\036google/prot" + + "obuf/duration.proto\032\037google/protobuf/tim" + + "estamp.proto\"y\n\032GenerateAccessTokenReque" + + "st\022\014\n\004name\030\001 \001(\t\022\021\n\tdelegates\030\002 \003(\t\022\r\n\005s" + + "cope\030\004 \003(\t\022+\n\010lifetime\030\007 \001(\0132\031.google.pr" + + "otobuf.Duration\"d\n\033GenerateAccessTokenRe" + + "sponse\022\024\n\014access_token\030\001 \001(\t\022/\n\013expire_t" + + "ime\030\003 \001(\0132\032.google.protobuf.Timestamp\"C\n" + + "\017SignBlobRequest\022\014\n\004name\030\001 \001(\t\022\021\n\tdelega" + + "tes\030\003 \003(\t\022\017\n\007payload\030\005 \001(\014\"7\n\020SignBlobRe" + + "sponse\022\016\n\006key_id\030\001 \001(\t\022\023\n\013signed_blob\030\004 " + + "\001(\014\"B\n\016SignJwtRequest\022\014\n\004name\030\001 \001(\t\022\021\n\td" + + "elegates\030\003 \003(\t\022\017\n\007payload\030\005 \001(\t\"5\n\017SignJ" + + "wtResponse\022\016\n\006key_id\030\001 \001(\t\022\022\n\nsigned_jwt" + + "\030\002 \001(\t\"b\n\026GenerateIdTokenRequest\022\014\n\004name" + + "\030\001 \001(\t\022\021\n\tdelegates\030\002 \003(\t\022\020\n\010audience\030\003 " + + "\001(\t\022\025\n\rinclude_email\030\004 \001(\010\"(\n\027GenerateId" + + "TokenResponse\022\r\n\005token\030\001 \001(\t\"U\n)Generate" + + "IdentityBindingAccessTokenRequest\022\014\n\004nam" + + "e\030\001 \001(\t\022\r\n\005scope\030\002 \003(\t\022\013\n\003jwt\030\003 \001(\t\"s\n*G" + + "enerateIdentityBindingAccessTokenRespons" + + "e\022\024\n\014access_token\030\001 \001(\t\022/\n\013expire_time\030\002" + + " \001(\0132\032.google.protobuf.TimestampB\205\001\n\035com" + + ".google.iam.credentials.v1B\031IAMCredentia" + + "lsCommonProtoP\001ZDgoogle.golang.org/genpr" + + "oto/googleapis/iam/credentials/v1;creden" + + "tials\370\001\001b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, + assigner); + internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_GenerateAccessTokenRequest_descriptor, + new java.lang.String[] { + "Name", "Delegates", "Scope", "Lifetime", + }); + internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_GenerateAccessTokenResponse_descriptor, + new java.lang.String[] { + "AccessToken", "ExpireTime", + }); + internal_static_google_iam_credentials_v1_SignBlobRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_iam_credentials_v1_SignBlobRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_SignBlobRequest_descriptor, + new java.lang.String[] { + "Name", "Delegates", "Payload", + }); + internal_static_google_iam_credentials_v1_SignBlobResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_iam_credentials_v1_SignBlobResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_SignBlobResponse_descriptor, + new java.lang.String[] { + "KeyId", "SignedBlob", + }); + internal_static_google_iam_credentials_v1_SignJwtRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_iam_credentials_v1_SignJwtRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_SignJwtRequest_descriptor, + new java.lang.String[] { + "Name", "Delegates", "Payload", + }); + internal_static_google_iam_credentials_v1_SignJwtResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_iam_credentials_v1_SignJwtResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_SignJwtResponse_descriptor, + new java.lang.String[] { + "KeyId", "SignedJwt", + }); + internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_GenerateIdTokenRequest_descriptor, + new java.lang.String[] { + "Name", "Delegates", "Audience", "IncludeEmail", + }); + internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_GenerateIdTokenResponse_descriptor, + new java.lang.String[] { + "Token", + }); + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_descriptor, + new java.lang.String[] { + "Name", "Scope", "Jwt", + }); + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_descriptor, + new java.lang.String[] { + "AccessToken", "ExpireTime", + }); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/ServiceAccountName.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/ServiceAccountName.java new file mode 100644 index 000000000000..321a7ed3891b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/ServiceAccountName.java @@ -0,0 +1,181 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.iam.credentials.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ServiceAccountName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/serviceAccounts/{service_account}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String serviceAccount; + + public String getProject() { + return project; + } + + public String getServiceAccount() { + return serviceAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ServiceAccountName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + serviceAccount = Preconditions.checkNotNull(builder.getServiceAccount()); + } + + public static ServiceAccountName of(String project, String serviceAccount) { + return newBuilder().setProject(project).setServiceAccount(serviceAccount).build(); + } + + public static String format(String project, String serviceAccount) { + return newBuilder().setProject(project).setServiceAccount(serviceAccount).build().toString(); + } + + public static ServiceAccountName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ServiceAccountName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("service_account")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ServiceAccountName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("serviceAccount", serviceAccount); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "service_account", serviceAccount); + } + + /** Builder for ServiceAccountName. */ + public static class Builder { + + private String project; + private String serviceAccount; + + public String getProject() { + return project; + } + + public String getServiceAccount() { + return serviceAccount; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setServiceAccount(String serviceAccount) { + this.serviceAccount = serviceAccount; + return this; + } + + private Builder() {} + + private Builder(ServiceAccountName serviceAccountName) { + project = serviceAccountName.project; + serviceAccount = serviceAccountName.serviceAccount; + } + + public ServiceAccountName build() { + return new ServiceAccountName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ServiceAccountName) { + ServiceAccountName that = (ServiceAccountName) o; + return (this.project.equals(that.project)) + && (this.serviceAccount.equals(that.serviceAccount)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= serviceAccount.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobRequest.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobRequest.java new file mode 100644 index 000000000000..69940556b2e7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobRequest.java @@ -0,0 +1,1016 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.SignBlobRequest} */ +public final class SignBlobRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.SignBlobRequest) + SignBlobRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SignBlobRequest.newBuilder() to construct. + private SignBlobRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SignBlobRequest() { + name_ = ""; + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + payload_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SignBlobRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + delegates_.add(s); + break; + } + case 42: + { + payload_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = delegates_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.SignBlobRequest.class, + com.google.iam.credentials.v1.SignBlobRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELEGATES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList delegates_; + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + public com.google.protobuf.ProtocolStringList getDelegatesList() { + return delegates_; + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + public int getDelegatesCount() { + return delegates_.size(); + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + public java.lang.String getDelegates(int index) { + return delegates_.get(index); + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + public com.google.protobuf.ByteString getDelegatesBytes(int index) { + return delegates_.getByteString(index); + } + + public static final int PAYLOAD_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString payload_; + /** + * + * + *
+   * The bytes to sign.
+   * 
+ * + * bytes payload = 5; + */ + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < delegates_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, delegates_.getRaw(i)); + } + if (!payload_.isEmpty()) { + output.writeBytes(5, payload_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < delegates_.size(); i++) { + dataSize += computeStringSizeNoTag(delegates_.getRaw(i)); + } + size += dataSize; + size += 1 * getDelegatesList().size(); + } + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, payload_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.credentials.v1.SignBlobRequest)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.SignBlobRequest other = + (com.google.iam.credentials.v1.SignBlobRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && getDelegatesList().equals(other.getDelegatesList()); + result = result && getPayload().equals(other.getPayload()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getDelegatesCount() > 0) { + hash = (37 * hash) + DELEGATES_FIELD_NUMBER; + hash = (53 * hash) + getDelegatesList().hashCode(); + } + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignBlobRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.credentials.v1.SignBlobRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.SignBlobRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.SignBlobRequest) + com.google.iam.credentials.v1.SignBlobRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.SignBlobRequest.class, + com.google.iam.credentials.v1.SignBlobRequest.Builder.class); + } + + // Construct using com.google.iam.credentials.v1.SignBlobRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + payload_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignBlobRequest getDefaultInstanceForType() { + return com.google.iam.credentials.v1.SignBlobRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignBlobRequest build() { + com.google.iam.credentials.v1.SignBlobRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignBlobRequest buildPartial() { + com.google.iam.credentials.v1.SignBlobRequest result = + new com.google.iam.credentials.v1.SignBlobRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = delegates_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.delegates_ = delegates_; + result.payload_ = payload_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.credentials.v1.SignBlobRequest) { + return mergeFrom((com.google.iam.credentials.v1.SignBlobRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.credentials.v1.SignBlobRequest other) { + if (other == com.google.iam.credentials.v1.SignBlobRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.delegates_.isEmpty()) { + if (delegates_.isEmpty()) { + delegates_ = other.delegates_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDelegatesIsMutable(); + delegates_.addAll(other.delegates_); + } + onChanged(); + } + if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) { + setPayload(other.getPayload()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.SignBlobRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.credentials.v1.SignBlobRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList delegates_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDelegatesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = new com.google.protobuf.LazyStringArrayList(delegates_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public com.google.protobuf.ProtocolStringList getDelegatesList() { + return delegates_.getUnmodifiableView(); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public int getDelegatesCount() { + return delegates_.size(); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public java.lang.String getDelegates(int index) { + return delegates_.get(index); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public com.google.protobuf.ByteString getDelegatesBytes(int index) { + return delegates_.getByteString(index); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder setDelegates(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDelegatesIsMutable(); + delegates_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder addDelegates(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDelegatesIsMutable(); + delegates_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder addAllDelegates(java.lang.Iterable values) { + ensureDelegatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, delegates_); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder clearDelegates() { + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder addDelegatesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDelegatesIsMutable(); + delegates_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The bytes to sign.
+     * 
+ * + * bytes payload = 5; + */ + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + /** + * + * + *
+     * The bytes to sign.
+     * 
+ * + * bytes payload = 5; + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + payload_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The bytes to sign.
+     * 
+ * + * bytes payload = 5; + */ + public Builder clearPayload() { + + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.SignBlobRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.SignBlobRequest) + private static final com.google.iam.credentials.v1.SignBlobRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.credentials.v1.SignBlobRequest(); + } + + public static com.google.iam.credentials.v1.SignBlobRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SignBlobRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SignBlobRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignBlobRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobRequestOrBuilder.java new file mode 100644 index 000000000000..3c36b70e64e5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobRequestOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface SignBlobRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.SignBlobRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + java.util.List getDelegatesList(); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + int getDelegatesCount(); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + java.lang.String getDelegates(int index); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + com.google.protobuf.ByteString getDelegatesBytes(int index); + + /** + * + * + *
+   * The bytes to sign.
+   * 
+ * + * bytes payload = 5; + */ + com.google.protobuf.ByteString getPayload(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobResponse.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobResponse.java new file mode 100644 index 000000000000..830612f0c816 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobResponse.java @@ -0,0 +1,664 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.SignBlobResponse} */ +public final class SignBlobResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.SignBlobResponse) + SignBlobResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SignBlobResponse.newBuilder() to construct. + private SignBlobResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SignBlobResponse() { + keyId_ = ""; + signedBlob_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SignBlobResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + keyId_ = s; + break; + } + case 34: + { + signedBlob_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.SignBlobResponse.class, + com.google.iam.credentials.v1.SignBlobResponse.Builder.class); + } + + public static final int KEY_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object keyId_; + /** + * + * + *
+   * The ID of the key used to sign the blob.
+   * 
+ * + * string key_id = 1; + */ + public java.lang.String getKeyId() { + java.lang.Object ref = keyId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the key used to sign the blob.
+   * 
+ * + * string key_id = 1; + */ + public com.google.protobuf.ByteString getKeyIdBytes() { + java.lang.Object ref = keyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIGNED_BLOB_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString signedBlob_; + /** + * + * + *
+   * The signed blob.
+   * 
+ * + * bytes signed_blob = 4; + */ + public com.google.protobuf.ByteString getSignedBlob() { + return signedBlob_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getKeyIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, keyId_); + } + if (!signedBlob_.isEmpty()) { + output.writeBytes(4, signedBlob_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, keyId_); + } + if (!signedBlob_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, signedBlob_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.credentials.v1.SignBlobResponse)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.SignBlobResponse other = + (com.google.iam.credentials.v1.SignBlobResponse) obj; + + boolean result = true; + result = result && getKeyId().equals(other.getKeyId()); + result = result && getSignedBlob().equals(other.getSignedBlob()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_ID_FIELD_NUMBER; + hash = (53 * hash) + getKeyId().hashCode(); + hash = (37 * hash) + SIGNED_BLOB_FIELD_NUMBER; + hash = (53 * hash) + getSignedBlob().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignBlobResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.credentials.v1.SignBlobResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.SignBlobResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.SignBlobResponse) + com.google.iam.credentials.v1.SignBlobResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.SignBlobResponse.class, + com.google.iam.credentials.v1.SignBlobResponse.Builder.class); + } + + // Construct using com.google.iam.credentials.v1.SignBlobResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + keyId_ = ""; + + signedBlob_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignBlobResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignBlobResponse getDefaultInstanceForType() { + return com.google.iam.credentials.v1.SignBlobResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignBlobResponse build() { + com.google.iam.credentials.v1.SignBlobResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignBlobResponse buildPartial() { + com.google.iam.credentials.v1.SignBlobResponse result = + new com.google.iam.credentials.v1.SignBlobResponse(this); + result.keyId_ = keyId_; + result.signedBlob_ = signedBlob_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.credentials.v1.SignBlobResponse) { + return mergeFrom((com.google.iam.credentials.v1.SignBlobResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.credentials.v1.SignBlobResponse other) { + if (other == com.google.iam.credentials.v1.SignBlobResponse.getDefaultInstance()) return this; + if (!other.getKeyId().isEmpty()) { + keyId_ = other.keyId_; + onChanged(); + } + if (other.getSignedBlob() != com.google.protobuf.ByteString.EMPTY) { + setSignedBlob(other.getSignedBlob()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.SignBlobResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.credentials.v1.SignBlobResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object keyId_ = ""; + /** + * + * + *
+     * The ID of the key used to sign the blob.
+     * 
+ * + * string key_id = 1; + */ + public java.lang.String getKeyId() { + java.lang.Object ref = keyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the key used to sign the blob.
+     * 
+ * + * string key_id = 1; + */ + public com.google.protobuf.ByteString getKeyIdBytes() { + java.lang.Object ref = keyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the key used to sign the blob.
+     * 
+ * + * string key_id = 1; + */ + public Builder setKeyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + keyId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the key used to sign the blob.
+     * 
+ * + * string key_id = 1; + */ + public Builder clearKeyId() { + + keyId_ = getDefaultInstance().getKeyId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the key used to sign the blob.
+     * 
+ * + * string key_id = 1; + */ + public Builder setKeyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + keyId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString signedBlob_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The signed blob.
+     * 
+ * + * bytes signed_blob = 4; + */ + public com.google.protobuf.ByteString getSignedBlob() { + return signedBlob_; + } + /** + * + * + *
+     * The signed blob.
+     * 
+ * + * bytes signed_blob = 4; + */ + public Builder setSignedBlob(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + signedBlob_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The signed blob.
+     * 
+ * + * bytes signed_blob = 4; + */ + public Builder clearSignedBlob() { + + signedBlob_ = getDefaultInstance().getSignedBlob(); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.SignBlobResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.SignBlobResponse) + private static final com.google.iam.credentials.v1.SignBlobResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.credentials.v1.SignBlobResponse(); + } + + public static com.google.iam.credentials.v1.SignBlobResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SignBlobResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SignBlobResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignBlobResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobResponseOrBuilder.java new file mode 100644 index 000000000000..153b0c21f1bb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignBlobResponseOrBuilder.java @@ -0,0 +1,42 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface SignBlobResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.SignBlobResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of the key used to sign the blob.
+   * 
+ * + * string key_id = 1; + */ + java.lang.String getKeyId(); + /** + * + * + *
+   * The ID of the key used to sign the blob.
+   * 
+ * + * string key_id = 1; + */ + com.google.protobuf.ByteString getKeyIdBytes(); + + /** + * + * + *
+   * The signed blob.
+   * 
+ * + * bytes signed_blob = 4; + */ + com.google.protobuf.ByteString getSignedBlob(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtRequest.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtRequest.java new file mode 100644 index 000000000000..cb6c6f0a8fa3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtRequest.java @@ -0,0 +1,1094 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.SignJwtRequest} */ +public final class SignJwtRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.SignJwtRequest) + SignJwtRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SignJwtRequest.newBuilder() to construct. + private SignJwtRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SignJwtRequest() { + name_ = ""; + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + payload_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SignJwtRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + delegates_.add(s); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + payload_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = delegates_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.SignJwtRequest.class, + com.google.iam.credentials.v1.SignJwtRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELEGATES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList delegates_; + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + public com.google.protobuf.ProtocolStringList getDelegatesList() { + return delegates_; + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + public int getDelegatesCount() { + return delegates_.size(); + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + public java.lang.String getDelegates(int index) { + return delegates_.get(index); + } + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + public com.google.protobuf.ByteString getDelegatesBytes(int index) { + return delegates_.getByteString(index); + } + + public static final int PAYLOAD_FIELD_NUMBER = 5; + private volatile java.lang.Object payload_; + /** + * + * + *
+   * The JWT payload to sign: a JSON object that contains a JWT Claims Set.
+   * 
+ * + * string payload = 5; + */ + public java.lang.String getPayload() { + java.lang.Object ref = payload_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payload_ = s; + return s; + } + } + /** + * + * + *
+   * The JWT payload to sign: a JSON object that contains a JWT Claims Set.
+   * 
+ * + * string payload = 5; + */ + public com.google.protobuf.ByteString getPayloadBytes() { + java.lang.Object ref = payload_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + payload_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < delegates_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, delegates_.getRaw(i)); + } + if (!getPayloadBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, payload_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < delegates_.size(); i++) { + dataSize += computeStringSizeNoTag(delegates_.getRaw(i)); + } + size += dataSize; + size += 1 * getDelegatesList().size(); + } + if (!getPayloadBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, payload_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.credentials.v1.SignJwtRequest)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.SignJwtRequest other = + (com.google.iam.credentials.v1.SignJwtRequest) obj; + + boolean result = true; + result = result && getName().equals(other.getName()); + result = result && getDelegatesList().equals(other.getDelegatesList()); + result = result && getPayload().equals(other.getPayload()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getDelegatesCount() > 0) { + hash = (37 * hash) + DELEGATES_FIELD_NUMBER; + hash = (53 * hash) + getDelegatesList().hashCode(); + } + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignJwtRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.credentials.v1.SignJwtRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.SignJwtRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.SignJwtRequest) + com.google.iam.credentials.v1.SignJwtRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.SignJwtRequest.class, + com.google.iam.credentials.v1.SignJwtRequest.Builder.class); + } + + // Construct using com.google.iam.credentials.v1.SignJwtRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + payload_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignJwtRequest getDefaultInstanceForType() { + return com.google.iam.credentials.v1.SignJwtRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignJwtRequest build() { + com.google.iam.credentials.v1.SignJwtRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignJwtRequest buildPartial() { + com.google.iam.credentials.v1.SignJwtRequest result = + new com.google.iam.credentials.v1.SignJwtRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = delegates_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.delegates_ = delegates_; + result.payload_ = payload_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.credentials.v1.SignJwtRequest) { + return mergeFrom((com.google.iam.credentials.v1.SignJwtRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.credentials.v1.SignJwtRequest other) { + if (other == com.google.iam.credentials.v1.SignJwtRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.delegates_.isEmpty()) { + if (delegates_.isEmpty()) { + delegates_ = other.delegates_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDelegatesIsMutable(); + delegates_.addAll(other.delegates_); + } + onChanged(); + } + if (!other.getPayload().isEmpty()) { + payload_ = other.payload_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.SignJwtRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.credentials.v1.SignJwtRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the service account for which the credentials
+     * are requested, in the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList delegates_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDelegatesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + delegates_ = new com.google.protobuf.LazyStringArrayList(delegates_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public com.google.protobuf.ProtocolStringList getDelegatesList() { + return delegates_.getUnmodifiableView(); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public int getDelegatesCount() { + return delegates_.size(); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public java.lang.String getDelegates(int index) { + return delegates_.get(index); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public com.google.protobuf.ByteString getDelegatesBytes(int index) { + return delegates_.getByteString(index); + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder setDelegates(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDelegatesIsMutable(); + delegates_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder addDelegates(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDelegatesIsMutable(); + delegates_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder addAllDelegates(java.lang.Iterable values) { + ensureDelegatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, delegates_); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder clearDelegates() { + delegates_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The sequence of service accounts in a delegation chain. Each service
+     * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on its next service account in the chain. The last service account in the
+     * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+     * on the service account that is specified in the `name` field of the
+     * request.
+     * The delegates must have the following format:
+     * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+     * 
+ * + * repeated string delegates = 3; + */ + public Builder addDelegatesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDelegatesIsMutable(); + delegates_.add(value); + onChanged(); + return this; + } + + private java.lang.Object payload_ = ""; + /** + * + * + *
+     * The JWT payload to sign: a JSON object that contains a JWT Claims Set.
+     * 
+ * + * string payload = 5; + */ + public java.lang.String getPayload() { + java.lang.Object ref = payload_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payload_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The JWT payload to sign: a JSON object that contains a JWT Claims Set.
+     * 
+ * + * string payload = 5; + */ + public com.google.protobuf.ByteString getPayloadBytes() { + java.lang.Object ref = payload_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + payload_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The JWT payload to sign: a JSON object that contains a JWT Claims Set.
+     * 
+ * + * string payload = 5; + */ + public Builder setPayload(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + payload_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The JWT payload to sign: a JSON object that contains a JWT Claims Set.
+     * 
+ * + * string payload = 5; + */ + public Builder clearPayload() { + + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + /** + * + * + *
+     * The JWT payload to sign: a JSON object that contains a JWT Claims Set.
+     * 
+ * + * string payload = 5; + */ + public Builder setPayloadBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + payload_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.SignJwtRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.SignJwtRequest) + private static final com.google.iam.credentials.v1.SignJwtRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.credentials.v1.SignJwtRequest(); + } + + public static com.google.iam.credentials.v1.SignJwtRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SignJwtRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SignJwtRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignJwtRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtRequestOrBuilder.java new file mode 100644 index 000000000000..e7cff79fd79e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtRequestOrBuilder.java @@ -0,0 +1,125 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface SignJwtRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.SignJwtRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the service account for which the credentials
+   * are requested, in the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + java.util.List getDelegatesList(); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + int getDelegatesCount(); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + java.lang.String getDelegates(int index); + /** + * + * + *
+   * The sequence of service accounts in a delegation chain. Each service
+   * account must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on its next service account in the chain. The last service account in the
+   * chain must be granted the `roles/iam.serviceAccountTokenCreator` role
+   * on the service account that is specified in the `name` field of the
+   * request.
+   * The delegates must have the following format:
+   * `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
+   * 
+ * + * repeated string delegates = 3; + */ + com.google.protobuf.ByteString getDelegatesBytes(int index); + + /** + * + * + *
+   * The JWT payload to sign: a JSON object that contains a JWT Claims Set.
+   * 
+ * + * string payload = 5; + */ + java.lang.String getPayload(); + /** + * + * + *
+   * The JWT payload to sign: a JSON object that contains a JWT Claims Set.
+   * 
+ * + * string payload = 5; + */ + com.google.protobuf.ByteString getPayloadBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtResponse.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtResponse.java new file mode 100644 index 000000000000..a860889f94b9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtResponse.java @@ -0,0 +1,742 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +/** Protobuf type {@code google.iam.credentials.v1.SignJwtResponse} */ +public final class SignJwtResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.SignJwtResponse) + SignJwtResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SignJwtResponse.newBuilder() to construct. + private SignJwtResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SignJwtResponse() { + keyId_ = ""; + signedJwt_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SignJwtResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + keyId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + signedJwt_ = s; + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.SignJwtResponse.class, + com.google.iam.credentials.v1.SignJwtResponse.Builder.class); + } + + public static final int KEY_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object keyId_; + /** + * + * + *
+   * The ID of the key used to sign the JWT.
+   * 
+ * + * string key_id = 1; + */ + public java.lang.String getKeyId() { + java.lang.Object ref = keyId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the key used to sign the JWT.
+   * 
+ * + * string key_id = 1; + */ + public com.google.protobuf.ByteString getKeyIdBytes() { + java.lang.Object ref = keyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIGNED_JWT_FIELD_NUMBER = 2; + private volatile java.lang.Object signedJwt_; + /** + * + * + *
+   * The signed JWT.
+   * 
+ * + * string signed_jwt = 2; + */ + public java.lang.String getSignedJwt() { + java.lang.Object ref = signedJwt_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + signedJwt_ = s; + return s; + } + } + /** + * + * + *
+   * The signed JWT.
+   * 
+ * + * string signed_jwt = 2; + */ + public com.google.protobuf.ByteString getSignedJwtBytes() { + java.lang.Object ref = signedJwt_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + signedJwt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getKeyIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, keyId_); + } + if (!getSignedJwtBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, signedJwt_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, keyId_); + } + if (!getSignedJwtBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, signedJwt_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.iam.credentials.v1.SignJwtResponse)) { + return super.equals(obj); + } + com.google.iam.credentials.v1.SignJwtResponse other = + (com.google.iam.credentials.v1.SignJwtResponse) obj; + + boolean result = true; + result = result && getKeyId().equals(other.getKeyId()); + result = result && getSignedJwt().equals(other.getSignedJwt()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_ID_FIELD_NUMBER; + hash = (53 * hash) + getKeyId().hashCode(); + hash = (37 * hash) + SIGNED_JWT_FIELD_NUMBER; + hash = (53 * hash) + getSignedJwt().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.iam.credentials.v1.SignJwtResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.iam.credentials.v1.SignJwtResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.iam.credentials.v1.SignJwtResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.credentials.v1.SignJwtResponse) + com.google.iam.credentials.v1.SignJwtResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.credentials.v1.SignJwtResponse.class, + com.google.iam.credentials.v1.SignJwtResponse.Builder.class); + } + + // Construct using com.google.iam.credentials.v1.SignJwtResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + keyId_ = ""; + + signedJwt_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.credentials.v1.IAMCredentialsCommonProto + .internal_static_google_iam_credentials_v1_SignJwtResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignJwtResponse getDefaultInstanceForType() { + return com.google.iam.credentials.v1.SignJwtResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignJwtResponse build() { + com.google.iam.credentials.v1.SignJwtResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignJwtResponse buildPartial() { + com.google.iam.credentials.v1.SignJwtResponse result = + new com.google.iam.credentials.v1.SignJwtResponse(this); + result.keyId_ = keyId_; + result.signedJwt_ = signedJwt_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.credentials.v1.SignJwtResponse) { + return mergeFrom((com.google.iam.credentials.v1.SignJwtResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.credentials.v1.SignJwtResponse other) { + if (other == com.google.iam.credentials.v1.SignJwtResponse.getDefaultInstance()) return this; + if (!other.getKeyId().isEmpty()) { + keyId_ = other.keyId_; + onChanged(); + } + if (!other.getSignedJwt().isEmpty()) { + signedJwt_ = other.signedJwt_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.iam.credentials.v1.SignJwtResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.iam.credentials.v1.SignJwtResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object keyId_ = ""; + /** + * + * + *
+     * The ID of the key used to sign the JWT.
+     * 
+ * + * string key_id = 1; + */ + public java.lang.String getKeyId() { + java.lang.Object ref = keyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the key used to sign the JWT.
+     * 
+ * + * string key_id = 1; + */ + public com.google.protobuf.ByteString getKeyIdBytes() { + java.lang.Object ref = keyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the key used to sign the JWT.
+     * 
+ * + * string key_id = 1; + */ + public Builder setKeyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + keyId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the key used to sign the JWT.
+     * 
+ * + * string key_id = 1; + */ + public Builder clearKeyId() { + + keyId_ = getDefaultInstance().getKeyId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the key used to sign the JWT.
+     * 
+ * + * string key_id = 1; + */ + public Builder setKeyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + keyId_ = value; + onChanged(); + return this; + } + + private java.lang.Object signedJwt_ = ""; + /** + * + * + *
+     * The signed JWT.
+     * 
+ * + * string signed_jwt = 2; + */ + public java.lang.String getSignedJwt() { + java.lang.Object ref = signedJwt_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + signedJwt_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The signed JWT.
+     * 
+ * + * string signed_jwt = 2; + */ + public com.google.protobuf.ByteString getSignedJwtBytes() { + java.lang.Object ref = signedJwt_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + signedJwt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The signed JWT.
+     * 
+ * + * string signed_jwt = 2; + */ + public Builder setSignedJwt(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + signedJwt_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The signed JWT.
+     * 
+ * + * string signed_jwt = 2; + */ + public Builder clearSignedJwt() { + + signedJwt_ = getDefaultInstance().getSignedJwt(); + onChanged(); + return this; + } + /** + * + * + *
+     * The signed JWT.
+     * 
+ * + * string signed_jwt = 2; + */ + public Builder setSignedJwtBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + signedJwt_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.iam.credentials.v1.SignJwtResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.credentials.v1.SignJwtResponse) + private static final com.google.iam.credentials.v1.SignJwtResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.credentials.v1.SignJwtResponse(); + } + + public static com.google.iam.credentials.v1.SignJwtResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SignJwtResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SignJwtResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.iam.credentials.v1.SignJwtResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtResponseOrBuilder.java new file mode 100644 index 000000000000..05c0292f551c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/iam/credentials/v1/SignJwtResponseOrBuilder.java @@ -0,0 +1,52 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/common.proto + +package com.google.iam.credentials.v1; + +public interface SignJwtResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.credentials.v1.SignJwtResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The ID of the key used to sign the JWT.
+   * 
+ * + * string key_id = 1; + */ + java.lang.String getKeyId(); + /** + * + * + *
+   * The ID of the key used to sign the JWT.
+   * 
+ * + * string key_id = 1; + */ + com.google.protobuf.ByteString getKeyIdBytes(); + + /** + * + * + *
+   * The signed JWT.
+   * 
+ * + * string signed_jwt = 2; + */ + java.lang.String getSignedJwt(); + /** + * + * + *
+   * The signed JWT.
+   * 
+ * + * string signed_jwt = 2; + */ + com.google.protobuf.ByteString getSignedJwtBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/google/iam/credentials/v1/Iamcredentials.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/google/iam/credentials/v1/Iamcredentials.java new file mode 100644 index 000000000000..79fb6bb18fa1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/google/iam/credentials/v1/Iamcredentials.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/iam/credentials/v1/iamcredentials.proto + +package google.iam.credentials.v1; + +public final class Iamcredentials { + private Iamcredentials() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/iam/credentials/v1/iamcredentia" + + "ls.proto\022\031google.iam.credentials.v1\032\034goo" + + "gle/api/annotations.proto\032&google/iam/cr" + + "edentials/v1/common.proto2\353\007\n\016IAMCredent" + + "ials\022\314\001\n\023GenerateAccessToken\0225.google.ia" + + "m.credentials.v1.GenerateAccessTokenRequ" + + "est\0326.google.iam.credentials.v1.Generate" + + "AccessTokenResponse\"F\202\323\344\223\002@\";/v1/{name=p" + + "rojects/*/serviceAccounts/*}:generateAcc" + + "essToken:\001*\022\274\001\n\017GenerateIdToken\0221.google" + + ".iam.credentials.v1.GenerateIdTokenReque" + + "st\0322.google.iam.credentials.v1.GenerateI" + + "dTokenResponse\"B\202\323\344\223\002<\"7/v1/{name=projec" + + "ts/*/serviceAccounts/*}:generateIdToken:" + + "\001*\022\240\001\n\010SignBlob\022*.google.iam.credentials" + + ".v1.SignBlobRequest\032+.google.iam.credent" + + "ials.v1.SignBlobResponse\";\202\323\344\223\0025\"0/v1/{n" + + "ame=projects/*/serviceAccounts/*}:signBl" + + "ob:\001*\022\234\001\n\007SignJwt\022).google.iam.credentia" + + "ls.v1.SignJwtRequest\032*.google.iam.creden" + + "tials.v1.SignJwtResponse\":\202\323\344\223\0024\"//v1/{n" + + "ame=projects/*/serviceAccounts/*}:signJw" + + "t:\001*\022\210\002\n\"GenerateIdentityBindingAccessTo" + + "ken\022D.google.iam.credentials.v1.Generate" + + "IdentityBindingAccessTokenRequest\032E.goog" + + "le.iam.credentials.v1.GenerateIdentityBi" + + "ndingAccessTokenResponse\"U\202\323\344\223\002O\"J/v1/{n" + + "ame=projects/*/serviceAccounts/*}:genera" + + "teIdentityBindingAccessToken:\001*BIZDgoogl" + + "e.golang.org/genproto/googleapis/iam/cre" + + "dentials/v1;credentials\370\001\001b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.iam.credentials.v1.IAMCredentialsCommonProto.getDescriptor(), + }, + assigner); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.iam.credentials.v1.IAMCredentialsCommonProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/proto/google/iam/credentials/v1/common.proto b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/proto/google/iam/credentials/v1/common.proto index 4fb12530ce00..19997df00008 100644 --- a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/proto/google/iam/credentials/v1/common.proto +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/proto/google/iam/credentials/v1/common.proto @@ -23,7 +23,7 @@ option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/iam/credentials/v1;credentials"; option java_multiple_files = true; option java_outer_classname = "IAMCredentialsCommonProto"; -option java_package = "com.google.cloud.iam.credentials.v1"; +option java_package = "com.google.iam.credentials.v1"; message GenerateAccessTokenRequest { @@ -154,3 +154,71 @@ message GenerateIdTokenResponse { string token = 1; } +message GenerateIdentityBindingAccessTokenRequest { + // The resource name of the service account for which the credentials + // are requested, in the following format: + // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. + string name = 1; + + // Code to identify the scopes to be included in the OAuth 2.0 access token. + // See https://developers.google.com/identity/protocols/googlescopes for more + // information. + // At least one value required. + repeated string scope = 2; + + // Required. Input token. + // Must be in JWT format according to + // RFC7523 (https://tools.ietf.org/html/rfc7523) + // and must have 'kid' field in the header. + // Supported signing algorithms: RS256 (RS512, ES256, ES512 coming soon). + // Mandatory payload fields (along the lines of RFC 7523, section 3): + // - iss: issuer of the token. Must provide a discovery document at + // $iss/.well-known/openid-configuration . The document needs to be + // formatted according to section 4.2 of the OpenID Connect Discovery + // 1.0 specification. + // - iat: Issue time in seconds since epoch. Must be in the past. + // - exp: Expiration time in seconds since epoch. Must be less than 48 hours + // after iat. We recommend to create tokens that last shorter than 6 + // hours to improve security unless business reasons mandate longer + // expiration times. Shorter token lifetimes are generally more secure + // since tokens that have been exfiltrated by attackers can be used for + // a shorter time. you can configure the maximum lifetime of the + // incoming token in the configuration of the mapper. + // The resulting Google token will expire within an hour or at "exp", + // whichever is earlier. + // - sub: JWT subject, identity asserted in the JWT. + // - aud: Configured in the mapper policy. By default the service account + // email. + // + // Claims from the incoming token can be transferred into the output token + // accoding to the mapper configuration. The outgoing claim size is limited. + // Outgoing claims size must be less than 4kB serialized as JSON without + // whitespace. + // + // Example header: + // { + // "alg": "RS256", + // "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8" + // } + // Example payload: + // { + // "iss": "https://accounts.google.com", + // "iat": 1517963104, + // "exp": 1517966704, + // "aud": "https://iamcredentials.googleapis.com/", + // "sub": "113475438248934895348", + // "my_claims": { + // "additional_claim": "value" + // } + // } + string jwt = 3; +} + +message GenerateIdentityBindingAccessTokenResponse { + // The OAuth 2.0 access token. + string access_token = 1; + + // Token expiration time. + // The expiration time is always set. + google.protobuf.Timestamp expire_time = 2; +} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/proto/google/iam/credentials/v1/iamcredentials.proto b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/proto/google/iam/credentials/v1/iamcredentials.proto index 9ab1c3240c19..4960d7203621 100644 --- a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/proto/google/iam/credentials/v1/iamcredentials.proto +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/proto/google/iam/credentials/v1/iamcredentials.proto @@ -21,9 +21,6 @@ import "google/iam/credentials/v1/common.proto"; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/iam/credentials/v1;credentials"; -option java_multiple_files = true; -option java_outer_classname = "IAMCredentialsProto"; -option java_package = "com.google.cloud.iam.credentials.v1"; // A service account is a special type of Google account that belongs to your @@ -67,4 +64,15 @@ service IAMCredentials { body: "*" }; } + + // Exchange a JWT signed by third party identity provider to an OAuth 2.0 + // access token + rpc GenerateIdentityBindingAccessToken( + GenerateIdentityBindingAccessTokenRequest) + returns (GenerateIdentityBindingAccessTokenResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/serviceAccounts/*}:generateIdentityBindingAccessToken" + body: "*" + }; + } } diff --git a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java index 9886cba6df55..1b8505d0cdc4 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java +++ b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java @@ -21,6 +21,16 @@ import com.google.api.pathtemplate.PathTemplate; import com.google.cloud.iam.credentials.v1.stub.IamCredentialsStub; import com.google.cloud.iam.credentials.v1.stub.IamCredentialsStubSettings; +import com.google.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; +import com.google.iam.credentials.v1.SignBlobRequest; +import com.google.iam.credentials.v1.SignBlobResponse; +import com.google.iam.credentials.v1.SignJwtRequest; +import com.google.iam.credentials.v1.SignJwtResponse; import com.google.protobuf.ByteString; import com.google.protobuf.Duration; import java.io.IOException; @@ -550,6 +560,118 @@ public final UnaryCallable signJwtCallable() { return stub.signJwtCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exchange a JWT signed by third party identity provider to an OAuth 2.0 access token + * + *

Sample code: + * + *


+   * try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
+   *   String formattedName = IamCredentialsClient.formatServiceAccountName("[PROJECT]", "[SERVICE_ACCOUNT]");
+   *   List<String> scope = new ArrayList<>();
+   *   String jwt = "";
+   *   GenerateIdentityBindingAccessTokenResponse response = iamCredentialsClient.generateIdentityBindingAccessToken(formattedName, scope, jwt);
+   * }
+   * 
+ * + * @param name The resource name of the service account for which the credentials are requested, + * in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. + * @param scope Code to identify the scopes to be included in the OAuth 2.0 access token. See + * https://developers.google.com/identity/protocols/googlescopes for more information. At + * least one value required. + * @param jwt Required. Input token. Must be in JWT format according to RFC7523 + * (https://tools.ietf.org/html/rfc7523) and must have 'kid' field in the header. Supported + * signing algorithms: RS256 (RS512, ES256, ES512 coming soon). Mandatory payload fields + * (along the lines of RFC 7523, section 3): - iss: issuer of the token. Must provide a + * discovery document at $iss/.well-known/openid-configuration . The document needs to be + * formatted according to section 4.2 of the OpenID Connect Discovery 1.0 specification. - + * iat: Issue time in seconds since epoch. Must be in the past. - exp: Expiration time in + * seconds since epoch. Must be less than 48 hours after iat. We recommend to create tokens + * that last shorter than 6 hours to improve security unless business reasons mandate longer + * expiration times. Shorter token lifetimes are generally more secure since tokens that have + * been exfiltrated by attackers can be used for a shorter time. you can configure the maximum + * lifetime of the incoming token in the configuration of the mapper. The resulting Google + * token will expire within an hour or at "exp", whichever is earlier. - sub: JWT subject, + * identity asserted in the JWT. - aud: Configured in the mapper policy. By default the + * service account email. + *

Claims from the incoming token can be transferred into the output token accoding to the + * mapper configuration. The outgoing claim size is limited. Outgoing claims size must be less + * than 4kB serialized as JSON without whitespace. + *

Example header: { "alg": "RS256", "kid": "92a4265e14ab04d4d228a48d10d4ca31610936f8" } + * Example payload: { "iss": "https://accounts.google.com", "iat": 1517963104, "exp": + * 1517966704, "aud": "https://iamcredentials.googleapis.com/", "sub": + * "113475438248934895348", "my_claims": { "additional_claim": "value" } } + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateIdentityBindingAccessTokenResponse generateIdentityBindingAccessToken( + String name, List scope, String jwt) { + SERVICE_ACCOUNT_PATH_TEMPLATE.validate(name, "generateIdentityBindingAccessToken"); + GenerateIdentityBindingAccessTokenRequest request = + GenerateIdentityBindingAccessTokenRequest.newBuilder() + .setName(name) + .addAllScope(scope) + .setJwt(jwt) + .build(); + return generateIdentityBindingAccessToken(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exchange a JWT signed by third party identity provider to an OAuth 2.0 access token + * + *

Sample code: + * + *


+   * try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
+   *   String formattedName = IamCredentialsClient.formatServiceAccountName("[PROJECT]", "[SERVICE_ACCOUNT]");
+   *   List<String> scope = new ArrayList<>();
+   *   String jwt = "";
+   *   GenerateIdentityBindingAccessTokenRequest request = GenerateIdentityBindingAccessTokenRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .addAllScope(scope)
+   *     .setJwt(jwt)
+   *     .build();
+   *   GenerateIdentityBindingAccessTokenResponse response = iamCredentialsClient.generateIdentityBindingAccessToken(request);
+   * }
+   * 
+ * + * @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 GenerateIdentityBindingAccessTokenResponse generateIdentityBindingAccessToken( + GenerateIdentityBindingAccessTokenRequest request) { + return generateIdentityBindingAccessTokenCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exchange a JWT signed by third party identity provider to an OAuth 2.0 access token + * + *

Sample code: + * + *


+   * try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
+   *   String formattedName = IamCredentialsClient.formatServiceAccountName("[PROJECT]", "[SERVICE_ACCOUNT]");
+   *   List<String> scope = new ArrayList<>();
+   *   String jwt = "";
+   *   GenerateIdentityBindingAccessTokenRequest request = GenerateIdentityBindingAccessTokenRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .addAllScope(scope)
+   *     .setJwt(jwt)
+   *     .build();
+   *   ApiFuture<GenerateIdentityBindingAccessTokenResponse> future = iamCredentialsClient.generateIdentityBindingAccessTokenCallable().futureCall(request);
+   *   // Do something
+   *   GenerateIdentityBindingAccessTokenResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenCallable() { + return stub.generateIdentityBindingAccessTokenCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java index 363a5a534f1c..f1831feedaf5 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java +++ b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java @@ -26,6 +26,16 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.iam.credentials.v1.stub.IamCredentialsStubSettings; +import com.google.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; +import com.google.iam.credentials.v1.SignBlobRequest; +import com.google.iam.credentials.v1.SignBlobResponse; +import com.google.iam.credentials.v1.SignJwtRequest; +import com.google.iam.credentials.v1.SignJwtResponse; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -82,6 +92,14 @@ public UnaryCallSettings signJwtSettings() { return ((IamCredentialsStubSettings) getStubSettings()).signJwtSettings(); } + /** Returns the object with the settings used for calls to generateIdentityBindingAccessToken. */ + public UnaryCallSettings< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenSettings() { + return ((IamCredentialsStubSettings) getStubSettings()) + .generateIdentityBindingAccessTokenSettings(); + } + public static final IamCredentialsSettings create(IamCredentialsStubSettings stub) throws IOException { return new IamCredentialsSettings.Builder(stub.toBuilder()).build(); @@ -201,6 +219,15 @@ public UnaryCallSettings.Builder signJwtSetting return getStubSettingsBuilder().signJwtSettings(); } + /** + * Returns the builder for the settings used for calls to generateIdentityBindingAccessToken. + */ + public UnaryCallSettings.Builder< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenSettings() { + return getStubSettingsBuilder().generateIdentityBindingAccessTokenSettings(); + } + @Override public IamCredentialsSettings build() throws IOException { return new IamCredentialsSettings(this); diff --git a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java index bed050b4a10e..ab43c9a9755a 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java +++ b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java @@ -22,14 +22,16 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.iam.credentials.v1.GenerateAccessTokenRequest; -import com.google.cloud.iam.credentials.v1.GenerateAccessTokenResponse; -import com.google.cloud.iam.credentials.v1.GenerateIdTokenRequest; -import com.google.cloud.iam.credentials.v1.GenerateIdTokenResponse; -import com.google.cloud.iam.credentials.v1.SignBlobRequest; -import com.google.cloud.iam.credentials.v1.SignBlobResponse; -import com.google.cloud.iam.credentials.v1.SignJwtRequest; -import com.google.cloud.iam.credentials.v1.SignJwtResponse; +import com.google.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; +import com.google.iam.credentials.v1.SignBlobRequest; +import com.google.iam.credentials.v1.SignBlobResponse; +import com.google.iam.credentials.v1.SignJwtRequest; +import com.google.iam.credentials.v1.SignJwtResponse; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -81,6 +83,23 @@ public class GrpcIamCredentialsStub extends IamCredentialsStub { .setRequestMarshaller(ProtoUtils.marshaller(SignJwtRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SignJwtResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.iam.credentials.v1.IAMCredentials/GenerateIdentityBindingAccessToken") + .setRequestMarshaller( + ProtoUtils.marshaller( + GenerateIdentityBindingAccessTokenRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + GenerateIdentityBindingAccessTokenResponse.getDefaultInstance())) + .build(); private final BackgroundResource backgroundResources; @@ -90,6 +109,9 @@ public class GrpcIamCredentialsStub extends IamCredentialsStub { generateIdTokenCallable; private final UnaryCallable signBlobCallable; private final UnaryCallable signJwtCallable; + private final UnaryCallable< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenCallable; private final GrpcStubCallableFactory callableFactory; @@ -150,6 +172,15 @@ protected GrpcIamCredentialsStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(signJwtMethodDescriptor) .build(); + GrpcCallSettings< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(generateIdentityBindingAccessTokenMethodDescriptor) + .build(); this.generateAccessTokenCallable = callableFactory.createUnaryCallable( @@ -165,6 +196,11 @@ protected GrpcIamCredentialsStub( this.signJwtCallable = callableFactory.createUnaryCallable( signJwtTransportSettings, settings.signJwtSettings(), clientContext); + this.generateIdentityBindingAccessTokenCallable = + callableFactory.createUnaryCallable( + generateIdentityBindingAccessTokenTransportSettings, + settings.generateIdentityBindingAccessTokenSettings(), + clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -186,6 +222,12 @@ public UnaryCallable signJwtCallable() { return signJwtCallable; } + public UnaryCallable< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenCallable() { + return generateIdentityBindingAccessTokenCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java index b6c99ff4bb74..25c00bf7a469 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java +++ b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java @@ -18,14 +18,16 @@ import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.iam.credentials.v1.GenerateAccessTokenRequest; -import com.google.cloud.iam.credentials.v1.GenerateAccessTokenResponse; -import com.google.cloud.iam.credentials.v1.GenerateIdTokenRequest; -import com.google.cloud.iam.credentials.v1.GenerateIdTokenResponse; -import com.google.cloud.iam.credentials.v1.SignBlobRequest; -import com.google.cloud.iam.credentials.v1.SignBlobResponse; -import com.google.cloud.iam.credentials.v1.SignJwtRequest; -import com.google.cloud.iam.credentials.v1.SignJwtResponse; +import com.google.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; +import com.google.iam.credentials.v1.SignBlobRequest; +import com.google.iam.credentials.v1.SignBlobResponse; +import com.google.iam.credentials.v1.SignJwtRequest; +import com.google.iam.credentials.v1.SignJwtResponse; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -55,6 +57,13 @@ public UnaryCallable signJwtCallable() { throw new UnsupportedOperationException("Not implemented: signJwtCallable()"); } + public UnaryCallable< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenCallable() { + throw new UnsupportedOperationException( + "Not implemented: generateIdentityBindingAccessTokenCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java index e6b865af9447..d4dba57cce7d 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java +++ b/google-cloud-clients/google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java @@ -30,18 +30,20 @@ import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.iam.credentials.v1.GenerateAccessTokenRequest; -import com.google.cloud.iam.credentials.v1.GenerateAccessTokenResponse; -import com.google.cloud.iam.credentials.v1.GenerateIdTokenRequest; -import com.google.cloud.iam.credentials.v1.GenerateIdTokenResponse; -import com.google.cloud.iam.credentials.v1.SignBlobRequest; -import com.google.cloud.iam.credentials.v1.SignBlobResponse; -import com.google.cloud.iam.credentials.v1.SignJwtRequest; -import com.google.cloud.iam.credentials.v1.SignJwtResponse; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; +import com.google.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; +import com.google.iam.credentials.v1.SignBlobRequest; +import com.google.iam.credentials.v1.SignBlobResponse; +import com.google.iam.credentials.v1.SignJwtRequest; +import com.google.iam.credentials.v1.SignJwtResponse; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -87,6 +89,9 @@ public class IamCredentialsStubSettings extends StubSettings signBlobSettings; private final UnaryCallSettings signJwtSettings; + private final UnaryCallSettings< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenSettings; /** Returns the object with the settings used for calls to generateAccessToken. */ public UnaryCallSettings @@ -110,6 +115,13 @@ public UnaryCallSettings signJwtSettings() { return signJwtSettings; } + /** Returns the object with the settings used for calls to generateIdentityBindingAccessToken. */ + public UnaryCallSettings< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenSettings() { + return generateIdentityBindingAccessTokenSettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public IamCredentialsStub createStub() throws IOException { if (getTransportChannelProvider() @@ -182,6 +194,8 @@ protected IamCredentialsStubSettings(Builder settingsBuilder) throws IOException generateIdTokenSettings = settingsBuilder.generateIdTokenSettings().build(); signBlobSettings = settingsBuilder.signBlobSettings().build(); signJwtSettings = settingsBuilder.signJwtSettings().build(); + generateIdentityBindingAccessTokenSettings = + settingsBuilder.generateIdentityBindingAccessTokenSettings().build(); } /** Builder for IamCredentialsStubSettings. */ @@ -194,6 +208,9 @@ public static class Builder extends StubSettings.Builder signBlobSettings; private final UnaryCallSettings.Builder signJwtSettings; + private final UnaryCallSettings.Builder< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -244,12 +261,15 @@ protected Builder(ClientContext clientContext) { signJwtSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + generateIdentityBindingAccessTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( generateAccessTokenSettings, generateIdTokenSettings, signBlobSettings, - signJwtSettings); + signJwtSettings, + generateIdentityBindingAccessTokenSettings); initDefaults(this); } @@ -285,6 +305,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .generateIdentityBindingAccessTokenSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -295,13 +320,16 @@ protected Builder(IamCredentialsStubSettings settings) { generateIdTokenSettings = settings.generateIdTokenSettings.toBuilder(); signBlobSettings = settings.signBlobSettings.toBuilder(); signJwtSettings = settings.signJwtSettings.toBuilder(); + generateIdentityBindingAccessTokenSettings = + settings.generateIdentityBindingAccessTokenSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( generateAccessTokenSettings, generateIdTokenSettings, signBlobSettings, - signJwtSettings); + signJwtSettings, + generateIdentityBindingAccessTokenSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -342,6 +370,15 @@ public UnaryCallSettings.Builder signJwtSetting return signJwtSettings; } + /** + * Returns the builder for the settings used for calls to generateIdentityBindingAccessToken. + */ + public UnaryCallSettings.Builder< + GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> + generateIdentityBindingAccessTokenSettings() { + return generateIdentityBindingAccessTokenSettings; + } + @Override public IamCredentialsStubSettings build() throws IOException { return new IamCredentialsStubSettings(this); diff --git a/google-cloud-clients/google-cloud-iamcredentials/src/test/java/com/google/cloud/iam/credentials/v1/IamCredentialsClientTest.java b/google-cloud-clients/google-cloud-iamcredentials/src/test/java/com/google/cloud/iam/credentials/v1/IamCredentialsClientTest.java index 8f275a594bfc..927e53edf01c 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/src/test/java/com/google/cloud/iam/credentials/v1/IamCredentialsClientTest.java +++ b/google-cloud-clients/google-cloud-iamcredentials/src/test/java/com/google/cloud/iam/credentials/v1/IamCredentialsClientTest.java @@ -22,6 +22,16 @@ import com.google.api.gax.grpc.testing.MockServiceHelper; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; +import com.google.iam.credentials.v1.SignBlobRequest; +import com.google.iam.credentials.v1.SignBlobResponse; +import com.google.iam.credentials.v1.SignJwtRequest; +import com.google.iam.credentials.v1.SignJwtResponse; import com.google.protobuf.ByteString; import com.google.protobuf.Duration; import com.google.protobuf.GeneratedMessageV3; @@ -276,4 +286,54 @@ public void signJwtExceptionTest() throws Exception { // Expected exception } } + + @Test + @SuppressWarnings("all") + public void generateIdentityBindingAccessTokenTest() { + String accessToken = "accessToken-1938933922"; + GenerateIdentityBindingAccessTokenResponse expectedResponse = + GenerateIdentityBindingAccessTokenResponse.newBuilder().setAccessToken(accessToken).build(); + mockIAMCredentials.addResponse(expectedResponse); + + String formattedName = + IamCredentialsClient.formatServiceAccountName("[PROJECT]", "[SERVICE_ACCOUNT]"); + List scope = new ArrayList<>(); + String jwt = "jwt105671"; + + GenerateIdentityBindingAccessTokenResponse actualResponse = + client.generateIdentityBindingAccessToken(formattedName, scope, jwt); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMCredentials.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateIdentityBindingAccessTokenRequest actualRequest = + (GenerateIdentityBindingAccessTokenRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(scope, actualRequest.getScopeList()); + Assert.assertEquals(jwt, actualRequest.getJwt()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void generateIdentityBindingAccessTokenExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockIAMCredentials.addException(exception); + + try { + String formattedName = + IamCredentialsClient.formatServiceAccountName("[PROJECT]", "[SERVICE_ACCOUNT]"); + List scope = new ArrayList<>(); + String jwt = "jwt105671"; + + client.generateIdentityBindingAccessToken(formattedName, scope, jwt); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } } diff --git a/google-cloud-clients/google-cloud-iamcredentials/src/test/java/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java b/google-cloud-clients/google-cloud-iamcredentials/src/test/java/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java index b9f106d5d1c6..947eb5d63e88 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/src/test/java/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java +++ b/google-cloud-clients/google-cloud-iamcredentials/src/test/java/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java @@ -16,8 +16,18 @@ package com.google.cloud.iam.credentials.v1; import com.google.api.core.BetaApi; -import com.google.cloud.iam.credentials.v1.IAMCredentialsGrpc.IAMCredentialsImplBase; +import com.google.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest; +import com.google.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; +import com.google.iam.credentials.v1.SignBlobRequest; +import com.google.iam.credentials.v1.SignBlobResponse; +import com.google.iam.credentials.v1.SignJwtRequest; +import com.google.iam.credentials.v1.SignJwtResponse; import com.google.protobuf.GeneratedMessageV3; +import com.google.protos.google.iam.credentials.v1.IAMCredentialsGrpc.IAMCredentialsImplBase; import io.grpc.stub.StreamObserver; import java.util.ArrayList; import java.util.LinkedList; @@ -114,4 +124,20 @@ public void signJwt(SignJwtRequest request, StreamObserver resp responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } } + + @Override + public void generateIdentityBindingAccessToken( + GenerateIdentityBindingAccessTokenRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof GenerateIdentityBindingAccessTokenResponse) { + requests.add(request); + responseObserver.onNext((GenerateIdentityBindingAccessTokenResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } } diff --git a/google-cloud-clients/google-cloud-iamcredentials/synth.metadata b/google-cloud-clients/google-cloud-iamcredentials/synth.metadata index 4541e1ba854a..22702466cd80 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/synth.metadata +++ b/google-cloud-clients/google-cloud-iamcredentials/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2018-12-12T22:58:16.947668Z", + "updateTime": "2018-12-18T08:47:43.859624Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.2", - "dockerImage": "googleapis/artman@sha256:2f6b261ee7fe1aedf238991c93a20b3820de37a343d0cacf3e3e9555c2aaf2ea" + "version": "0.16.3", + "dockerImage": "googleapis/artman@sha256:bfb92654b4a77368471f70e2808eaf4e60f263b9559f27bb3284097322787bf1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a207551d5190d2dc915ea261f19ce83eeee000d3", - "internalRef": "225249459" + "sha": "c04bc0dc0a9164d924a9ab923fd6845b4ae6a7ab", + "internalRef": "225851467" } } ],