public void SignJwt()
        {
            moq::Mock <IAMCredentials.IAMCredentialsClient> mockGrpcClient = new moq::Mock <IAMCredentials.IAMCredentialsClient>(moq::MockBehavior.Strict);
            SignJwtRequest request = new SignJwtRequest
            {
                ServiceAccountName = ServiceAccountName.FromProjectServiceAccount("[PROJECT]", "[SERVICE_ACCOUNT]"),
                Delegates          =
                {
                    "delegates331d18f6",
                },
                Payload = "payloadf43c1c32",
            };
            SignJwtResponse expectedResponse = new SignJwtResponse
            {
                KeyId     = "key_id2691f630",
                SignedJwt = "signed_jwt09d786db",
            };

            mockGrpcClient.Setup(x => x.SignJwt(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            IAMCredentialsClient client   = new IAMCredentialsClientImpl(mockGrpcClient.Object, null);
            SignJwtResponse      response = client.SignJwt(request.Name, request.Delegates, request.Payload);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task SignJwtAsync()
        {
            moq::Mock <IAMCredentials.IAMCredentialsClient> mockGrpcClient = new moq::Mock <IAMCredentials.IAMCredentialsClient>(moq::MockBehavior.Strict);
            SignJwtRequest request = new SignJwtRequest
            {
                ServiceAccountName = ServiceAccountName.FromProjectServiceAccount("[PROJECT]", "[SERVICE_ACCOUNT]"),
                Delegates          =
                {
                    "delegates331d18f6",
                },
                Payload = "payloadf43c1c32",
            };
            SignJwtResponse expectedResponse = new SignJwtResponse
            {
                KeyId     = "key_id2691f630",
                SignedJwt = "signed_jwt09d786db",
            };

            mockGrpcClient.Setup(x => x.SignJwtAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <SignJwtResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            IAMCredentialsClient client = new IAMCredentialsClientImpl(mockGrpcClient.Object, null);
            SignJwtResponse      responseCallSettings = await client.SignJwtAsync(request.Name, request.Delegates, request.Payload, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            SignJwtResponse responseCancellationToken = await client.SignJwtAsync(request.Name, request.Delegates, request.Payload, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task GenerateAccessTokenRequestObjectAsync()
        {
            moq::Mock <IAMCredentials.IAMCredentialsClient> mockGrpcClient = new moq::Mock <IAMCredentials.IAMCredentialsClient>(moq::MockBehavior.Strict);
            GenerateAccessTokenRequest request = new GenerateAccessTokenRequest
            {
                ServiceAccountName = ServiceAccountName.FromProjectServiceAccount("[PROJECT]", "[SERVICE_ACCOUNT]"),
                Delegates          =
                {
                    "delegates331d18f6",
                },
                Scope    = { "scope14fda131", },
                Lifetime = new wkt::Duration(),
            };
            GenerateAccessTokenResponse expectedResponse = new GenerateAccessTokenResponse
            {
                AccessToken = "access_token85826cd8",
                ExpireTime  = new wkt::Timestamp(),
            };

            mockGrpcClient.Setup(x => x.GenerateAccessTokenAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <GenerateAccessTokenResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            IAMCredentialsClient        client = new IAMCredentialsClientImpl(mockGrpcClient.Object, null);
            GenerateAccessTokenResponse responseCallSettings = await client.GenerateAccessTokenAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            GenerateAccessTokenResponse responseCancellationToken = await client.GenerateAccessTokenAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void SignBlobRequestObject()
        {
            moq::Mock <IAMCredentials.IAMCredentialsClient> mockGrpcClient = new moq::Mock <IAMCredentials.IAMCredentialsClient>(moq::MockBehavior.Strict);
            SignBlobRequest request = new SignBlobRequest
            {
                ServiceAccountName = ServiceAccountName.FromProjectServiceAccount("[PROJECT]", "[SERVICE_ACCOUNT]"),
                Delegates          =
                {
                    "delegates331d18f6",
                },
                Payload = proto::ByteString.CopyFromUtf8("payloadf43c1c32"),
            };
            SignBlobResponse expectedResponse = new SignBlobResponse
            {
                KeyId      = "key_id2691f630",
                SignedBlob = proto::ByteString.CopyFromUtf8("signed_blob0afddec9"),
            };

            mockGrpcClient.Setup(x => x.SignBlob(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            IAMCredentialsClient client   = new IAMCredentialsClientImpl(mockGrpcClient.Object, null);
            SignBlobResponse     response = client.SignBlob(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task GenerateIdTokenResourceNamesAsync()
        {
            moq::Mock <IAMCredentials.IAMCredentialsClient> mockGrpcClient = new moq::Mock <IAMCredentials.IAMCredentialsClient>(moq::MockBehavior.Strict);
            GenerateIdTokenRequest request = new GenerateIdTokenRequest
            {
                ServiceAccountName = ServiceAccountName.FromProjectServiceAccount("[PROJECT]", "[SERVICE_ACCOUNT]"),
                Delegates          =
                {
                    "delegates331d18f6",
                },
                Audience     = "audience986f1fe3",
                IncludeEmail = false,
            };
            GenerateIdTokenResponse expectedResponse = new GenerateIdTokenResponse
            {
                Token = "tokena18da094",
            };

            mockGrpcClient.Setup(x => x.GenerateIdTokenAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <GenerateIdTokenResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            IAMCredentialsClient    client = new IAMCredentialsClientImpl(mockGrpcClient.Object, null);
            GenerateIdTokenResponse responseCallSettings = await client.GenerateIdTokenAsync(request.ServiceAccountName, request.Delegates, request.Audience, request.IncludeEmail, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            GenerateIdTokenResponse responseCancellationToken = await client.GenerateIdTokenAsync(request.ServiceAccountName, request.Delegates, request.Audience, request.IncludeEmail, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void GenerateIdTokenResourceNames()
        {
            moq::Mock <IAMCredentials.IAMCredentialsClient> mockGrpcClient = new moq::Mock <IAMCredentials.IAMCredentialsClient>(moq::MockBehavior.Strict);
            GenerateIdTokenRequest request = new GenerateIdTokenRequest
            {
                ServiceAccountName = ServiceAccountName.FromProjectServiceAccount("[PROJECT]", "[SERVICE_ACCOUNT]"),
                Delegates          =
                {
                    "delegates331d18f6",
                },
                Audience     = "audience986f1fe3",
                IncludeEmail = false,
            };
            GenerateIdTokenResponse expectedResponse = new GenerateIdTokenResponse
            {
                Token = "tokena18da094",
            };

            mockGrpcClient.Setup(x => x.GenerateIdToken(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            IAMCredentialsClient    client   = new IAMCredentialsClientImpl(mockGrpcClient.Object, null);
            GenerateIdTokenResponse response = client.GenerateIdToken(request.ServiceAccountName, request.Delegates, request.Audience, request.IncludeEmail);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void GenerateAccessTokenRequestObject()
        {
            moq::Mock <IAMCredentials.IAMCredentialsClient> mockGrpcClient = new moq::Mock <IAMCredentials.IAMCredentialsClient>(moq::MockBehavior.Strict);
            GenerateAccessTokenRequest request = new GenerateAccessTokenRequest
            {
                ServiceAccountName = ServiceAccountName.FromProjectServiceAccount("[PROJECT]", "[SERVICE_ACCOUNT]"),
                Delegates          =
                {
                    "delegates331d18f6",
                },
                Scope    = { "scope14fda131", },
                Lifetime = new wkt::Duration(),
            };
            GenerateAccessTokenResponse expectedResponse = new GenerateAccessTokenResponse
            {
                AccessToken = "access_token85826cd8",
                ExpireTime  = new wkt::Timestamp(),
            };

            mockGrpcClient.Setup(x => x.GenerateAccessToken(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            IAMCredentialsClient        client   = new IAMCredentialsClientImpl(mockGrpcClient.Object, null);
            GenerateAccessTokenResponse response = client.GenerateAccessToken(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }