Skip to content

Commit 51076a8

Browse files
authored
fix: remove server unimplemented GrpcStorageImpl#getServiceAccount (#2718)
Partial revert of 96b6330
1 parent 06f7292 commit 51076a8

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

‎google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import static com.google.cloud.storage.StorageV2ProtoUtils.objectAclEntityOrAltEq;
2727
import static com.google.cloud.storage.Utils.bucketNameCodec;
2828
import static com.google.cloud.storage.Utils.ifNonNull;
29-
import static com.google.cloud.storage.Utils.projectNameCodec;
3029
import static com.google.common.base.MoreObjects.firstNonNull;
3130
import static java.util.Objects.requireNonNull;
3231

@@ -90,7 +89,6 @@
9089
import com.google.storage.v2.GetBucketRequest;
9190
import com.google.storage.v2.GetNotificationConfigRequest;
9291
import com.google.storage.v2.GetObjectRequest;
93-
import com.google.storage.v2.GetServiceAccountRequest;
9492
import com.google.storage.v2.ListBucketsRequest;
9593
import com.google.storage.v2.ListNotificationConfigsRequest;
9694
import com.google.storage.v2.ListNotificationConfigsResponse;
@@ -1390,16 +1388,7 @@ public List<Boolean> testIamPermissions(
13901388

13911389
@Override
13921390
public ServiceAccount getServiceAccount(String projectId) {
1393-
GetServiceAccountRequest req =
1394-
GetServiceAccountRequest.newBuilder()
1395-
.setProject(projectNameCodec.encode(projectId))
1396-
.build();
1397-
GrpcCallContext retryContext = Retrying.newCallContext();
1398-
return Retrying.run(
1399-
getOptions(),
1400-
retryAlgorithmManager.getFor(req),
1401-
() -> storageClient.getServiceAccountCallable().call(req, retryContext),
1402-
codecs.serviceAccount());
1391+
return CrossTransportUtils.throwHttpJsonOnly(Storage.class, "getServiceAccount");
14031392
}
14041393

14051394
@Override

‎google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4781,7 +4781,7 @@ List<Boolean> testIamPermissions(
47814781
* @return the service account associated with this project
47824782
* @throws StorageException upon failure
47834783
*/
4784-
@TransportCompatibility({Transport.HTTP, Transport.GRPC})
4784+
@TransportCompatibility({Transport.HTTP})
47854785
ServiceAccount getServiceAccount(String projectId);
47864786

47874787
/**

‎google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RpcMethodMappings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,6 +2114,7 @@ static final class ServiceAccount {
21142114
private static void get(ArrayList<RpcMethodMapping> a) {
21152115
a.add(
21162116
RpcMethodMapping.newBuilder(59, serviceaccount.get)
2117+
.withApplicable(TestRetryConformance.transportIs(Transport.HTTP))
21172118
.withTest(
21182119
(ctx, c) ->
21192120
ctx.map(

‎google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITServiceAccountTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@RunWith(StorageITRunner.class)
3333
@CrossRun(
3434
backends = {Backend.PROD},
35-
transports = {Transport.HTTP, Transport.GRPC})
35+
transports = {Transport.HTTP})
3636
public class ITServiceAccountTest {
3737

3838
private static final String SERVICE_ACCOUNT_EMAIL_SUFFIX =

0 commit comments

Comments
 (0)