Skip to content

Commit 8ce2a65

Browse files
committed
change addStage to rawStage
1 parent 71820c7 commit 8ce2a65

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

Firestore/Source/API/FIRPipelineBridge.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#include "Firestore/core/src/util/string_apple.h"
4747

4848
using firebase::firestore::api::AddFields;
49-
using firebase::firestore::api::AddStage;
5049
using firebase::firestore::api::AggregateFunction;
5150
using firebase::firestore::api::AggregateStage;
5251
using firebase::firestore::api::CollectionGroupSource;
@@ -65,6 +64,7 @@
6564
using firebase::firestore::api::OffsetStage;
6665
using firebase::firestore::api::Ordering;
6766
using firebase::firestore::api::Pipeline;
67+
using firebase::firestore::api::RawStage;
6868
using firebase::firestore::api::RemoveFieldsStage;
6969
using firebase::firestore::api::ReplaceWith;
7070
using firebase::firestore::api::Sample;
@@ -782,12 +782,12 @@ - (id)initWithField:(FIRExprBridge *)field indexField:(NSString *_Nullable)index
782782

783783
@end
784784

785-
@implementation FIRAddStageBridge {
785+
@implementation FIRRawStageBridge {
786786
NSString *_name;
787787
NSArray<FIRExprBridge *> *_params;
788788
NSDictionary<NSString *, FIRExprBridge *> *_Nullable _options;
789789
Boolean isUserDataRead;
790-
std::shared_ptr<AddStage> cpp_generic_stage;
790+
std::shared_ptr<RawStage> cpp_generic_stage;
791791
}
792792

793793
- (id)initWithName:(NSString *)name
@@ -815,7 +815,7 @@ - (id)initWithName:(NSString *)name
815815
cpp_options[MakeString(key)] = [_options[key] cppExprWithReader:reader];
816816
}
817817
}
818-
cpp_generic_stage = std::make_shared<AddStage>(MakeString(_name), std::move(cpp_params),
818+
cpp_generic_stage = std::make_shared<RawStage>(MakeString(_name), std::move(cpp_params),
819819
std::move(cpp_options));
820820
}
821821

Firestore/Source/Public/FirebaseFirestore/FIRPipelineBridge.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ NS_SWIFT_NAME(UnnestStageBridge)
195195
@end
196196

197197
NS_SWIFT_SENDABLE
198-
NS_SWIFT_NAME(AddStageBridge)
199-
@interface FIRAddStageBridge : FIRStageBridge
198+
NS_SWIFT_NAME(RawStageBridge)
199+
@interface FIRRawStageBridge : FIRStageBridge
200200
- (id)initWithName:(NSString *)name
201201
params:(NSArray<FIRExprBridge *> *)params
202202
options:(NSDictionary<NSString *, FIRExprBridge *> *_Nullable)options;

Firestore/Swift/Source/SwiftAPI/Pipeline/Pipeline.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ public struct Pipeline: @unchecked Sendable {
699699
/// ```swift
700700
/// // let pipeline: Pipeline = ...
701701
/// // Example: Assuming a hypothetical backend stage "customFilterV2".
702-
/// let genericPipeline = pipeline.addStage(
702+
/// let genericPipeline = pipeline.rawStage(
703703
/// name: "customFilterV2",
704704
/// params: [Field("userScore"), 80], // Ordered parameters.
705705
/// options: ["mode": "strict", "logLevel": 2] // Optional named parameters.
@@ -712,10 +712,10 @@ public struct Pipeline: @unchecked Sendable {
712712
/// - params: An array of ordered, `Sendable` parameters for the stage.
713713
/// - options: Optional dictionary of named, `Sendable` parameters.
714714
/// - Returns: A new `Pipeline` object with this stage appended.
715-
public func addStage(name: String, params: [Sendable],
715+
public func rawStage(name: String, params: [Sendable],
716716
options: [String: Sendable]? = nil) -> Pipeline {
717717
return Pipeline(
718-
stages: stages + [AddStage(name: name, params: params, options: options)],
718+
stages: stages + [RawStage(name: name, params: params, options: options)],
719719
db: db
720720
)
721721
}

Firestore/Swift/Source/SwiftAPI/Stages.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class Unnest: Stage {
341341
}
342342

343343
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
344-
class AddStage: Stage {
344+
class RawStage: Stage {
345345
let name: String
346346
let bridge: StageBridge
347347
private var params: [Sendable]
@@ -353,6 +353,6 @@ class AddStage: Stage {
353353
self.options = options
354354
let bridgeParams = params.map { Helper.sendableToExpr($0).toBridge() }
355355
let bridgeOptions = options?.mapValues { Helper.sendableToExpr($0).toBridge() }
356-
bridge = AddStageBridge(name: name, params: bridgeParams, options: bridgeOptions)
356+
bridge = RawStageBridge(name: name, params: bridgeParams, options: bridgeOptions)
357357
}
358358
}

Firestore/Swift/Tests/Integration/PipelineApiTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,20 +263,20 @@ final class PipelineTests: FSTIntegrationTestCase {
263263
// ... }
264264
}
265265

266-
func testAddStage() async throws {
266+
func testRawStage() async throws {
267267
// Assume we don't have a built-in "where" stage, the customer could still
268-
// add this stage by calling addStage, passing the name of the stage "where",
268+
// add this stage by calling rawStage, passing the name of the stage "where",
269269
// and providing positional argument values.
270270
_ = db.pipeline().collection("books")
271-
.addStage(name: "where",
271+
.rawStage(name: "where",
272272
params: [Field("published").lt(1900)])
273273
.select("title", "author")
274274

275275
// In cases where the stage also supports named argument values, then these can be
276276
// provided with a third argument that maps the argument name to value.
277277
// Note that these named arguments are always optional in the stage definition.
278278
_ = db.pipeline().collection("books")
279-
.addStage(name: "where",
279+
.rawStage(name: "where",
280280
params: [Field("published").lt(1900)],
281281
options: ["someOptionalParamName": "the argument value for this param"])
282282
.select("title", "author")

Firestore/core/src/api/stages.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ google_firestore_v1_Pipeline_Stage Unnest::to_proto() const {
393393
return result;
394394
}
395395

396-
AddStage::AddStage(
396+
RawStage::RawStage(
397397
std::string name,
398398
std::vector<std::shared_ptr<Expr>> params,
399399
std::unordered_map<std::string, std::shared_ptr<Expr>> options)
@@ -402,7 +402,7 @@ AddStage::AddStage(
402402
options_(std::move(options)) {
403403
}
404404

405-
google_firestore_v1_Pipeline_Stage AddStage::to_proto() const {
405+
google_firestore_v1_Pipeline_Stage RawStage::to_proto() const {
406406
google_firestore_v1_Pipeline_Stage result;
407407
result.name = nanopb::MakeBytesArray(name_);
408408

0 commit comments

Comments
 (0)