diff --git a/packages/metrics_center/CHANGELOG.md b/packages/metrics_center/CHANGELOG.md index 270f34fb8d1..a2dd1ae26d8 100644 --- a/packages/metrics_center/CHANGELOG.md +++ b/packages/metrics_center/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.10 + +* Adds retry logic when removing a `GcsLock` file lock in case of failure. + ## 1.0.9 * Adds compatibility with `http` 1.0. diff --git a/packages/metrics_center/lib/src/gcs_lock.dart b/packages/metrics_center/lib/src/gcs_lock.dart index 6f89fc83df5..7c22c862627 100644 --- a/packages/metrics_center/lib/src/gcs_lock.dart +++ b/packages/metrics_center/lib/src/gcs_lock.dart @@ -5,16 +5,13 @@ // ignore_for_file: avoid_print import 'package:googleapis/storage/v1.dart'; -import 'package:googleapis_auth/googleapis_auth.dart'; /// Global (in terms of earth) mutex using Google Cloud Storage. class GcsLock { /// Create a lock with an authenticated client and a GCS bucket name. /// /// The client is used to communicate with Google Cloud Storage APIs. - GcsLock(this._client, this._bucketName) { - _api = StorageApi(_client); - } + GcsLock(this._api, this._bucketName); /// Create a temporary lock file in GCS, and use it as a mutex mechanism to /// run a piece of code exclusively. @@ -79,13 +76,28 @@ class GcsLock { } Future _unlock(String lockFileName) async { - await _api.objects.delete(_bucketName, lockFileName); + Duration waitPeriod = const Duration(milliseconds: 10); + bool unlocked = false; + // Retry in the case of GCS returning an API error, but rethrow if unable + // to unlock after a certain period of time. + while (!unlocked) { + try { + await _api.objects.delete(_bucketName, lockFileName); + unlocked = true; + } on DetailedApiRequestError { + if (waitPeriod < _unlockThreshold) { + await Future.delayed(waitPeriod); + waitPeriod *= 2; + } else { + rethrow; + } + } + } } - late StorageApi _api; - final String _bucketName; - final AuthClient _client; + final StorageApi _api; static const Duration _kWarningThreshold = Duration(seconds: 10); + static const Duration _unlockThreshold = Duration(minutes: 1); } diff --git a/packages/metrics_center/lib/src/skiaperf.dart b/packages/metrics_center/lib/src/skiaperf.dart index 45a00f34f50..c389f62b96e 100644 --- a/packages/metrics_center/lib/src/skiaperf.dart +++ b/packages/metrics_center/lib/src/skiaperf.dart @@ -7,7 +7,8 @@ import 'dart:convert'; import 'package:gcloud/storage.dart'; -import 'package:googleapis/storage/v1.dart' show DetailedApiRequestError; +import 'package:googleapis/storage/v1.dart' + show DetailedApiRequestError, StorageApi; import 'package:googleapis_auth/auth_io.dart'; import 'common.dart'; @@ -388,7 +389,7 @@ class SkiaPerfDestination extends MetricDestination { } final SkiaPerfGcsAdaptor adaptor = SkiaPerfGcsAdaptor(storage.bucket(bucketName)); - final GcsLock lock = GcsLock(client, bucketName); + final GcsLock lock = GcsLock(StorageApi(client), bucketName); return SkiaPerfDestination(adaptor, lock); } diff --git a/packages/metrics_center/pubspec.yaml b/packages/metrics_center/pubspec.yaml index 4fd8fa9b6cd..bd61472dc3d 100644 --- a/packages/metrics_center/pubspec.yaml +++ b/packages/metrics_center/pubspec.yaml @@ -1,5 +1,5 @@ name: metrics_center -version: 1.0.9 +version: 1.0.10 description: Support multiple performance metrics sources/formats and destinations. repository: https://github.com/flutter/packages/tree/main/packages/metrics_center @@ -9,6 +9,7 @@ environment: sdk: ">=2.18.0 <4.0.0" dependencies: + _discoveryapis_commons: ^1.0.0 crypto: ^3.0.1 equatable: ^2.0.3 gcloud: ^0.8.2 diff --git a/packages/metrics_center/test/gcs_lock_test.dart b/packages/metrics_center/test/gcs_lock_test.dart index bc84ac1d84d..8222db4928e 100644 --- a/packages/metrics_center/test/gcs_lock_test.dart +++ b/packages/metrics_center/test/gcs_lock_test.dart @@ -22,7 +22,12 @@ enum TestPhase { run2, } -@GenerateMocks([AuthClient]) +@GenerateMocks([ + AuthClient, + StorageApi +], customMocks: >[ + MockSpec(onMissingStub: OnMissingStub.returnDefault) +]) void main() { const Duration kDelayStep = Duration(milliseconds: 10); final Map? credentialsJson = getTestGcpCredentialsJson(); @@ -36,7 +41,7 @@ void main() { Zone.current.fork(specification: spec).run(() { fakeAsync((FakeAsync fakeAsync) { final MockAuthClient mockClient = MockAuthClient(); - final GcsLock lock = GcsLock(mockClient, 'mockBucket'); + final GcsLock lock = GcsLock(StorageApi(mockClient), 'mockBucket'); when(mockClient.send(any)).thenThrow(DetailedApiRequestError(412, '')); final Future runFinished = lock.protectedRun('mock.lock', () async {}); @@ -63,7 +68,7 @@ void main() { test('GcsLock integration test: single protectedRun is successful', () async { final AutoRefreshingAuthClient client = await clientViaServiceAccount( ServiceAccountCredentials.fromJson(credentialsJson), Storage.SCOPES); - final GcsLock lock = GcsLock(client, kTestBucketName); + final GcsLock lock = GcsLock(StorageApi(client), kTestBucketName); int testValue = 0; await lock.protectedRun('test.lock', () async { testValue = 1; @@ -74,8 +79,8 @@ void main() { test('GcsLock integration test: protectedRun is exclusive', () async { final AutoRefreshingAuthClient client = await clientViaServiceAccount( ServiceAccountCredentials.fromJson(credentialsJson), Storage.SCOPES); - final GcsLock lock1 = GcsLock(client, kTestBucketName); - final GcsLock lock2 = GcsLock(client, kTestBucketName); + final GcsLock lock1 = GcsLock(StorageApi(client), kTestBucketName); + final GcsLock lock2 = GcsLock(StorageApi(client), kTestBucketName); TestPhase phase = TestPhase.run1; final Completer started1 = Completer(); @@ -105,4 +110,39 @@ void main() { await finished1; await finished2; }, skip: credentialsJson == null); + + test('GcsLock attempts to unlock again on a DetailedApiRequestError', + () async { + fakeAsync((FakeAsync fakeAsync) { + final StorageApi mockStorageApi = MockStorageApi(); + final ObjectsResource mockObjectsResource = MockObjectsResource(); + final GcsLock gcsLock = GcsLock(mockStorageApi, kTestBucketName); + const String lockFileName = 'test.lock'; + when(mockStorageApi.objects).thenReturn(mockObjectsResource); + + // Simulate a failure to delete a lock file. + when(mockObjectsResource.delete(kTestBucketName, lockFileName)) + .thenThrow(DetailedApiRequestError(504, '')); + + gcsLock.protectedRun(lockFileName, () async {}); + + // Allow time to pass by to ensure deleting the lock file is retried multiple times. + fakeAsync.elapse(const Duration(milliseconds: 30)); + verify(mockObjectsResource.delete(kTestBucketName, lockFileName)) + .called(3); + + // Simulate a successful deletion of the lock file. + when(mockObjectsResource.delete(kTestBucketName, lockFileName)) + .thenAnswer((_) => Future( + () { + return; + }, + )); + + // At this point, there should only be one more (successful) attempt to delete the lock file. + fakeAsync.elapse(const Duration(minutes: 2)); + verify(mockObjectsResource.delete(kTestBucketName, lockFileName)) + .called(1); + }); + }); } diff --git a/packages/metrics_center/test/gcs_lock_test.mocks.dart b/packages/metrics_center/test/gcs_lock_test.mocks.dart index 93ff8e1f182..a672212c882 100644 --- a/packages/metrics_center/test/gcs_lock_test.mocks.dart +++ b/packages/metrics_center/test/gcs_lock_test.mocks.dart @@ -1,14 +1,18 @@ -// Mocks generated by Mockito 5.4.0 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in metrics_center/test/gcs_lock_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; -import 'dart:convert' as _i6; -import 'dart:typed_data' as _i7; +import 'dart:async' as _i6; +import 'dart:convert' as _i7; +import 'dart:typed_data' as _i8; +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as _i9; +import 'package:googleapis/storage/v1.dart' as _i4; import 'package:googleapis_auth/src/access_credentials.dart' as _i2; -import 'package:googleapis_auth/src/auth_client.dart' as _i4; +import 'package:googleapis_auth/src/auth_client.dart' as _i5; import 'package:http/http.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; @@ -55,10 +59,170 @@ class _FakeStreamedResponse_2 extends _i1.SmartFake ); } +class _FakeBucketAccessControlsResource_3 extends _i1.SmartFake + implements _i4.BucketAccessControlsResource { + _FakeBucketAccessControlsResource_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeBucketsResource_4 extends _i1.SmartFake + implements _i4.BucketsResource { + _FakeBucketsResource_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeChannelsResource_5 extends _i1.SmartFake + implements _i4.ChannelsResource { + _FakeChannelsResource_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeDefaultObjectAccessControlsResource_6 extends _i1.SmartFake + implements _i4.DefaultObjectAccessControlsResource { + _FakeDefaultObjectAccessControlsResource_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeNotificationsResource_7 extends _i1.SmartFake + implements _i4.NotificationsResource { + _FakeNotificationsResource_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeObjectAccessControlsResource_8 extends _i1.SmartFake + implements _i4.ObjectAccessControlsResource { + _FakeObjectAccessControlsResource_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeObjectsResource_9 extends _i1.SmartFake + implements _i4.ObjectsResource { + _FakeObjectsResource_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeProjectsResource_10 extends _i1.SmartFake + implements _i4.ProjectsResource { + _FakeProjectsResource_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeObject_11 extends _i1.SmartFake implements _i4.Object { + _FakeObject_11( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeObject_12 extends _i1.SmartFake implements Object { + _FakeObject_12( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakePolicy_13 extends _i1.SmartFake implements _i4.Policy { + _FakePolicy_13( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeObjects_14 extends _i1.SmartFake implements _i4.Objects { + _FakeObjects_14( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeRewriteResponse_15 extends _i1.SmartFake + implements _i4.RewriteResponse { + _FakeRewriteResponse_15( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTestIamPermissionsResponse_16 extends _i1.SmartFake + implements _i4.TestIamPermissionsResponse { + _FakeTestIamPermissionsResponse_16( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeChannel_17 extends _i1.SmartFake implements _i4.Channel { + _FakeChannel_17( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + /// A class which mocks [AuthClient]. /// /// See the documentation for Mockito's code generation for more information. -class MockAuthClient extends _i1.Mock implements _i4.AuthClient { +class MockAuthClient extends _i1.Mock implements _i5.AuthClient { MockAuthClient() { _i1.throwOnMissingStub(this); } @@ -72,7 +236,7 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { ), ) as _i2.AccessCredentials); @override - _i5.Future<_i3.Response> head( + _i6.Future<_i3.Response> head( Uri? url, { Map? headers, }) => @@ -82,7 +246,7 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { [url], {#headers: headers}, ), - returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_1( + returnValue: _i6.Future<_i3.Response>.value(_FakeResponse_1( this, Invocation.method( #head, @@ -90,9 +254,9 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { {#headers: headers}, ), )), - ) as _i5.Future<_i3.Response>); + ) as _i6.Future<_i3.Response>); @override - _i5.Future<_i3.Response> get( + _i6.Future<_i3.Response> get( Uri? url, { Map? headers, }) => @@ -102,7 +266,7 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { [url], {#headers: headers}, ), - returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_1( + returnValue: _i6.Future<_i3.Response>.value(_FakeResponse_1( this, Invocation.method( #get, @@ -110,13 +274,13 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { {#headers: headers}, ), )), - ) as _i5.Future<_i3.Response>); + ) as _i6.Future<_i3.Response>); @override - _i5.Future<_i3.Response> post( + _i6.Future<_i3.Response> post( Uri? url, { Map? headers, Object? body, - _i6.Encoding? encoding, + _i7.Encoding? encoding, }) => (super.noSuchMethod( Invocation.method( @@ -128,7 +292,7 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { #encoding: encoding, }, ), - returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_1( + returnValue: _i6.Future<_i3.Response>.value(_FakeResponse_1( this, Invocation.method( #post, @@ -140,13 +304,13 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { }, ), )), - ) as _i5.Future<_i3.Response>); + ) as _i6.Future<_i3.Response>); @override - _i5.Future<_i3.Response> put( + _i6.Future<_i3.Response> put( Uri? url, { Map? headers, Object? body, - _i6.Encoding? encoding, + _i7.Encoding? encoding, }) => (super.noSuchMethod( Invocation.method( @@ -158,7 +322,7 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { #encoding: encoding, }, ), - returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_1( + returnValue: _i6.Future<_i3.Response>.value(_FakeResponse_1( this, Invocation.method( #put, @@ -170,13 +334,13 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { }, ), )), - ) as _i5.Future<_i3.Response>); + ) as _i6.Future<_i3.Response>); @override - _i5.Future<_i3.Response> patch( + _i6.Future<_i3.Response> patch( Uri? url, { Map? headers, Object? body, - _i6.Encoding? encoding, + _i7.Encoding? encoding, }) => (super.noSuchMethod( Invocation.method( @@ -188,7 +352,7 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { #encoding: encoding, }, ), - returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_1( + returnValue: _i6.Future<_i3.Response>.value(_FakeResponse_1( this, Invocation.method( #patch, @@ -200,13 +364,13 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { }, ), )), - ) as _i5.Future<_i3.Response>); + ) as _i6.Future<_i3.Response>); @override - _i5.Future<_i3.Response> delete( + _i6.Future<_i3.Response> delete( Uri? url, { Map? headers, Object? body, - _i6.Encoding? encoding, + _i7.Encoding? encoding, }) => (super.noSuchMethod( Invocation.method( @@ -218,7 +382,7 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { #encoding: encoding, }, ), - returnValue: _i5.Future<_i3.Response>.value(_FakeResponse_1( + returnValue: _i6.Future<_i3.Response>.value(_FakeResponse_1( this, Invocation.method( #delete, @@ -230,9 +394,9 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { }, ), )), - ) as _i5.Future<_i3.Response>); + ) as _i6.Future<_i3.Response>); @override - _i5.Future read( + _i6.Future read( Uri? url, { Map? headers, }) => @@ -242,10 +406,10 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { [url], {#headers: headers}, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i6.Future.value(''), + ) as _i6.Future); @override - _i5.Future<_i7.Uint8List> readBytes( + _i6.Future<_i8.Uint8List> readBytes( Uri? url, { Map? headers, }) => @@ -255,24 +419,24 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { [url], {#headers: headers}, ), - returnValue: _i5.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), - ) as _i5.Future<_i7.Uint8List>); + returnValue: _i6.Future<_i8.Uint8List>.value(_i8.Uint8List(0)), + ) as _i6.Future<_i8.Uint8List>); @override - _i5.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) => + _i6.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) => (super.noSuchMethod( Invocation.method( #send, [request], ), returnValue: - _i5.Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_2( + _i6.Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_2( this, Invocation.method( #send, [request], ), )), - ) as _i5.Future<_i3.StreamedResponse>); + ) as _i6.Future<_i3.StreamedResponse>); @override void close() => super.noSuchMethod( Invocation.method( @@ -282,3 +446,1117 @@ class MockAuthClient extends _i1.Mock implements _i4.AuthClient { returnValueForMissingStub: null, ); } + +/// A class which mocks [StorageApi]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockStorageApi extends _i1.Mock implements _i4.StorageApi { + MockStorageApi() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.BucketAccessControlsResource get bucketAccessControls => + (super.noSuchMethod( + Invocation.getter(#bucketAccessControls), + returnValue: _FakeBucketAccessControlsResource_3( + this, + Invocation.getter(#bucketAccessControls), + ), + ) as _i4.BucketAccessControlsResource); + @override + _i4.BucketsResource get buckets => (super.noSuchMethod( + Invocation.getter(#buckets), + returnValue: _FakeBucketsResource_4( + this, + Invocation.getter(#buckets), + ), + ) as _i4.BucketsResource); + @override + _i4.ChannelsResource get channels => (super.noSuchMethod( + Invocation.getter(#channels), + returnValue: _FakeChannelsResource_5( + this, + Invocation.getter(#channels), + ), + ) as _i4.ChannelsResource); + @override + _i4.DefaultObjectAccessControlsResource get defaultObjectAccessControls => + (super.noSuchMethod( + Invocation.getter(#defaultObjectAccessControls), + returnValue: _FakeDefaultObjectAccessControlsResource_6( + this, + Invocation.getter(#defaultObjectAccessControls), + ), + ) as _i4.DefaultObjectAccessControlsResource); + @override + _i4.NotificationsResource get notifications => (super.noSuchMethod( + Invocation.getter(#notifications), + returnValue: _FakeNotificationsResource_7( + this, + Invocation.getter(#notifications), + ), + ) as _i4.NotificationsResource); + @override + _i4.ObjectAccessControlsResource get objectAccessControls => + (super.noSuchMethod( + Invocation.getter(#objectAccessControls), + returnValue: _FakeObjectAccessControlsResource_8( + this, + Invocation.getter(#objectAccessControls), + ), + ) as _i4.ObjectAccessControlsResource); + @override + _i4.ObjectsResource get objects => (super.noSuchMethod( + Invocation.getter(#objects), + returnValue: _FakeObjectsResource_9( + this, + Invocation.getter(#objects), + ), + ) as _i4.ObjectsResource); + @override + _i4.ProjectsResource get projects => (super.noSuchMethod( + Invocation.getter(#projects), + returnValue: _FakeProjectsResource_10( + this, + Invocation.getter(#projects), + ), + ) as _i4.ProjectsResource); +} + +/// A class which mocks [ObjectsResource]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { + @override + _i6.Future<_i4.Object> compose( + _i4.ComposeRequest? request, + String? destinationBucket, + String? destinationObject, { + String? destinationPredefinedAcl, + String? ifGenerationMatch, + String? ifMetagenerationMatch, + String? kmsKeyName, + String? provisionalUserProject, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #compose, + [ + request, + destinationBucket, + destinationObject, + ], + { + #destinationPredefinedAcl: destinationPredefinedAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #kmsKeyName: kmsKeyName, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #compose, + [ + request, + destinationBucket, + destinationObject, + ], + { + #destinationPredefinedAcl: destinationPredefinedAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #kmsKeyName: kmsKeyName, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #compose, + [ + request, + destinationBucket, + destinationObject, + ], + { + #destinationPredefinedAcl: destinationPredefinedAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #kmsKeyName: kmsKeyName, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Object>); + @override + _i6.Future<_i4.Object> copy( + _i4.Object? request, + String? sourceBucket, + String? sourceObject, + String? destinationBucket, + String? destinationObject, { + String? destinationKmsKeyName, + String? destinationPredefinedAcl, + String? ifGenerationMatch, + String? ifGenerationNotMatch, + String? ifMetagenerationMatch, + String? ifMetagenerationNotMatch, + String? ifSourceGenerationMatch, + String? ifSourceGenerationNotMatch, + String? ifSourceMetagenerationMatch, + String? ifSourceMetagenerationNotMatch, + String? projection, + String? provisionalUserProject, + String? sourceGeneration, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #copy, + [ + request, + sourceBucket, + sourceObject, + destinationBucket, + destinationObject, + ], + { + #destinationKmsKeyName: destinationKmsKeyName, + #destinationPredefinedAcl: destinationPredefinedAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #ifSourceGenerationMatch: ifSourceGenerationMatch, + #ifSourceGenerationNotMatch: ifSourceGenerationNotMatch, + #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, + #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #sourceGeneration: sourceGeneration, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #copy, + [ + request, + sourceBucket, + sourceObject, + destinationBucket, + destinationObject, + ], + { + #destinationKmsKeyName: destinationKmsKeyName, + #destinationPredefinedAcl: destinationPredefinedAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #ifSourceGenerationMatch: ifSourceGenerationMatch, + #ifSourceGenerationNotMatch: ifSourceGenerationNotMatch, + #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, + #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #sourceGeneration: sourceGeneration, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #copy, + [ + request, + sourceBucket, + sourceObject, + destinationBucket, + destinationObject, + ], + { + #destinationKmsKeyName: destinationKmsKeyName, + #destinationPredefinedAcl: destinationPredefinedAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #ifSourceGenerationMatch: ifSourceGenerationMatch, + #ifSourceGenerationNotMatch: ifSourceGenerationNotMatch, + #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, + #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #sourceGeneration: sourceGeneration, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Object>); + @override + _i6.Future delete( + String? bucket, + String? object, { + String? generation, + String? ifGenerationMatch, + String? ifGenerationNotMatch, + String? ifMetagenerationMatch, + String? ifMetagenerationNotMatch, + String? provisionalUserProject, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #delete, + [ + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override + _i6.Future get( + String? bucket, + String? object, { + String? generation, + String? ifGenerationMatch, + String? ifGenerationNotMatch, + String? ifMetagenerationMatch, + String? ifMetagenerationNotMatch, + String? projection, + String? provisionalUserProject, + String? userProject, + String? $fields, + _i9.DownloadOptions? downloadOptions = _i9.DownloadOptions.metadata, + }) => + (super.noSuchMethod( + Invocation.method( + #get, + [ + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + #downloadOptions: downloadOptions, + }, + ), + returnValue: _i6.Future.value(_FakeObject_12( + this, + Invocation.method( + #get, + [ + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + #downloadOptions: downloadOptions, + }, + ), + )), + returnValueForMissingStub: _i6.Future.value(_FakeObject_12( + this, + Invocation.method( + #get, + [ + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + #downloadOptions: downloadOptions, + }, + ), + )), + ) as _i6.Future); + @override + _i6.Future<_i4.Policy> getIamPolicy( + String? bucket, + String? object, { + String? generation, + String? provisionalUserProject, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #getIamPolicy, + [ + bucket, + object, + ], + { + #generation: generation, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + this, + Invocation.method( + #getIamPolicy, + [ + bucket, + object, + ], + { + #generation: generation, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + this, + Invocation.method( + #getIamPolicy, + [ + bucket, + object, + ], + { + #generation: generation, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Policy>); + @override + _i6.Future<_i4.Object> insert( + _i4.Object? request, + String? bucket, { + String? contentEncoding, + String? ifGenerationMatch, + String? ifGenerationNotMatch, + String? ifMetagenerationMatch, + String? ifMetagenerationNotMatch, + String? kmsKeyName, + String? name, + String? predefinedAcl, + String? projection, + String? provisionalUserProject, + String? userProject, + String? $fields, + _i9.UploadOptions? uploadOptions = _i9.UploadOptions.defaultOptions, + _i9.Media? uploadMedia, + }) => + (super.noSuchMethod( + Invocation.method( + #insert, + [ + request, + bucket, + ], + { + #contentEncoding: contentEncoding, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #kmsKeyName: kmsKeyName, + #name: name, + #predefinedAcl: predefinedAcl, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + #uploadOptions: uploadOptions, + #uploadMedia: uploadMedia, + }, + ), + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #insert, + [ + request, + bucket, + ], + { + #contentEncoding: contentEncoding, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #kmsKeyName: kmsKeyName, + #name: name, + #predefinedAcl: predefinedAcl, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + #uploadOptions: uploadOptions, + #uploadMedia: uploadMedia, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #insert, + [ + request, + bucket, + ], + { + #contentEncoding: contentEncoding, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #kmsKeyName: kmsKeyName, + #name: name, + #predefinedAcl: predefinedAcl, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + #uploadOptions: uploadOptions, + #uploadMedia: uploadMedia, + }, + ), + )), + ) as _i6.Future<_i4.Object>); + @override + _i6.Future<_i4.Objects> list( + String? bucket, { + String? delimiter, + String? endOffset, + bool? includeTrailingDelimiter, + int? maxResults, + String? pageToken, + String? prefix, + String? projection, + String? provisionalUserProject, + String? startOffset, + String? userProject, + bool? versions, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #list, + [bucket], + { + #delimiter: delimiter, + #endOffset: endOffset, + #includeTrailingDelimiter: includeTrailingDelimiter, + #maxResults: maxResults, + #pageToken: pageToken, + #prefix: prefix, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #startOffset: startOffset, + #userProject: userProject, + #versions: versions, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Objects>.value(_FakeObjects_14( + this, + Invocation.method( + #list, + [bucket], + { + #delimiter: delimiter, + #endOffset: endOffset, + #includeTrailingDelimiter: includeTrailingDelimiter, + #maxResults: maxResults, + #pageToken: pageToken, + #prefix: prefix, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #startOffset: startOffset, + #userProject: userProject, + #versions: versions, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: + _i6.Future<_i4.Objects>.value(_FakeObjects_14( + this, + Invocation.method( + #list, + [bucket], + { + #delimiter: delimiter, + #endOffset: endOffset, + #includeTrailingDelimiter: includeTrailingDelimiter, + #maxResults: maxResults, + #pageToken: pageToken, + #prefix: prefix, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #startOffset: startOffset, + #userProject: userProject, + #versions: versions, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Objects>); + @override + _i6.Future<_i4.Object> patch( + _i4.Object? request, + String? bucket, + String? object, { + String? generation, + String? ifGenerationMatch, + String? ifGenerationNotMatch, + String? ifMetagenerationMatch, + String? ifMetagenerationNotMatch, + String? predefinedAcl, + String? projection, + String? provisionalUserProject, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #patch, + [ + request, + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #predefinedAcl: predefinedAcl, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #patch, + [ + request, + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #predefinedAcl: predefinedAcl, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #patch, + [ + request, + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #predefinedAcl: predefinedAcl, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Object>); + @override + _i6.Future<_i4.RewriteResponse> rewrite( + _i4.Object? request, + String? sourceBucket, + String? sourceObject, + String? destinationBucket, + String? destinationObject, { + String? destinationKmsKeyName, + String? destinationPredefinedAcl, + String? ifGenerationMatch, + String? ifGenerationNotMatch, + String? ifMetagenerationMatch, + String? ifMetagenerationNotMatch, + String? ifSourceGenerationMatch, + String? ifSourceGenerationNotMatch, + String? ifSourceMetagenerationMatch, + String? ifSourceMetagenerationNotMatch, + String? maxBytesRewrittenPerCall, + String? projection, + String? provisionalUserProject, + String? rewriteToken, + String? sourceGeneration, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #rewrite, + [ + request, + sourceBucket, + sourceObject, + destinationBucket, + destinationObject, + ], + { + #destinationKmsKeyName: destinationKmsKeyName, + #destinationPredefinedAcl: destinationPredefinedAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #ifSourceGenerationMatch: ifSourceGenerationMatch, + #ifSourceGenerationNotMatch: ifSourceGenerationNotMatch, + #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, + #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, + #maxBytesRewrittenPerCall: maxBytesRewrittenPerCall, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #rewriteToken: rewriteToken, + #sourceGeneration: sourceGeneration, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: + _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_15( + this, + Invocation.method( + #rewrite, + [ + request, + sourceBucket, + sourceObject, + destinationBucket, + destinationObject, + ], + { + #destinationKmsKeyName: destinationKmsKeyName, + #destinationPredefinedAcl: destinationPredefinedAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #ifSourceGenerationMatch: ifSourceGenerationMatch, + #ifSourceGenerationNotMatch: ifSourceGenerationNotMatch, + #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, + #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, + #maxBytesRewrittenPerCall: maxBytesRewrittenPerCall, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #rewriteToken: rewriteToken, + #sourceGeneration: sourceGeneration, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: + _i6.Future<_i4.RewriteResponse>.value(_FakeRewriteResponse_15( + this, + Invocation.method( + #rewrite, + [ + request, + sourceBucket, + sourceObject, + destinationBucket, + destinationObject, + ], + { + #destinationKmsKeyName: destinationKmsKeyName, + #destinationPredefinedAcl: destinationPredefinedAcl, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #ifSourceGenerationMatch: ifSourceGenerationMatch, + #ifSourceGenerationNotMatch: ifSourceGenerationNotMatch, + #ifSourceMetagenerationMatch: ifSourceMetagenerationMatch, + #ifSourceMetagenerationNotMatch: ifSourceMetagenerationNotMatch, + #maxBytesRewrittenPerCall: maxBytesRewrittenPerCall, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #rewriteToken: rewriteToken, + #sourceGeneration: sourceGeneration, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.RewriteResponse>); + @override + _i6.Future<_i4.Policy> setIamPolicy( + _i4.Policy? request, + String? bucket, + String? object, { + String? generation, + String? provisionalUserProject, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #setIamPolicy, + [ + request, + bucket, + object, + ], + { + #generation: generation, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + this, + Invocation.method( + #setIamPolicy, + [ + request, + bucket, + object, + ], + { + #generation: generation, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i4.Policy>.value(_FakePolicy_13( + this, + Invocation.method( + #setIamPolicy, + [ + request, + bucket, + object, + ], + { + #generation: generation, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Policy>); + @override + _i6.Future<_i4.TestIamPermissionsResponse> testIamPermissions( + String? bucket, + String? object, + List? permissions, { + String? generation, + String? provisionalUserProject, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #testIamPermissions, + [ + bucket, + object, + permissions, + ], + { + #generation: generation, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.TestIamPermissionsResponse>.value( + _FakeTestIamPermissionsResponse_16( + this, + Invocation.method( + #testIamPermissions, + [ + bucket, + object, + permissions, + ], + { + #generation: generation, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: + _i6.Future<_i4.TestIamPermissionsResponse>.value( + _FakeTestIamPermissionsResponse_16( + this, + Invocation.method( + #testIamPermissions, + [ + bucket, + object, + permissions, + ], + { + #generation: generation, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.TestIamPermissionsResponse>); + @override + _i6.Future<_i4.Object> update( + _i4.Object? request, + String? bucket, + String? object, { + String? generation, + String? ifGenerationMatch, + String? ifGenerationNotMatch, + String? ifMetagenerationMatch, + String? ifMetagenerationNotMatch, + String? predefinedAcl, + String? projection, + String? provisionalUserProject, + String? userProject, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #update, + [ + request, + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #predefinedAcl: predefinedAcl, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #update, + [ + request, + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #predefinedAcl: predefinedAcl, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: _i6.Future<_i4.Object>.value(_FakeObject_11( + this, + Invocation.method( + #update, + [ + request, + bucket, + object, + ], + { + #generation: generation, + #ifGenerationMatch: ifGenerationMatch, + #ifGenerationNotMatch: ifGenerationNotMatch, + #ifMetagenerationMatch: ifMetagenerationMatch, + #ifMetagenerationNotMatch: ifMetagenerationNotMatch, + #predefinedAcl: predefinedAcl, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #userProject: userProject, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Object>); + @override + _i6.Future<_i4.Channel> watchAll( + _i4.Channel? request, + String? bucket, { + String? delimiter, + String? endOffset, + bool? includeTrailingDelimiter, + int? maxResults, + String? pageToken, + String? prefix, + String? projection, + String? provisionalUserProject, + String? startOffset, + String? userProject, + bool? versions, + String? $fields, + }) => + (super.noSuchMethod( + Invocation.method( + #watchAll, + [ + request, + bucket, + ], + { + #delimiter: delimiter, + #endOffset: endOffset, + #includeTrailingDelimiter: includeTrailingDelimiter, + #maxResults: maxResults, + #pageToken: pageToken, + #prefix: prefix, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #startOffset: startOffset, + #userProject: userProject, + #versions: versions, + #$fields: $fields, + }, + ), + returnValue: _i6.Future<_i4.Channel>.value(_FakeChannel_17( + this, + Invocation.method( + #watchAll, + [ + request, + bucket, + ], + { + #delimiter: delimiter, + #endOffset: endOffset, + #includeTrailingDelimiter: includeTrailingDelimiter, + #maxResults: maxResults, + #pageToken: pageToken, + #prefix: prefix, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #startOffset: startOffset, + #userProject: userProject, + #versions: versions, + #$fields: $fields, + }, + ), + )), + returnValueForMissingStub: + _i6.Future<_i4.Channel>.value(_FakeChannel_17( + this, + Invocation.method( + #watchAll, + [ + request, + bucket, + ], + { + #delimiter: delimiter, + #endOffset: endOffset, + #includeTrailingDelimiter: includeTrailingDelimiter, + #maxResults: maxResults, + #pageToken: pageToken, + #prefix: prefix, + #projection: projection, + #provisionalUserProject: provisionalUserProject, + #startOffset: startOffset, + #userProject: userProject, + #versions: versions, + #$fields: $fields, + }, + ), + )), + ) as _i6.Future<_i4.Channel>); +} diff --git a/packages/metrics_center/test/skiaperf_test.dart b/packages/metrics_center/test/skiaperf_test.dart index c8fbcd86112..b4a6d573a86 100644 --- a/packages/metrics_center/test/skiaperf_test.dart +++ b/packages/metrics_center/test/skiaperf_test.dart @@ -8,7 +8,8 @@ import 'dart:async'; import 'dart:convert'; import 'package:gcloud/storage.dart'; -import 'package:googleapis/storage/v1.dart' show DetailedApiRequestError; +import 'package:googleapis/storage/v1.dart' + show DetailedApiRequestError, StorageApi; import 'package:googleapis_auth/auth_io.dart'; import 'package:metrics_center/metrics_center.dart'; import 'package:metrics_center/src/gcs_lock.dart'; @@ -426,7 +427,7 @@ Future main() async { assert(await storage.bucketExists(kTestBucketName)); testBucket = storage.bucket(kTestBucketName); - testLock = GcsLock(client, kTestBucketName); + testLock = GcsLock(StorageApi(client), kTestBucketName); } Future skiaPerfGcsAdapterIntegrationTest() async { diff --git a/packages/metrics_center/test/skiaperf_test.mocks.dart b/packages/metrics_center/test/skiaperf_test.mocks.dart index 98757656c36..70f8ae63f8f 100644 --- a/packages/metrics_center/test/skiaperf_test.mocks.dart +++ b/packages/metrics_center/test/skiaperf_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.0 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in metrics_center/test/skiaperf_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i2; diff --git a/script/configs/allowed_unpinned_deps.yaml b/script/configs/allowed_unpinned_deps.yaml index d027396f93d..ddb3b897d8b 100644 --- a/script/configs/allowed_unpinned_deps.yaml +++ b/script/configs/allowed_unpinned_deps.yaml @@ -60,6 +60,7 @@ - wasm - yaml # Google-owned packages +- _discoveryapis_commons - adaptive_navigation - file - googleapis