Skip to content

Commit 2e12a73

Browse files
s/withMaxResults/maxResults (#6714)
1 parent 00be38c commit 2e12a73

File tree

5 files changed

+24
-22
lines changed

5 files changed

+24
-22
lines changed

FirebaseStorage/CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Unreleased
2-
- [fixed] Fixed an issue with the List API that prevented listing of locations
3-
that contain the "+" sign.
4-
51
# 7.0.0
62
- [changed] The global variable `FIRStorageVersionString` is deleted.
73
`FirebaseVersion()` or `FIRFirebaseVersion()` should be used instead.
4+
- [fixed] Fixed an issue with the List API that prevented listing of locations
5+
that contain the "+" sign.
6+
- [changed] Renamed `list(withMaxResults:)` to `list(maxResults:)` in the Swift
7+
API.
88

99
# 3.8.1
1010
- [fixed] Fixed typo in doc comments (#6485).

FirebaseStorage/Sources/Public/FirebaseStorage/FIRStorageReference.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ NS_SWIFT_NAME(putData(_:metadata:));
252252
*/
253253
- (void)listWithMaxResults:(int64_t)maxResults
254254
completion:
255-
(void (^)(FIRStorageListResult *result, NSError *_Nullable error))completion;
255+
(void (^)(FIRStorageListResult *result, NSError *_Nullable error))completion
256+
NS_SWIFT_NAME(list(maxResults:completion:));
256257

257258
/**
258259
* Resumes a previous call to list(maxResults:completion:)`, starting after a pagination token.
@@ -274,7 +275,8 @@ NS_SWIFT_NAME(putData(_:metadata:));
274275
- (void)listWithMaxResults:(int64_t)maxResults
275276
pageToken:(NSString *)pageToken
276277
completion:
277-
(void (^)(FIRStorageListResult *result, NSError *_Nullable error))completion;
278+
(void (^)(FIRStorageListResult *result, NSError *_Nullable error))completion
279+
NS_SWIFT_NAME(list(maxResults:pageToken:completion:));
278280

279281
#pragma mark - Metadata Operations
280282

FirebaseStorage/Tests/SwiftIntegration/StorageIntegration.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ class StorageIntegration: XCTestCase {
711711
let expectation = self.expectation(description: #function)
712712
let ref = storage.reference(withPath: "ios/public/list")
713713

714-
ref.list(withMaxResults: 2, completion: { listResult, error in
714+
ref.list(maxResults: 2) { listResult, error in
715715
XCTAssertNotNil(listResult, "listResult should not be nil")
716716
XCTAssertNil(error, "Error should be nil")
717717

@@ -721,31 +721,31 @@ class StorageIntegration: XCTestCase {
721721
XCTFail("pageToken should not be nil")
722722
return
723723
}
724-
ref.list(withMaxResults: 2, pageToken: pageToken, completion: { listResult, error in
724+
ref.list(maxResults: 2, pageToken: pageToken) { listResult, error in
725725
XCTAssertNotNil(listResult, "listResult should not be nil")
726726
XCTAssertNil(error, "Error should be nil")
727727

728728
XCTAssertEqual(listResult.items, [])
729729
XCTAssertEqual(listResult.prefixes, [ref.child("prefix")])
730730
XCTAssertNil(listResult.pageToken, "pageToken should be nil")
731731
expectation.fulfill()
732-
})
733-
})
732+
}
733+
}
734734
waitForExpectations()
735735
}
736736

737737
func testListAllFiles() {
738738
let expectation = self.expectation(description: #function)
739739
let ref = storage.reference(withPath: "ios/public/list")
740740

741-
ref.listAll(completion: { listResult, error in
741+
ref.listAll { listResult, error in
742742
XCTAssertNotNil(listResult, "listResult should not be nil")
743743
XCTAssertNil(error, "Error should be nil")
744744
XCTAssertEqual(listResult.items, [ref.child("a"), ref.child("b")])
745745
XCTAssertEqual(listResult.prefixes, [ref.child("prefix")])
746746
XCTAssertNil(listResult.pageToken, "pageToken should be nil")
747747
expectation.fulfill()
748-
})
748+
}
749749
waitForExpectations()
750750
}
751751

FirebaseStorageSwift/Sources/SwiftAPIExtension.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ public extension StorageReference {
8686
/// Only available for projects using Firebase Rules Version 2.
8787
///
8888
/// - Parameters:
89-
/// - withMaxResults The maximum number of results to return in a single page. Must be
90-
/// greater than 0 and at most 1000.
89+
/// - maxResults The maximum number of results to return in a single page. Must be
90+
/// greater than 0 and at most 1000.
9191
/// - pageToken A page token from a previous call to list.
9292
/// - completion A completion handler that will be invoked with the next items and
9393
/// prefixes under the current StorageReference. It returns a `Result` enum
9494
/// with either the list or an `Error`.
95-
func list(withMaxResults maxResults: Int64,
95+
func list(maxResults: Int64,
9696
pageToken: String,
9797
completion: @escaping (Result<StorageListResult, Error>) -> Void) {
98-
list(withMaxResults: maxResults,
98+
list(maxResults: maxResults,
9999
pageToken: pageToken,
100100
completion: getResultCallback(completion: completion))
101101
}
@@ -109,14 +109,14 @@ public extension StorageReference {
109109
/// Only available for projects using Firebase Rules Version 2.
110110
///
111111
/// - Parameters:
112-
/// - withMaxResults The maximum number of results to return in a single page. Must be
113-
/// greater than 0 and at most 1000.
112+
/// - maxResults The maximum number of results to return in a single page. Must be
113+
/// greater than 0 and at most 1000.
114114
/// - completion A completion handler that will be invoked with the next items and
115115
/// prefixes under the current `StorageReference`. It returns a `Result` enum
116116
/// with either the list or an `Error`.
117-
func list(withMaxResults maxResults: Int64,
117+
func list(maxResults: Int64,
118118
completion: @escaping (Result<StorageListResult, Error>) -> Void) {
119-
list(withMaxResults: maxResults,
119+
list(maxResults: maxResults,
120120
completion: getResultCallback(completion: completion))
121121
}
122122

FirebaseStorageSwift/Tests/Integration/StorageIntegration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ class StorageIntegration: XCTestCase {
541541
let expectation = self.expectation(description: #function)
542542
let ref = storage.reference(withPath: "ios/public/list")
543543

544-
ref.list(withMaxResults: 2) { result in
544+
ref.list(maxResults: 2) { result in
545545
switch result {
546546
case let .success(listResult):
547547
XCTAssertEqual(listResult.items, [ref.child("a"), ref.child("b")])
@@ -551,7 +551,7 @@ class StorageIntegration: XCTestCase {
551551
expectation.fulfill()
552552
return
553553
}
554-
ref.list(withMaxResults: 2, pageToken: pageToken) { result in
554+
ref.list(maxResults: 2, pageToken: pageToken) { result in
555555
switch result {
556556
case let .success(listResult):
557557
XCTAssertEqual(listResult.items, [])

0 commit comments

Comments
 (0)