From a2be10db666101e25814a13488438cbeaa45d094 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Thu, 27 Jun 2019 00:45:30 -0700 Subject: [PATCH 1/2] Regenerate iamcredentials client --- .../credentials/v1/IAMCredentialsGrpc.java | 160 ----------------- .../v1/IAMCredentialsCommonProto.java | 39 +--- .../credentials/v1/IAMCredentialsProto.java | 17 +- .../google/iam/credentials/v1/common.proto | 69 ------- .../iam/credentials/v1/iamcredentials.proto | 11 -- .../credentials/v1/IamCredentialsClient.java | 168 ------------------ .../v1/IamCredentialsSettings.java | 17 -- .../v1/stub/GrpcIamCredentialsStub.java | 52 ------ .../v1/stub/IamCredentialsStub.java | 9 - .../v1/stub/IamCredentialsStubSettings.java | 41 +---- .../v1/IamCredentialsClientTest.java | 48 ----- .../v1/MockIAMCredentialsImpl.java | 16 -- .../synth.metadata | 10 +- 13 files changed, 17 insertions(+), 640 deletions(-) diff --git a/google-api-grpc/grpc-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsGrpc.java b/google-api-grpc/grpc-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsGrpc.java index 86bdbda03ac8..64f247bfb9a2 100644 --- a/google-api-grpc/grpc-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsGrpc.java +++ b/google-api-grpc/grpc-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsGrpc.java @@ -266,74 +266,6 @@ private IAMCredentialsGrpc() {} 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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> - METHOD_GENERATE_IDENTITY_BINDING_ACCESS_TOKEN = - getGenerateIdentityBindingAccessTokenMethodHelper(); - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> - getGenerateIdentityBindingAccessTokenMethod; - - @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") - public static io.grpc.MethodDescriptor< - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> - getGenerateIdentityBindingAccessTokenMethod() { - return getGenerateIdentityBindingAccessTokenMethodHelper(); - } - - private static io.grpc.MethodDescriptor< - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> - getGenerateIdentityBindingAccessTokenMethodHelper() { - io.grpc.MethodDescriptor< - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, - com.google.cloud.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.cloud.iam.credentials.v1 - .GenerateIdentityBindingAccessTokenRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.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); @@ -423,23 +355,6 @@ public void signJwt( asyncUnimplementedUnaryCall(getSignJwtMethodHelper(), responseObserver); } - /** - * - * - *
-     * Exchange a JWT signed by third party identity provider to an OAuth 2.0
-     * access token
-     * 
- */ - public void generateIdentityBindingAccessToken( - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> - responseObserver) { - asyncUnimplementedUnaryCall( - getGenerateIdentityBindingAccessTokenMethodHelper(), responseObserver); - } - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -471,14 +386,6 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.iam.credentials.v1.SignJwtRequest, com.google.cloud.iam.credentials.v1.SignJwtResponse>( this, METHODID_SIGN_JWT))) - .addMethod( - getGenerateIdentityBindingAccessTokenMethodHelper(), - asyncUnaryCall( - new MethodHandlers< - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest, - com.google.cloud.iam.credentials.v1 - .GenerateIdentityBindingAccessTokenResponse>( - this, METHODID_GENERATE_IDENTITY_BINDING_ACCESS_TOKEN))) .build(); } } @@ -579,26 +486,6 @@ public void signJwt( request, responseObserver); } - - /** - * - * - *
-     * Exchange a JWT signed by third party identity provider to an OAuth 2.0
-     * access token
-     * 
- */ - public void generateIdentityBindingAccessToken( - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> - responseObserver) { - asyncUnaryCall( - getChannel() - .newCall(getGenerateIdentityBindingAccessTokenMethodHelper(), getCallOptions()), - request, - responseObserver); - } } /** @@ -680,24 +567,6 @@ public com.google.cloud.iam.credentials.v1.SignJwtResponse signJwt( com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse - generateIdentityBindingAccessToken( - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest request) { - return blockingUnaryCall( - getChannel(), - getGenerateIdentityBindingAccessTokenMethodHelper(), - getCallOptions(), - request); - } } /** @@ -786,31 +655,12 @@ protected IAMCredentialsFutureStub build( 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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse> - generateIdentityBindingAccessToken( - com.google.cloud.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, @@ -855,15 +705,6 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_GENERATE_IDENTITY_BINDING_ACCESS_TOKEN: - serviceImpl.generateIdentityBindingAccessToken( - (com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) - request, - (io.grpc.stub.StreamObserver< - com.google.cloud.iam.credentials.v1 - .GenerateIdentityBindingAccessTokenResponse>) - responseObserver); - break; default: throw new AssertionError(); } @@ -932,7 +773,6 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGenerateIdTokenMethodHelper()) .addMethod(getSignBlobMethodHelper()) .addMethod(getSignJwtMethodHelper()) - .addMethod(getGenerateIdentityBindingAccessTokenMethodHelper()) .build(); } } diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsCommonProto.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsCommonProto.java index a6aa1762c332..1913fb615541 100644 --- a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsCommonProto.java +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsCommonProto.java @@ -44,14 +44,6 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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; @@ -79,16 +71,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\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\213\001\n#com" - + ".google.cloud.iam.credentials.v1B\031IAMCre" - + "dentialsCommonProtoP\001ZDgoogle.golang.org" - + "/genproto/googleapis/iam/credentials/v1;" - + "credentials\370\001\001b\006proto3" + + "TokenResponse\022\r\n\005token\030\001 \001(\tB\213\001\n#com.goo" + + "gle.cloud.iam.credentials.v1B\031IAMCredent" + + "ialsCommonProtoP\001ZDgoogle.golang.org/gen" + + "proto/googleapis/iam/credentials/v1;cred" + + "entials\370\001\001b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -169,22 +156,6 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( 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(); } diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsProto.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsProto.java index 7ce6a8abdc5f..6bd5863e9bb7 100644 --- a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsProto.java +++ b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/IAMCredentialsProto.java @@ -23,7 +23,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\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" + + "edentials/v1/common.proto2\340\005\n\016IAMCredent" + "ials\022\314\001\n\023GenerateAccessToken\0225.google.ia" + "m.credentials.v1.GenerateAccessTokenRequ" + "est\0326.google.iam.credentials.v1.Generate" @@ -42,17 +42,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "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*B\205\001\n#com." - + "google.cloud.iam.credentials.v1B\023IAMCred" - + "entialsProtoP\001ZDgoogle.golang.org/genpro" - + "to/googleapis/iam/credentials/v1;credent" - + "ials\370\001\001b\006proto3" + + "t:\001*B\205\001\n#com.google.cloud.iam.credential" + + "s.v1B\023IAMCredentialsProtoP\001ZDgoogle.gola" + + "ng.org/genproto/googleapis/iam/credentia" + + "ls/v1;credentials\370\001\001b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { 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 09e8ea8bbe27..6ba010199476 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 @@ -152,72 +152,3 @@ message GenerateIdTokenResponse { // The OpenId Connect ID token. 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 3347beeb1c1e..3308d63a4e61 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 @@ -68,15 +68,4 @@ 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 0222c89b9e76..34a0bee50e05 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 @@ -689,174 +689,6 @@ 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()) {
-   *   ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]");
-   *   List<String> scope = new ArrayList<>();
-   *   String jwt = "";
-   *   GenerateIdentityBindingAccessTokenResponse response = iamCredentialsClient.generateIdentityBindingAccessToken(name, 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( - ServiceAccountName name, List scope, String jwt) { - - GenerateIdentityBindingAccessTokenRequest request = - GenerateIdentityBindingAccessTokenRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .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()) {
-   *   ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]");
-   *   List<String> scope = new ArrayList<>();
-   *   String jwt = "";
-   *   GenerateIdentityBindingAccessTokenResponse response = iamCredentialsClient.generateIdentityBindingAccessToken(name.toString(), 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) { - - 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()) {
-   *   ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]");
-   *   List<String> scope = new ArrayList<>();
-   *   String jwt = "";
-   *   GenerateIdentityBindingAccessTokenRequest request = GenerateIdentityBindingAccessTokenRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .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()) {
-   *   ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]");
-   *   List<String> scope = new ArrayList<>();
-   *   String jwt = "";
-   *   GenerateIdentityBindingAccessTokenRequest request = GenerateIdentityBindingAccessTokenRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .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 9a433eab05a9..d1be5ba1ef33 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 @@ -82,14 +82,6 @@ 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(); @@ -209,15 +201,6 @@ 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 ac3de9a8647d..7d333436de54 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 @@ -27,8 +27,6 @@ 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.GenerateIdentityBindingAccessTokenRequest; -import com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; import com.google.cloud.iam.credentials.v1.SignBlobRequest; import com.google.cloud.iam.credentials.v1.SignBlobResponse; import com.google.cloud.iam.credentials.v1.SignJwtRequest; @@ -86,23 +84,6 @@ 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; @@ -112,9 +93,6 @@ public class GrpcIamCredentialsStub extends IamCredentialsStub { generateIdTokenCallable; private final UnaryCallable signBlobCallable; private final UnaryCallable signJwtCallable; - private final UnaryCallable< - GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> - generateIdentityBindingAccessTokenCallable; private final GrpcStubCallableFactory callableFactory; @@ -211,25 +189,6 @@ public Map extract(SignJwtRequest request) { } }) .build(); - GrpcCallSettings< - GenerateIdentityBindingAccessTokenRequest, GenerateIdentityBindingAccessTokenResponse> - generateIdentityBindingAccessTokenTransportSettings = - GrpcCallSettings - . - newBuilder() - .setMethodDescriptor(generateIdentityBindingAccessTokenMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract( - GenerateIdentityBindingAccessTokenRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } - }) - .build(); this.generateAccessTokenCallable = callableFactory.createUnaryCallable( @@ -245,11 +204,6 @@ public Map extract( this.signJwtCallable = callableFactory.createUnaryCallable( signJwtTransportSettings, settings.signJwtSettings(), clientContext); - this.generateIdentityBindingAccessTokenCallable = - callableFactory.createUnaryCallable( - generateIdentityBindingAccessTokenTransportSettings, - settings.generateIdentityBindingAccessTokenSettings(), - clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -271,12 +225,6 @@ 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 5af6a6e44f90..668d0852b5f0 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 @@ -22,8 +22,6 @@ 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.GenerateIdentityBindingAccessTokenRequest; -import com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; import com.google.cloud.iam.credentials.v1.SignBlobRequest; import com.google.cloud.iam.credentials.v1.SignBlobResponse; import com.google.cloud.iam.credentials.v1.SignJwtRequest; @@ -57,13 +55,6 @@ 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 76185bd70529..c098ce880d85 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 @@ -34,8 +34,6 @@ 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.GenerateIdentityBindingAccessTokenRequest; -import com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse; import com.google.cloud.iam.credentials.v1.SignBlobRequest; import com.google.cloud.iam.credentials.v1.SignBlobResponse; import com.google.cloud.iam.credentials.v1.SignJwtRequest; @@ -89,9 +87,6 @@ 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 @@ -115,13 +110,6 @@ 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() @@ -194,8 +182,6 @@ 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. */ @@ -208,9 +194,6 @@ 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; @@ -261,15 +244,12 @@ protected Builder(ClientContext clientContext) { signJwtSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - generateIdentityBindingAccessTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - unaryMethodSettingsBuilders = ImmutableList.>of( generateAccessTokenSettings, generateIdTokenSettings, signBlobSettings, - signJwtSettings, - generateIdentityBindingAccessTokenSettings); + signJwtSettings); initDefaults(this); } @@ -305,11 +285,6 @@ 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; } @@ -320,16 +295,13 @@ 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, - generateIdentityBindingAccessTokenSettings); + signJwtSettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -370,15 +342,6 @@ 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 0951b452adbc..ad9509d58584 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 @@ -268,52 +268,4 @@ 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); - - ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); - List scope = new ArrayList<>(); - String jwt = "jwt105671"; - - GenerateIdentityBindingAccessTokenResponse actualResponse = - client.generateIdentityBindingAccessToken(name, scope, jwt); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIAMCredentials.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GenerateIdentityBindingAccessTokenRequest actualRequest = - (GenerateIdentityBindingAccessTokenRequest) actualRequests.get(0); - - Assert.assertEquals(name, ServiceAccountName.parse(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 { - ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); - List scope = new ArrayList<>(); - String jwt = "jwt105671"; - - client.generateIdentityBindingAccessToken(name, 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 55bb6f54fac7..8f7356170467 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 @@ -114,20 +114,4 @@ 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 0279c5ef767a..2badb60aeab7 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/synth.metadata +++ b/google-cloud-clients/google-cloud-iamcredentials/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-04-02T07:46:40.438435Z", + "updateTime": "2019-06-27T07:45:30.291262Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.22", - "dockerImage": "googleapis/artman@sha256:e7f9554322a8aa1416c122c918fdc4cdec8cfe816f027fc948dec0be7edef320" + "version": "0.29.1", + "dockerImage": "googleapis/artman@sha256:b2a73f4dda03ef8fcaa973e3ba26d0cf34091f6c22c70add663af325931aef4d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6c48ab5aef47dc14e02e2dc718d232a28067129d", - "internalRef": "241437588" + "sha": "f46206aff84f4b2cde590f1e0791112214f07080", + "internalRef": "255318896" } } ], From 2804c74fa0a6c34f01263994ed85a1fe6eeef87e Mon Sep 17 00:00:00 2001 From: Solomon Duskis Date: Fri, 28 Jun 2019 11:41:50 -0400 Subject: [PATCH 2/2] Manually deleting some old IAM files. --- ...rateIdentityBindingAccessTokenRequest.java | 1366 ----------------- ...ityBindingAccessTokenRequestOrBuilder.java | 193 --- ...ateIdentityBindingAccessTokenResponse.java | 886 ----------- ...tyBindingAccessTokenResponseOrBuilder.java | 65 - .../synth.metadata | 10 +- 5 files changed, 5 insertions(+), 2515 deletions(-) delete mode 100644 google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequest.java delete mode 100644 google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequestOrBuilder.java delete mode 100644 google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponse.java delete mode 100644 google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponseOrBuilder.java diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequest.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequest.java deleted file mode 100644 index 46311ac7fcc9..000000000000 --- a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequest.java +++ /dev/null @@ -1,1366 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/iam/credentials/v1/common.proto - -package com.google.cloud.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) != 0)) { - 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 (!parseUnknownField(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) != 0)) { - scope_ = scope_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.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.cloud.iam.credentials.v1.IAMCredentialsCommonProto - .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest.class, - com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest)) { - return super.equals(obj); - } - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest other = - (com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!getScopeList().equals(other.getScopeList())) return false; - if (!getJwt().equals(other.getJwt())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.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.cloud.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.cloud.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.cloud.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.cloud.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.cloud.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.cloud.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.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.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.cloud.iam.credentials.v1.IAMCredentialsCommonProto - .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest.class, - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest.Builder - .class); - } - - // Construct using - // com.google.cloud.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.cloud.iam.credentials.v1.IAMCredentialsCommonProto - .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest - getDefaultInstanceForType() { - return com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest build() { - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest - buildPartial() { - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest result = - new com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.name_ = name_; - if (((bitField0_ & 0x00000002) != 0)) { - 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 super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) { - return mergeFrom( - (com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest other) { - if (other - == com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest parsedMessage = - null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.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) != 0)) { - 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.setUnknownFields(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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest(); - } - - public static com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequestOrBuilder.java deleted file mode 100644 index 53834cd8da29..000000000000 --- a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenRequestOrBuilder.java +++ /dev/null @@ -1,193 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/iam/credentials/v1/common.proto - -package com.google.cloud.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/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponse.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponse.java deleted file mode 100644 index ef5fc450f390..000000000000 --- a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponse.java +++ /dev/null @@ -1,886 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/iam/credentials/v1/common.proto - -package com.google.cloud.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 (!parseUnknownField(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.cloud.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.cloud.iam.credentials.v1.IAMCredentialsCommonProto - .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse.class, - com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse)) { - return super.equals(obj); - } - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse other = - (com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) obj; - - if (!getAccessToken().equals(other.getAccessToken())) return false; - if (hasExpireTime() != other.hasExpireTime()) return false; - if (hasExpireTime()) { - if (!getExpireTime().equals(other.getExpireTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.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.cloud.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.cloud.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.cloud.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.cloud.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.cloud.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.cloud.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.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.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.cloud.iam.credentials.v1.IAMCredentialsCommonProto - .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse.class, - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse.Builder - .class); - } - - // Construct using - // com.google.cloud.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.cloud.iam.credentials.v1.IAMCredentialsCommonProto - .internal_static_google_iam_credentials_v1_GenerateIdentityBindingAccessTokenResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse - getDefaultInstanceForType() { - return com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse build() { - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse - buildPartial() { - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse result = - new com.google.cloud.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 super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) { - return mergeFrom( - (com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse other) { - if (other - == com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse parsedMessage = - null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.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_; - 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.setUnknownFields(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.cloud.iam.credentials.v1 - .GenerateIdentityBindingAccessTokenResponse - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse(); - } - - public static com.google.cloud.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.cloud.iam.credentials.v1.GenerateIdentityBindingAccessTokenResponse - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponseOrBuilder.java deleted file mode 100644 index b13564dc00de..000000000000 --- a/google-api-grpc/proto-google-cloud-iamcredentials-v1/src/main/java/com/google/cloud/iam/credentials/v1/GenerateIdentityBindingAccessTokenResponseOrBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/iam/credentials/v1/common.proto - -package com.google.cloud.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-cloud-clients/google-cloud-iamcredentials/synth.metadata b/google-cloud-clients/google-cloud-iamcredentials/synth.metadata index 2badb60aeab7..e7e58c709ac6 100644 --- a/google-cloud-clients/google-cloud-iamcredentials/synth.metadata +++ b/google-cloud-clients/google-cloud-iamcredentials/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-27T07:45:30.291262Z", + "updateTime": "2019-06-28T15:33:50.609616Z", "sources": [ { "generator": { "name": "artman", - "version": "0.29.1", - "dockerImage": "googleapis/artman@sha256:b2a73f4dda03ef8fcaa973e3ba26d0cf34091f6c22c70add663af325931aef4d" + "version": "0.29.2", + "dockerImage": "googleapis/artman@sha256:45263333b058a4b3c26a8b7680a2710f43eae3d250f791a6cb66423991dcb2df" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f46206aff84f4b2cde590f1e0791112214f07080", - "internalRef": "255318896" + "sha": "84c8ad4e52f8eec8f08a60636cfa597b86969b5c", + "internalRef": "255474859" } } ],