aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Model
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-04-16 13:50:11 -0700
committerGravatar GitHub <noreply@github.com>2018-04-16 13:50:11 -0700
commita25d05487435d397f3b8cd399ee8355eae497f0d (patch)
tree323b23f9ad4849093f2dbb53c8ebece59f0bd870 /Firestore/Source/Model
parent0ac71f294ffedc8c6a3fb93e18253ee25624ec00 (diff)
Replace the `SnapshotOptions` object with the behavior enum. (#1109)
Instead of calling `get(field, SnapshotOptions.serverTimestampBehavior(.estimate))` call `get(field, serverTimestampBehavior: .estimate)`
Diffstat (limited to 'Firestore/Source/Model')
-rw-r--r--Firestore/Source/Model/FSTFieldValue.h5
-rw-r--r--Firestore/Source/Model/FSTFieldValue.mm24
2 files changed, 1 insertions, 28 deletions
diff --git a/Firestore/Source/Model/FSTFieldValue.h b/Firestore/Source/Model/FSTFieldValue.h
index 6914f4d..6f9798a 100644
--- a/Firestore/Source/Model/FSTFieldValue.h
+++ b/Firestore/Source/Model/FSTFieldValue.h
@@ -25,7 +25,6 @@
@class FIRTimestamp;
@class FSTFieldValueOptions;
@class FIRGeoPoint;
-@class FIRSnapshotOptions;
NS_ASSUME_NONNULL_BEGIN
@@ -67,10 +66,6 @@ typedef NS_ENUM(NSInteger, FSTServerTimestampBehavior) {
timestampsInSnapshotsEnabled:(BOOL)timestampsInSnapshotsEnabled
NS_DESIGNATED_INITIALIZER;
-/** Creates an FSTFieldValueOptions instance from FIRSnapshotOptions. */
-+ (instancetype)optionsForSnapshotOptions:(FIRSnapshotOptions *)value
- timestampsInSnapshotsEnabled:(BOOL)timestampsInSnapshotsEnabled;
-
@end
/**
diff --git a/Firestore/Source/Model/FSTFieldValue.mm b/Firestore/Source/Model/FSTFieldValue.mm
index 0d7c649..9e77d39 100644
--- a/Firestore/Source/Model/FSTFieldValue.mm
+++ b/Firestore/Source/Model/FSTFieldValue.mm
@@ -16,10 +16,10 @@
#import "Firestore/Source/Model/FSTFieldValue.h"
+#import "FIRDocumentSnapshot.h"
#import "FIRTimestamp.h"
#import "Firestore/Source/API/FIRGeoPoint+Internal.h"
-#import "Firestore/Source/API/FIRSnapshotOptions+Internal.h"
#import "Firestore/Source/Model/FSTDocumentKey.h"
#import "Firestore/Source/Util/FSTAssert.h"
#import "Firestore/Source/Util/FSTClasses.h"
@@ -46,28 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
@implementation FSTFieldValueOptions
-+ (instancetype)optionsForSnapshotOptions:(FIRSnapshotOptions *)options
- timestampsInSnapshotsEnabled:(BOOL)timestampsInSnapshotsEnabled {
- FSTServerTimestampBehavior convertedServerTimestampBehavior = FSTServerTimestampBehaviorNone;
- switch (options.serverTimestampBehavior) {
- case FIRServerTimestampBehaviorNone:
- convertedServerTimestampBehavior = FSTServerTimestampBehaviorNone;
- break;
- case FIRServerTimestampBehaviorEstimate:
- convertedServerTimestampBehavior = FSTServerTimestampBehaviorEstimate;
- break;
- case FIRServerTimestampBehaviorPrevious:
- convertedServerTimestampBehavior = FSTServerTimestampBehaviorPrevious;
- break;
- default:
- FSTFail(@"Unexpected server timestamp option: %ld", (long)options.serverTimestampBehavior);
- }
-
- return
- [[FSTFieldValueOptions alloc] initWithServerTimestampBehavior:convertedServerTimestampBehavior
- timestampsInSnapshotsEnabled:timestampsInSnapshotsEnabled];
-}
-
- (instancetype)initWithServerTimestampBehavior:(FSTServerTimestampBehavior)serverTimestampBehavior
timestampsInSnapshotsEnabled:(BOOL)timestampsInSnapshotsEnabled {
self = [super init];