aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Protos/objc/firestore
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Protos/objc/firestore')
-rw-r--r--Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h132
-rw-r--r--Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.m192
-rw-r--r--Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h138
-rw-r--r--Firestore/Protos/objc/firestore/local/Mutation.pbobjc.m190
-rw-r--r--Firestore/Protos/objc/firestore/local/Target.pbobjc.h208
-rw-r--r--Firestore/Protos/objc/firestore/local/Target.pbobjc.m247
6 files changed, 1107 insertions, 0 deletions
diff --git a/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h b/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h
new file mode 100644
index 0000000..d34090a
--- /dev/null
+++ b/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: firestore/local/maybe_document.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBProtocolBuffers.h>
+#else
+ #import "GPBProtocolBuffers.h"
+#endif
+
+#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
+#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
+#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+CF_EXTERN_C_BEGIN
+
+@class FSTPBNoDocument;
+@class GCFSDocument;
+@class GPBTimestamp;
+
+NS_ASSUME_NONNULL_BEGIN
+
+#pragma mark - FSTPBMaybeDocumentRoot
+
+/**
+ * Exposes the extension registry for this file.
+ *
+ * The base class provides:
+ * @code
+ * + (GPBExtensionRegistry *)extensionRegistry;
+ * @endcode
+ * which is a @c GPBExtensionRegistry that includes all the extensions defined by
+ * this file and all files that it depends on.
+ **/
+@interface FSTPBMaybeDocumentRoot : GPBRootObject
+@end
+
+#pragma mark - FSTPBNoDocument
+
+typedef GPB_ENUM(FSTPBNoDocument_FieldNumber) {
+ FSTPBNoDocument_FieldNumber_Name = 1,
+ FSTPBNoDocument_FieldNumber_ReadTime = 2,
+};
+
+/**
+ * A message indicating that the document is known to not exist.
+ **/
+@interface FSTPBNoDocument : GPBMessage
+
+/**
+ * The name of the document that does not exist, in the standard format:
+ * `projects/{project_id}/databases/{database_id}/documents/{document_path}`
+ **/
+@property(nonatomic, readwrite, copy, null_resettable) NSString *name;
+
+/** The time at which we observed that it does not exist. */
+@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime;
+/** Test to see if @c readTime has been set. */
+@property(nonatomic, readwrite) BOOL hasReadTime;
+
+@end
+
+#pragma mark - FSTPBMaybeDocument
+
+typedef GPB_ENUM(FSTPBMaybeDocument_FieldNumber) {
+ FSTPBMaybeDocument_FieldNumber_NoDocument = 1,
+ FSTPBMaybeDocument_FieldNumber_Document = 2,
+};
+
+typedef GPB_ENUM(FSTPBMaybeDocument_DocumentType_OneOfCase) {
+ FSTPBMaybeDocument_DocumentType_OneOfCase_GPBUnsetOneOfCase = 0,
+ FSTPBMaybeDocument_DocumentType_OneOfCase_NoDocument = 1,
+ FSTPBMaybeDocument_DocumentType_OneOfCase_Document = 2,
+};
+
+/**
+ * Represents either an existing document or the explicitly known absence of a
+ * document.
+ **/
+@interface FSTPBMaybeDocument : GPBMessage
+
+@property(nonatomic, readonly) FSTPBMaybeDocument_DocumentType_OneOfCase documentTypeOneOfCase;
+
+/** Used if the document is known to not exist. */
+@property(nonatomic, readwrite, strong, null_resettable) FSTPBNoDocument *noDocument;
+
+/** The document (if it exists). */
+@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document;
+
+@end
+
+/**
+ * Clears whatever value was set for the oneof 'documentType'.
+ **/
+void FSTPBMaybeDocument_ClearDocumentTypeOneOfCase(FSTPBMaybeDocument *message);
+
+NS_ASSUME_NONNULL_END
+
+CF_EXTERN_C_END
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)
diff --git a/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.m b/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.m
new file mode 100644
index 0000000..1d4404d
--- /dev/null
+++ b/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.m
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: firestore/local/maybe_document.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
+#else
+ #import "GPBProtocolBuffers_RuntimeSupport.h"
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/Timestamp.pbobjc.h>
+#else
+ #import "Timestamp.pbobjc.h"
+#endif
+
+ #import "MaybeDocument.pbobjc.h"
+ #import "Document.pbobjc.h"
+ #import "Annotations.pbobjc.h"
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic ignored "-Wdirect-ivar-access"
+
+#pragma mark - FSTPBMaybeDocumentRoot
+
+@implementation FSTPBMaybeDocumentRoot
+
+
+@end
+
+#pragma mark - FSTPBMaybeDocumentRoot_FileDescriptor
+
+static GPBFileDescriptor *FSTPBMaybeDocumentRoot_FileDescriptor(void) {
+ // This is called by +initialize so there is no need to worry
+ // about thread safety of the singleton.
+ static GPBFileDescriptor *descriptor = NULL;
+ if (!descriptor) {
+ GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
+ descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"firestore.client"
+ objcPrefix:@"FSTPB"
+ syntax:GPBFileSyntaxProto3];
+ }
+ return descriptor;
+}
+
+#pragma mark - FSTPBNoDocument
+
+@implementation FSTPBNoDocument
+
+@dynamic name;
+@dynamic hasReadTime, readTime;
+
+typedef struct FSTPBNoDocument__storage_ {
+ uint32_t _has_storage_[1];
+ NSString *name;
+ GPBTimestamp *readTime;
+} FSTPBNoDocument__storage_;
+
+// This method is threadsafe because it is initially called
+// in +initialize for each subclass.
++ (GPBDescriptor *)descriptor {
+ static GPBDescriptor *descriptor = nil;
+ if (!descriptor) {
+ static GPBMessageFieldDescription fields[] = {
+ {
+ .name = "name",
+ .dataTypeSpecific.className = NULL,
+ .number = FSTPBNoDocument_FieldNumber_Name,
+ .hasIndex = 0,
+ .offset = (uint32_t)offsetof(FSTPBNoDocument__storage_, name),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeString,
+ },
+ {
+ .name = "readTime",
+ .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp),
+ .number = FSTPBNoDocument_FieldNumber_ReadTime,
+ .hasIndex = 1,
+ .offset = (uint32_t)offsetof(FSTPBNoDocument__storage_, readTime),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeMessage,
+ },
+ };
+ GPBDescriptor *localDescriptor =
+ [GPBDescriptor allocDescriptorForClass:[FSTPBNoDocument class]
+ rootClass:[FSTPBMaybeDocumentRoot class]
+ file:FSTPBMaybeDocumentRoot_FileDescriptor()
+ fields:fields
+ fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
+ storageSize:sizeof(FSTPBNoDocument__storage_)
+ flags:GPBDescriptorInitializationFlag_None];
+ NSAssert(descriptor == nil, @"Startup recursed!");
+ descriptor = localDescriptor;
+ }
+ return descriptor;
+}
+
+@end
+
+#pragma mark - FSTPBMaybeDocument
+
+@implementation FSTPBMaybeDocument
+
+@dynamic documentTypeOneOfCase;
+@dynamic noDocument;
+@dynamic document;
+
+typedef struct FSTPBMaybeDocument__storage_ {
+ uint32_t _has_storage_[2];
+ FSTPBNoDocument *noDocument;
+ GCFSDocument *document;
+} FSTPBMaybeDocument__storage_;
+
+// This method is threadsafe because it is initially called
+// in +initialize for each subclass.
++ (GPBDescriptor *)descriptor {
+ static GPBDescriptor *descriptor = nil;
+ if (!descriptor) {
+ static GPBMessageFieldDescription fields[] = {
+ {
+ .name = "noDocument",
+ .dataTypeSpecific.className = GPBStringifySymbol(FSTPBNoDocument),
+ .number = FSTPBMaybeDocument_FieldNumber_NoDocument,
+ .hasIndex = -1,
+ .offset = (uint32_t)offsetof(FSTPBMaybeDocument__storage_, noDocument),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeMessage,
+ },
+ {
+ .name = "document",
+ .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument),
+ .number = FSTPBMaybeDocument_FieldNumber_Document,
+ .hasIndex = -1,
+ .offset = (uint32_t)offsetof(FSTPBMaybeDocument__storage_, document),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeMessage,
+ },
+ };
+ GPBDescriptor *localDescriptor =
+ [GPBDescriptor allocDescriptorForClass:[FSTPBMaybeDocument class]
+ rootClass:[FSTPBMaybeDocumentRoot class]
+ file:FSTPBMaybeDocumentRoot_FileDescriptor()
+ fields:fields
+ fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
+ storageSize:sizeof(FSTPBMaybeDocument__storage_)
+ flags:GPBDescriptorInitializationFlag_None];
+ static const char *oneofs[] = {
+ "documentType",
+ };
+ [localDescriptor setupOneofs:oneofs
+ count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
+ firstHasIndex:-1];
+ NSAssert(descriptor == nil, @"Startup recursed!");
+ descriptor = localDescriptor;
+ }
+ return descriptor;
+}
+
+@end
+
+void FSTPBMaybeDocument_ClearDocumentTypeOneOfCase(FSTPBMaybeDocument *message) {
+ GPBDescriptor *descriptor = [message descriptor];
+ GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
+ GPBMaybeClearOneof(message, oneof, -1, 0);
+}
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)
diff --git a/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h b/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h
new file mode 100644
index 0000000..0089632
--- /dev/null
+++ b/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: firestore/local/mutation.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBProtocolBuffers.h>
+#else
+ #import "GPBProtocolBuffers.h"
+#endif
+
+#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
+#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
+#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+CF_EXTERN_C_BEGIN
+
+@class GCFSWrite;
+@class GPBTimestamp;
+
+NS_ASSUME_NONNULL_BEGIN
+
+#pragma mark - FSTPBMutationRoot
+
+/**
+ * Exposes the extension registry for this file.
+ *
+ * The base class provides:
+ * @code
+ * + (GPBExtensionRegistry *)extensionRegistry;
+ * @endcode
+ * which is a @c GPBExtensionRegistry that includes all the extensions defined by
+ * this file and all files that it depends on.
+ **/
+@interface FSTPBMutationRoot : GPBRootObject
+@end
+
+#pragma mark - FSTPBMutationQueue
+
+typedef GPB_ENUM(FSTPBMutationQueue_FieldNumber) {
+ FSTPBMutationQueue_FieldNumber_LastAcknowledgedBatchId = 1,
+ FSTPBMutationQueue_FieldNumber_LastStreamToken = 2,
+};
+
+/**
+ * Each user gets a single queue of WriteBatches to apply to the server.
+ * MutationQueue tracks the metadata about the queue.
+ **/
+@interface FSTPBMutationQueue : GPBMessage
+
+/**
+ * An identifier for the highest numbered batch that has been acknowledged by
+ * the server. All WriteBatches in this queue with batch_ids less than or
+ * equal to this value are considered to have been acknowledged by the
+ * server.
+ **/
+@property(nonatomic, readwrite) int32_t lastAcknowledgedBatchId;
+
+/**
+ * A stream token that was previously sent by the server.
+ *
+ * See StreamingWriteRequest in datastore.proto for more details about usage.
+ *
+ * After sending this token, earlier tokens may not be used anymore so only a
+ * single stream token is retained.
+ **/
+@property(nonatomic, readwrite, copy, null_resettable) NSData *lastStreamToken;
+
+@end
+
+#pragma mark - FSTPBWriteBatch
+
+typedef GPB_ENUM(FSTPBWriteBatch_FieldNumber) {
+ FSTPBWriteBatch_FieldNumber_BatchId = 1,
+ FSTPBWriteBatch_FieldNumber_WritesArray = 2,
+ FSTPBWriteBatch_FieldNumber_LocalWriteTime = 3,
+};
+
+/**
+ * Message containing a batch of user-level writes intended to be sent to
+ * the server in a single call. Each user-level batch gets a separate
+ * WriteBatch with a new batch_id.
+ **/
+@interface FSTPBWriteBatch : GPBMessage
+
+/**
+ * An identifier for this batch, allocated by the mutation queue in a
+ * monotonically increasing manner.
+ **/
+@property(nonatomic, readwrite) int32_t batchId;
+
+/** A list of writes to apply. All writes will be applied atomically. */
+@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSWrite*> *writesArray;
+/** The number of items in @c writesArray without causing the array to be created. */
+@property(nonatomic, readonly) NSUInteger writesArray_Count;
+
+/** The local time at which the write batch was initiated. */
+@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *localWriteTime;
+/** Test to see if @c localWriteTime has been set. */
+@property(nonatomic, readwrite) BOOL hasLocalWriteTime;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+CF_EXTERN_C_END
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)
diff --git a/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.m b/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.m
new file mode 100644
index 0000000..8034143
--- /dev/null
+++ b/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.m
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: firestore/local/mutation.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
+#else
+ #import "GPBProtocolBuffers_RuntimeSupport.h"
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/Timestamp.pbobjc.h>
+#else
+ #import "Timestamp.pbobjc.h"
+#endif
+
+ #import "Mutation.pbobjc.h"
+ #import "Write.pbobjc.h"
+ #import "Annotations.pbobjc.h"
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+#pragma mark - FSTPBMutationRoot
+
+@implementation FSTPBMutationRoot
+
+
+@end
+
+#pragma mark - FSTPBMutationRoot_FileDescriptor
+
+static GPBFileDescriptor *FSTPBMutationRoot_FileDescriptor(void) {
+ // This is called by +initialize so there is no need to worry
+ // about thread safety of the singleton.
+ static GPBFileDescriptor *descriptor = NULL;
+ if (!descriptor) {
+ GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
+ descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"firestore.client"
+ objcPrefix:@"FSTPB"
+ syntax:GPBFileSyntaxProto3];
+ }
+ return descriptor;
+}
+
+#pragma mark - FSTPBMutationQueue
+
+@implementation FSTPBMutationQueue
+
+@dynamic lastAcknowledgedBatchId;
+@dynamic lastStreamToken;
+
+typedef struct FSTPBMutationQueue__storage_ {
+ uint32_t _has_storage_[1];
+ int32_t lastAcknowledgedBatchId;
+ NSData *lastStreamToken;
+} FSTPBMutationQueue__storage_;
+
+// This method is threadsafe because it is initially called
+// in +initialize for each subclass.
++ (GPBDescriptor *)descriptor {
+ static GPBDescriptor *descriptor = nil;
+ if (!descriptor) {
+ static GPBMessageFieldDescription fields[] = {
+ {
+ .name = "lastAcknowledgedBatchId",
+ .dataTypeSpecific.className = NULL,
+ .number = FSTPBMutationQueue_FieldNumber_LastAcknowledgedBatchId,
+ .hasIndex = 0,
+ .offset = (uint32_t)offsetof(FSTPBMutationQueue__storage_, lastAcknowledgedBatchId),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeInt32,
+ },
+ {
+ .name = "lastStreamToken",
+ .dataTypeSpecific.className = NULL,
+ .number = FSTPBMutationQueue_FieldNumber_LastStreamToken,
+ .hasIndex = 1,
+ .offset = (uint32_t)offsetof(FSTPBMutationQueue__storage_, lastStreamToken),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeBytes,
+ },
+ };
+ GPBDescriptor *localDescriptor =
+ [GPBDescriptor allocDescriptorForClass:[FSTPBMutationQueue class]
+ rootClass:[FSTPBMutationRoot class]
+ file:FSTPBMutationRoot_FileDescriptor()
+ fields:fields
+ fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
+ storageSize:sizeof(FSTPBMutationQueue__storage_)
+ flags:GPBDescriptorInitializationFlag_None];
+ NSAssert(descriptor == nil, @"Startup recursed!");
+ descriptor = localDescriptor;
+ }
+ return descriptor;
+}
+
+@end
+
+#pragma mark - FSTPBWriteBatch
+
+@implementation FSTPBWriteBatch
+
+@dynamic batchId;
+@dynamic writesArray, writesArray_Count;
+@dynamic hasLocalWriteTime, localWriteTime;
+
+typedef struct FSTPBWriteBatch__storage_ {
+ uint32_t _has_storage_[1];
+ int32_t batchId;
+ NSMutableArray *writesArray;
+ GPBTimestamp *localWriteTime;
+} FSTPBWriteBatch__storage_;
+
+// This method is threadsafe because it is initially called
+// in +initialize for each subclass.
++ (GPBDescriptor *)descriptor {
+ static GPBDescriptor *descriptor = nil;
+ if (!descriptor) {
+ static GPBMessageFieldDescription fields[] = {
+ {
+ .name = "batchId",
+ .dataTypeSpecific.className = NULL,
+ .number = FSTPBWriteBatch_FieldNumber_BatchId,
+ .hasIndex = 0,
+ .offset = (uint32_t)offsetof(FSTPBWriteBatch__storage_, batchId),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeInt32,
+ },
+ {
+ .name = "writesArray",
+ .dataTypeSpecific.className = GPBStringifySymbol(GCFSWrite),
+ .number = FSTPBWriteBatch_FieldNumber_WritesArray,
+ .hasIndex = GPBNoHasBit,
+ .offset = (uint32_t)offsetof(FSTPBWriteBatch__storage_, writesArray),
+ .flags = GPBFieldRepeated,
+ .dataType = GPBDataTypeMessage,
+ },
+ {
+ .name = "localWriteTime",
+ .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp),
+ .number = FSTPBWriteBatch_FieldNumber_LocalWriteTime,
+ .hasIndex = 1,
+ .offset = (uint32_t)offsetof(FSTPBWriteBatch__storage_, localWriteTime),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeMessage,
+ },
+ };
+ GPBDescriptor *localDescriptor =
+ [GPBDescriptor allocDescriptorForClass:[FSTPBWriteBatch class]
+ rootClass:[FSTPBMutationRoot class]
+ file:FSTPBMutationRoot_FileDescriptor()
+ fields:fields
+ fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
+ storageSize:sizeof(FSTPBWriteBatch__storage_)
+ flags:GPBDescriptorInitializationFlag_None];
+ NSAssert(descriptor == nil, @"Startup recursed!");
+ descriptor = localDescriptor;
+ }
+ return descriptor;
+}
+
+@end
+
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)
diff --git a/Firestore/Protos/objc/firestore/local/Target.pbobjc.h b/Firestore/Protos/objc/firestore/local/Target.pbobjc.h
new file mode 100644
index 0000000..d8bf49c
--- /dev/null
+++ b/Firestore/Protos/objc/firestore/local/Target.pbobjc.h
@@ -0,0 +1,208 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: firestore/local/target.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBProtocolBuffers.h>
+#else
+ #import "GPBProtocolBuffers.h"
+#endif
+
+#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
+#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
+#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+CF_EXTERN_C_BEGIN
+
+@class GCFSTarget_DocumentsTarget;
+@class GCFSTarget_QueryTarget;
+@class GPBTimestamp;
+
+NS_ASSUME_NONNULL_BEGIN
+
+#pragma mark - FSTPBTargetRoot
+
+/**
+ * Exposes the extension registry for this file.
+ *
+ * The base class provides:
+ * @code
+ * + (GPBExtensionRegistry *)extensionRegistry;
+ * @endcode
+ * which is a @c GPBExtensionRegistry that includes all the extensions defined by
+ * this file and all files that it depends on.
+ **/
+@interface FSTPBTargetRoot : GPBRootObject
+@end
+
+#pragma mark - FSTPBTarget
+
+typedef GPB_ENUM(FSTPBTarget_FieldNumber) {
+ FSTPBTarget_FieldNumber_TargetId = 1,
+ FSTPBTarget_FieldNumber_SnapshotVersion = 2,
+ FSTPBTarget_FieldNumber_ResumeToken = 3,
+ FSTPBTarget_FieldNumber_LastListenSequenceNumber = 4,
+ FSTPBTarget_FieldNumber_Query = 5,
+ FSTPBTarget_FieldNumber_Documents = 6,
+};
+
+typedef GPB_ENUM(FSTPBTarget_TargetType_OneOfCase) {
+ FSTPBTarget_TargetType_OneOfCase_GPBUnsetOneOfCase = 0,
+ FSTPBTarget_TargetType_OneOfCase_Query = 5,
+ FSTPBTarget_TargetType_OneOfCase_Documents = 6,
+};
+
+/**
+ * A Target is a long-lived data structure representing a resumable listen on a
+ * particular user query. While the query describes what to listen to, the
+ * Target records data about when the results were last updated and enough
+ * information to be able to resume listening later.
+ **/
+@interface FSTPBTarget : GPBMessage
+
+/**
+ * An auto-generated sequential numeric identifier for the target. This
+ * serves as the identity of the target, and once assigned never changes.
+ **/
+@property(nonatomic, readwrite) int32_t targetId;
+
+/**
+ * The last snapshot version received from the Watch Service for this target.
+ *
+ * This is the same value as TargetChange.read_time
+ **/
+@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *snapshotVersion;
+/** Test to see if @c snapshotVersion has been set. */
+@property(nonatomic, readwrite) BOOL hasSnapshotVersion;
+
+/**
+ * An opaque, server-assigned token that allows watching a query to be
+ * resumed after disconnecting without retransmitting all the data that
+ * matches the query. The resume token essentially identifies a point in
+ * time from which the server should resume sending results.
+ *
+ * This is related to the snapshot_version in that the resume_token
+ * effectively also encodes that value, but the resume_token is opaque and
+ * sometimes encodes additional information.
+ *
+ * A consequence of this is that the resume_token should be used when asking
+ * the server to reason about where this client is in the watch stream, but
+ * the client should use the snapshot_version for its own purposes.
+ *
+ * This is the same value as TargetChange.resume_token
+ **/
+@property(nonatomic, readwrite, copy, null_resettable) NSData *resumeToken;
+
+/**
+ * A sequence number representing the last time this query was listened to,
+ * used for garbage collection purposes.
+ *
+ * Conventionally this would be a timestamp value, but device-local clocks
+ * are unreliable and they must be able to create new listens even while
+ * disconnected. Instead this should be a monotonically increasing number
+ * that's incremented on each listen call.
+ *
+ * This is different from the target_id since the target_id is an immutable
+ * identifier assigned to the Target on first use while
+ * last_listen_sequence_number is updated every time the query is listened
+ * to.
+ **/
+@property(nonatomic, readwrite) int64_t lastListenSequenceNumber;
+
+/** The server-side type of target to listen to. */
+@property(nonatomic, readonly) FSTPBTarget_TargetType_OneOfCase targetTypeOneOfCase;
+
+/** A target specified by a query. */
+@property(nonatomic, readwrite, strong, null_resettable) GCFSTarget_QueryTarget *query;
+
+/** A target specified by a set of document names. */
+@property(nonatomic, readwrite, strong, null_resettable) GCFSTarget_DocumentsTarget *documents;
+
+@end
+
+/**
+ * Clears whatever value was set for the oneof 'targetType'.
+ **/
+void FSTPBTarget_ClearTargetTypeOneOfCase(FSTPBTarget *message);
+
+#pragma mark - FSTPBTargetGlobal
+
+typedef GPB_ENUM(FSTPBTargetGlobal_FieldNumber) {
+ FSTPBTargetGlobal_FieldNumber_HighestTargetId = 1,
+ FSTPBTargetGlobal_FieldNumber_HighestListenSequenceNumber = 2,
+ FSTPBTargetGlobal_FieldNumber_LastRemoteSnapshotVersion = 3,
+};
+
+/**
+ * Global state tracked across all Targets, tracked separately to avoid the
+ * need for extra indexes.
+ **/
+@interface FSTPBTargetGlobal : GPBMessage
+
+/**
+ * The highest numbered target id across all Targets.
+ *
+ * See Target.target_id.
+ **/
+@property(nonatomic, readwrite) int32_t highestTargetId;
+
+/**
+ * The highest numbered last_listen_sequence_number across all Targets.
+ *
+ * See Target.last_listen_sequence_number.
+ **/
+@property(nonatomic, readwrite) int64_t highestListenSequenceNumber;
+
+/**
+ * A global snapshot version representing the last consistent snapshot we
+ * received from the backend. This is monotonically increasing and any
+ * snapshots received from the backend prior to this version (e.g. for
+ * targets resumed with a resume_token) should be suppressed (buffered) until
+ * the backend has caught up to this snapshot_version again. This prevents
+ * our cache from ever going backwards in time.
+ *
+ * This is updated whenever our we get a TargetChange with a read_time and
+ * empty target_ids.
+ **/
+@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *lastRemoteSnapshotVersion;
+/** Test to see if @c lastRemoteSnapshotVersion has been set. */
+@property(nonatomic, readwrite) BOOL hasLastRemoteSnapshotVersion;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+CF_EXTERN_C_END
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)
diff --git a/Firestore/Protos/objc/firestore/local/Target.pbobjc.m b/Firestore/Protos/objc/firestore/local/Target.pbobjc.m
new file mode 100644
index 0000000..6f6ccf2
--- /dev/null
+++ b/Firestore/Protos/objc/firestore/local/Target.pbobjc.m
@@ -0,0 +1,247 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: firestore/local/target.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
+#else
+ #import "GPBProtocolBuffers_RuntimeSupport.h"
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/Timestamp.pbobjc.h>
+#else
+ #import "Timestamp.pbobjc.h"
+#endif
+
+ #import "Target.pbobjc.h"
+ #import "Firestore.pbobjc.h"
+ #import "Annotations.pbobjc.h"
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic ignored "-Wdirect-ivar-access"
+
+#pragma mark - FSTPBTargetRoot
+
+@implementation FSTPBTargetRoot
+
+
+@end
+
+#pragma mark - FSTPBTargetRoot_FileDescriptor
+
+static GPBFileDescriptor *FSTPBTargetRoot_FileDescriptor(void) {
+ // This is called by +initialize so there is no need to worry
+ // about thread safety of the singleton.
+ static GPBFileDescriptor *descriptor = NULL;
+ if (!descriptor) {
+ GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
+ descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"firestore.client"
+ objcPrefix:@"FSTPB"
+ syntax:GPBFileSyntaxProto3];
+ }
+ return descriptor;
+}
+
+#pragma mark - FSTPBTarget
+
+@implementation FSTPBTarget
+
+@dynamic targetTypeOneOfCase;
+@dynamic targetId;
+@dynamic hasSnapshotVersion, snapshotVersion;
+@dynamic resumeToken;
+@dynamic lastListenSequenceNumber;
+@dynamic query;
+@dynamic documents;
+
+typedef struct FSTPBTarget__storage_ {
+ uint32_t _has_storage_[2];
+ int32_t targetId;
+ GPBTimestamp *snapshotVersion;
+ NSData *resumeToken;
+ GCFSTarget_QueryTarget *query;
+ GCFSTarget_DocumentsTarget *documents;
+ int64_t lastListenSequenceNumber;
+} FSTPBTarget__storage_;
+
+// This method is threadsafe because it is initially called
+// in +initialize for each subclass.
++ (GPBDescriptor *)descriptor {
+ static GPBDescriptor *descriptor = nil;
+ if (!descriptor) {
+ static GPBMessageFieldDescription fields[] = {
+ {
+ .name = "targetId",
+ .dataTypeSpecific.className = NULL,
+ .number = FSTPBTarget_FieldNumber_TargetId,
+ .hasIndex = 0,
+ .offset = (uint32_t)offsetof(FSTPBTarget__storage_, targetId),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeInt32,
+ },
+ {
+ .name = "snapshotVersion",
+ .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp),
+ .number = FSTPBTarget_FieldNumber_SnapshotVersion,
+ .hasIndex = 1,
+ .offset = (uint32_t)offsetof(FSTPBTarget__storage_, snapshotVersion),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeMessage,
+ },
+ {
+ .name = "resumeToken",
+ .dataTypeSpecific.className = NULL,
+ .number = FSTPBTarget_FieldNumber_ResumeToken,
+ .hasIndex = 2,
+ .offset = (uint32_t)offsetof(FSTPBTarget__storage_, resumeToken),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeBytes,
+ },
+ {
+ .name = "lastListenSequenceNumber",
+ .dataTypeSpecific.className = NULL,
+ .number = FSTPBTarget_FieldNumber_LastListenSequenceNumber,
+ .hasIndex = 3,
+ .offset = (uint32_t)offsetof(FSTPBTarget__storage_, lastListenSequenceNumber),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeInt64,
+ },
+ {
+ .name = "query",
+ .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget_QueryTarget),
+ .number = FSTPBTarget_FieldNumber_Query,
+ .hasIndex = -1,
+ .offset = (uint32_t)offsetof(FSTPBTarget__storage_, query),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeMessage,
+ },
+ {
+ .name = "documents",
+ .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget_DocumentsTarget),
+ .number = FSTPBTarget_FieldNumber_Documents,
+ .hasIndex = -1,
+ .offset = (uint32_t)offsetof(FSTPBTarget__storage_, documents),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeMessage,
+ },
+ };
+ GPBDescriptor *localDescriptor =
+ [GPBDescriptor allocDescriptorForClass:[FSTPBTarget class]
+ rootClass:[FSTPBTargetRoot class]
+ file:FSTPBTargetRoot_FileDescriptor()
+ fields:fields
+ fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
+ storageSize:sizeof(FSTPBTarget__storage_)
+ flags:GPBDescriptorInitializationFlag_None];
+ static const char *oneofs[] = {
+ "targetType",
+ };
+ [localDescriptor setupOneofs:oneofs
+ count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
+ firstHasIndex:-1];
+ NSAssert(descriptor == nil, @"Startup recursed!");
+ descriptor = localDescriptor;
+ }
+ return descriptor;
+}
+
+@end
+
+void FSTPBTarget_ClearTargetTypeOneOfCase(FSTPBTarget *message) {
+ GPBDescriptor *descriptor = [message descriptor];
+ GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
+ GPBMaybeClearOneof(message, oneof, -1, 0);
+}
+#pragma mark - FSTPBTargetGlobal
+
+@implementation FSTPBTargetGlobal
+
+@dynamic highestTargetId;
+@dynamic highestListenSequenceNumber;
+@dynamic hasLastRemoteSnapshotVersion, lastRemoteSnapshotVersion;
+
+typedef struct FSTPBTargetGlobal__storage_ {
+ uint32_t _has_storage_[1];
+ int32_t highestTargetId;
+ GPBTimestamp *lastRemoteSnapshotVersion;
+ int64_t highestListenSequenceNumber;
+} FSTPBTargetGlobal__storage_;
+
+// This method is threadsafe because it is initially called
+// in +initialize for each subclass.
++ (GPBDescriptor *)descriptor {
+ static GPBDescriptor *descriptor = nil;
+ if (!descriptor) {
+ static GPBMessageFieldDescription fields[] = {
+ {
+ .name = "highestTargetId",
+ .dataTypeSpecific.className = NULL,
+ .number = FSTPBTargetGlobal_FieldNumber_HighestTargetId,
+ .hasIndex = 0,
+ .offset = (uint32_t)offsetof(FSTPBTargetGlobal__storage_, highestTargetId),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeInt32,
+ },
+ {
+ .name = "highestListenSequenceNumber",
+ .dataTypeSpecific.className = NULL,
+ .number = FSTPBTargetGlobal_FieldNumber_HighestListenSequenceNumber,
+ .hasIndex = 1,
+ .offset = (uint32_t)offsetof(FSTPBTargetGlobal__storage_, highestListenSequenceNumber),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeInt64,
+ },
+ {
+ .name = "lastRemoteSnapshotVersion",
+ .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp),
+ .number = FSTPBTargetGlobal_FieldNumber_LastRemoteSnapshotVersion,
+ .hasIndex = 2,
+ .offset = (uint32_t)offsetof(FSTPBTargetGlobal__storage_, lastRemoteSnapshotVersion),
+ .flags = GPBFieldOptional,
+ .dataType = GPBDataTypeMessage,
+ },
+ };
+ GPBDescriptor *localDescriptor =
+ [GPBDescriptor allocDescriptorForClass:[FSTPBTargetGlobal class]
+ rootClass:[FSTPBTargetRoot class]
+ file:FSTPBTargetRoot_FileDescriptor()
+ fields:fields
+ fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
+ storageSize:sizeof(FSTPBTargetGlobal__storage_)
+ flags:GPBDescriptorInitializationFlag_None];
+ NSAssert(descriptor == nil, @"Startup recursed!");
+ descriptor = localDescriptor;
+ }
+ return descriptor;
+}
+
+@end
+
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)