diff options
Diffstat (limited to 'Firestore/Protos/objc/google/firestore/v1beta1')
12 files changed, 7779 insertions, 0 deletions
diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.h new file mode 100644 index 0000000..6215e82 --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.h @@ -0,0 +1,223 @@ +/* + * 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: google/firestore/v1beta1/common.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 GCFSTransactionOptions_ReadOnly; +@class GCFSTransactionOptions_ReadWrite; +@class GPBTimestamp; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GCFSCommonRoot + +/** + * 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 GCFSCommonRoot : GPBRootObject +@end + +#pragma mark - GCFSDocumentMask + +typedef GPB_ENUM(GCFSDocumentMask_FieldNumber) { + GCFSDocumentMask_FieldNumber_FieldPathsArray = 1, +}; + +/** + * A set of field paths on a document. + * Used to restrict a get or update operation on a document to a subset of its + * fields. + * This is different from standard field masks, as this is always scoped to a + * [Document][google.firestore.v1beta1.Document], and takes in account the dynamic nature of [Value][google.firestore.v1beta1.Value]. + **/ +@interface GCFSDocumentMask : GPBMessage + +/** + * The list of field paths in the mask. See [Document.fields][google.firestore.v1beta1.Document.fields] for a field + * path syntax reference. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *fieldPathsArray; +/** The number of items in @c fieldPathsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger fieldPathsArray_Count; + +@end + +#pragma mark - GCFSPrecondition + +typedef GPB_ENUM(GCFSPrecondition_FieldNumber) { + GCFSPrecondition_FieldNumber_Exists = 1, + GCFSPrecondition_FieldNumber_UpdateTime = 2, +}; + +typedef GPB_ENUM(GCFSPrecondition_ConditionType_OneOfCase) { + GCFSPrecondition_ConditionType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSPrecondition_ConditionType_OneOfCase_Exists = 1, + GCFSPrecondition_ConditionType_OneOfCase_UpdateTime = 2, +}; + +/** + * A precondition on a document, used for conditional operations. + **/ +@interface GCFSPrecondition : GPBMessage + +/** The type of precondition. */ +@property(nonatomic, readonly) GCFSPrecondition_ConditionType_OneOfCase conditionTypeOneOfCase; + +/** + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + **/ +@property(nonatomic, readwrite) BOOL exists; + +/** + * When set, the target document must exist and have been last updated at + * that time. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *updateTime; + +@end + +/** + * Clears whatever value was set for the oneof 'conditionType'. + **/ +void GCFSPrecondition_ClearConditionTypeOneOfCase(GCFSPrecondition *message); + +#pragma mark - GCFSTransactionOptions + +typedef GPB_ENUM(GCFSTransactionOptions_FieldNumber) { + GCFSTransactionOptions_FieldNumber_ReadOnly = 2, + GCFSTransactionOptions_FieldNumber_ReadWrite = 3, +}; + +typedef GPB_ENUM(GCFSTransactionOptions_Mode_OneOfCase) { + GCFSTransactionOptions_Mode_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSTransactionOptions_Mode_OneOfCase_ReadOnly = 2, + GCFSTransactionOptions_Mode_OneOfCase_ReadWrite = 3, +}; + +/** + * Options for creating a new transaction. + **/ +@interface GCFSTransactionOptions : GPBMessage + +/** The mode of the transaction. */ +@property(nonatomic, readonly) GCFSTransactionOptions_Mode_OneOfCase modeOneOfCase; + +/** The transaction can only be used for read operations. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions_ReadOnly *readOnly; + +/** The transaction can be used for both read and write operations. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions_ReadWrite *readWrite; + +@end + +/** + * Clears whatever value was set for the oneof 'mode'. + **/ +void GCFSTransactionOptions_ClearModeOneOfCase(GCFSTransactionOptions *message); + +#pragma mark - GCFSTransactionOptions_ReadWrite + +typedef GPB_ENUM(GCFSTransactionOptions_ReadWrite_FieldNumber) { + GCFSTransactionOptions_ReadWrite_FieldNumber_RetryTransaction = 1, +}; + +/** + * Options for a transaction that can be used to read and write documents. + **/ +@interface GCFSTransactionOptions_ReadWrite : GPBMessage + +/** An optional transaction to retry. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *retryTransaction; + +@end + +#pragma mark - GCFSTransactionOptions_ReadOnly + +typedef GPB_ENUM(GCFSTransactionOptions_ReadOnly_FieldNumber) { + GCFSTransactionOptions_ReadOnly_FieldNumber_ReadTime = 2, +}; + +typedef GPB_ENUM(GCFSTransactionOptions_ReadOnly_ConsistencySelector_OneOfCase) { + GCFSTransactionOptions_ReadOnly_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSTransactionOptions_ReadOnly_ConsistencySelector_OneOfCase_ReadTime = 2, +}; + +/** + * Options for a transaction that can only be used to read documents. + **/ +@interface GCFSTransactionOptions_ReadOnly : GPBMessage + +/** + * The consistency mode for this transaction. If not set, defaults to strong + * consistency. + **/ +@property(nonatomic, readonly) GCFSTransactionOptions_ReadOnly_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; + +/** + * Reads documents at the given time. + * This may not be older than 60 seconds. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; + +@end + +/** + * Clears whatever value was set for the oneof 'consistencySelector'. + **/ +void GCFSTransactionOptions_ReadOnly_ClearConsistencySelectorOneOfCase(GCFSTransactionOptions_ReadOnly *message); + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.m b/Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.m new file mode 100644 index 0000000..118f56e --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.m @@ -0,0 +1,345 @@ +/* + * 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: google/firestore/v1beta1/common.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 "Common.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 - GCFSCommonRoot + +@implementation GCFSCommonRoot + + +@end + +#pragma mark - GCFSCommonRoot_FileDescriptor + +static GPBFileDescriptor *GCFSCommonRoot_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:@"google.firestore.v1beta1" + objcPrefix:@"GCFS" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GCFSDocumentMask + +@implementation GCFSDocumentMask + +@dynamic fieldPathsArray, fieldPathsArray_Count; + +typedef struct GCFSDocumentMask__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *fieldPathsArray; +} GCFSDocumentMask__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 = "fieldPathsArray", + .dataTypeSpecific.className = NULL, + .number = GCFSDocumentMask_FieldNumber_FieldPathsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSDocumentMask__storage_, fieldPathsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSDocumentMask class] + rootClass:[GCFSCommonRoot class] + file:GCFSCommonRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSDocumentMask__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSPrecondition + +@implementation GCFSPrecondition + +@dynamic conditionTypeOneOfCase; +@dynamic exists; +@dynamic updateTime; + +typedef struct GCFSPrecondition__storage_ { + uint32_t _has_storage_[2]; + GPBTimestamp *updateTime; +} GCFSPrecondition__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 = "exists", + .dataTypeSpecific.className = NULL, + .number = GCFSPrecondition_FieldNumber_Exists, + .hasIndex = -1, + .offset = 0, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + { + .name = "updateTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSPrecondition_FieldNumber_UpdateTime, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSPrecondition__storage_, updateTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSPrecondition class] + rootClass:[GCFSCommonRoot class] + file:GCFSCommonRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSPrecondition__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "conditionType", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSPrecondition_ClearConditionTypeOneOfCase(GCFSPrecondition *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSTransactionOptions + +@implementation GCFSTransactionOptions + +@dynamic modeOneOfCase; +@dynamic readOnly; +@dynamic readWrite; + +typedef struct GCFSTransactionOptions__storage_ { + uint32_t _has_storage_[2]; + GCFSTransactionOptions_ReadOnly *readOnly; + GCFSTransactionOptions_ReadWrite *readWrite; +} GCFSTransactionOptions__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 = "readOnly", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions_ReadOnly), + .number = GCFSTransactionOptions_FieldNumber_ReadOnly, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSTransactionOptions__storage_, readOnly), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "readWrite", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions_ReadWrite), + .number = GCFSTransactionOptions_FieldNumber_ReadWrite, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSTransactionOptions__storage_, readWrite), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSTransactionOptions class] + rootClass:[GCFSCommonRoot class] + file:GCFSCommonRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSTransactionOptions__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "mode", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSTransactionOptions_ClearModeOneOfCase(GCFSTransactionOptions *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSTransactionOptions_ReadWrite + +@implementation GCFSTransactionOptions_ReadWrite + +@dynamic retryTransaction; + +typedef struct GCFSTransactionOptions_ReadWrite__storage_ { + uint32_t _has_storage_[1]; + NSData *retryTransaction; +} GCFSTransactionOptions_ReadWrite__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 = "retryTransaction", + .dataTypeSpecific.className = NULL, + .number = GCFSTransactionOptions_ReadWrite_FieldNumber_RetryTransaction, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSTransactionOptions_ReadWrite__storage_, retryTransaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSTransactionOptions_ReadWrite class] + rootClass:[GCFSCommonRoot class] + file:GCFSCommonRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSTransactionOptions_ReadWrite__storage_) + flags:GPBDescriptorInitializationFlag_None]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSTransactionOptions)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSTransactionOptions_ReadOnly + +@implementation GCFSTransactionOptions_ReadOnly + +@dynamic consistencySelectorOneOfCase; +@dynamic readTime; + +typedef struct GCFSTransactionOptions_ReadOnly__storage_ { + uint32_t _has_storage_[2]; + GPBTimestamp *readTime; +} GCFSTransactionOptions_ReadOnly__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 = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSTransactionOptions_ReadOnly_FieldNumber_ReadTime, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSTransactionOptions_ReadOnly__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSTransactionOptions_ReadOnly class] + rootClass:[GCFSCommonRoot class] + file:GCFSCommonRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSTransactionOptions_ReadOnly__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "consistencySelector", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSTransactionOptions)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSTransactionOptions_ReadOnly_ClearConsistencySelectorOneOfCase(GCFSTransactionOptions_ReadOnly *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/google/firestore/v1beta1/Document.pbobjc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h new file mode 100644 index 0000000..3c5bfb1 --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h @@ -0,0 +1,309 @@ +/* + * 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: google/firestore/v1beta1/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 GCFSArrayValue; +@class GCFSMapValue; +@class GCFSValue; +@class GPBTimestamp; +@class GTPLatLng; +GPB_ENUM_FWD_DECLARE(GPBNullValue); + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GCFSDocumentRoot + +/** + * 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 GCFSDocumentRoot : GPBRootObject +@end + +#pragma mark - GCFSDocument + +typedef GPB_ENUM(GCFSDocument_FieldNumber) { + GCFSDocument_FieldNumber_Name = 1, + GCFSDocument_FieldNumber_Fields = 2, + GCFSDocument_FieldNumber_CreateTime = 3, + GCFSDocument_FieldNumber_UpdateTime = 4, +}; + +/** + * A Firestore document. + * + * Must not exceed 1 MiB - 4 bytes. + **/ +@interface GCFSDocument : GPBMessage + +/** + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** + * The document's fields. + * + * The map keys represent field names. + * + * A simple field name contains only characters `a` to `z`, `A` to `Z`, + * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `foo_bar_17`. + * + * Field names matching the regular expression `__.*__` are reserved. Reserved + * field names are forbidden except in certain documented contexts. The map + * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be + * empty. + * + * Field paths may be used in other contexts to refer to structured fields + * defined here. For `map_value`, the field path is represented by the simple + * or quoted field names of the containing fields, delimited by `.`. For + * example, the structured field + * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be + * represented by the field path `foo.x&y`. + * + * Within a field path, a quoted field name starts and ends with `` ` `` and + * may contain any character. Some characters, including `` ` ``, must be + * escaped using a `\\`. For example, `` `x&y` `` represents `x&y` and + * `` `bak\\`tik` `` represents `` bak`tik ``. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary<NSString*, GCFSValue*> *fields; +/** The number of items in @c fields without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger fields_Count; + +/** + * Output only. The time at which the document was created. + * + * This value increases monotonically when a document is deleted then + * recreated. It can also be compared to values from other documents and + * the `read_time` of a query. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *createTime; +/** Test to see if @c createTime has been set. */ +@property(nonatomic, readwrite) BOOL hasCreateTime; + +/** + * Output only. The time at which the document was last changed. + * + * This value is initally set to the `create_time` then increases + * monotonically with each change to the document. It can also be + * compared to values from other documents and the `read_time` of a query. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *updateTime; +/** Test to see if @c updateTime has been set. */ +@property(nonatomic, readwrite) BOOL hasUpdateTime; + +@end + +#pragma mark - GCFSValue + +typedef GPB_ENUM(GCFSValue_FieldNumber) { + GCFSValue_FieldNumber_BooleanValue = 1, + GCFSValue_FieldNumber_IntegerValue = 2, + GCFSValue_FieldNumber_DoubleValue = 3, + GCFSValue_FieldNumber_ReferenceValue = 5, + GCFSValue_FieldNumber_MapValue = 6, + GCFSValue_FieldNumber_GeoPointValue = 8, + GCFSValue_FieldNumber_ArrayValue = 9, + GCFSValue_FieldNumber_TimestampValue = 10, + GCFSValue_FieldNumber_NullValue = 11, + GCFSValue_FieldNumber_StringValue = 17, + GCFSValue_FieldNumber_BytesValue = 18, +}; + +typedef GPB_ENUM(GCFSValue_ValueType_OneOfCase) { + GCFSValue_ValueType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSValue_ValueType_OneOfCase_NullValue = 11, + GCFSValue_ValueType_OneOfCase_BooleanValue = 1, + GCFSValue_ValueType_OneOfCase_IntegerValue = 2, + GCFSValue_ValueType_OneOfCase_DoubleValue = 3, + GCFSValue_ValueType_OneOfCase_TimestampValue = 10, + GCFSValue_ValueType_OneOfCase_StringValue = 17, + GCFSValue_ValueType_OneOfCase_BytesValue = 18, + GCFSValue_ValueType_OneOfCase_ReferenceValue = 5, + GCFSValue_ValueType_OneOfCase_GeoPointValue = 8, + GCFSValue_ValueType_OneOfCase_ArrayValue = 9, + GCFSValue_ValueType_OneOfCase_MapValue = 6, +}; + +/** + * A message that can hold any of the supported value types. + **/ +@interface GCFSValue : GPBMessage + +/** Must have a value set. */ +@property(nonatomic, readonly) GCFSValue_ValueType_OneOfCase valueTypeOneOfCase; + +/** A null value. */ +@property(nonatomic, readwrite) enum GPBNullValue nullValue; + +/** A boolean value. */ +@property(nonatomic, readwrite) BOOL booleanValue; + +/** An integer value. */ +@property(nonatomic, readwrite) int64_t integerValue; + +/** A double value. */ +@property(nonatomic, readwrite) double doubleValue; + +/** + * A timestamp value. + * + * Precise only to microseconds. When stored, any additional precision is + * rounded down. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *timestampValue; + +/** + * A string value. + * + * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes of the UTF-8 representation are considered by + * queries. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *stringValue; + +/** + * A bytes value. + * + * Must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes are considered by queries. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *bytesValue; + +/** + * A reference to a document. For example: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *referenceValue; + +/** A geo point value representing a point on the surface of Earth. */ +@property(nonatomic, readwrite, strong, null_resettable) GTPLatLng *geoPointValue; + +/** + * An array value. + * + * Cannot contain another array value. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSArrayValue *arrayValue; + +/** A map value. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSMapValue *mapValue; + +@end + +/** + * Fetches the raw value of a @c GCFSValue's @c nullValue property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GCFSValue_NullValue_RawValue(GCFSValue *message); +/** + * Sets the raw value of an @c GCFSValue's @c nullValue property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGCFSValue_NullValue_RawValue(GCFSValue *message, int32_t value); + +/** + * Clears whatever value was set for the oneof 'valueType'. + **/ +void GCFSValue_ClearValueTypeOneOfCase(GCFSValue *message); + +#pragma mark - GCFSArrayValue + +typedef GPB_ENUM(GCFSArrayValue_FieldNumber) { + GCFSArrayValue_FieldNumber_ValuesArray = 1, +}; + +/** + * An array value. + **/ +@interface GCFSArrayValue : GPBMessage + +/** Values in the array. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSValue*> *valuesArray; +/** The number of items in @c valuesArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger valuesArray_Count; + +@end + +#pragma mark - GCFSMapValue + +typedef GPB_ENUM(GCFSMapValue_FieldNumber) { + GCFSMapValue_FieldNumber_Fields = 1, +}; + +/** + * A map value. + **/ +@interface GCFSMapValue : GPBMessage + +/** + * The map's fields. + * + * The map keys represent field names. Field names matching the regular + * expression `__.*__` are reserved. Reserved field names are forbidden except + * in certain documented contexts. The map keys, represented as UTF-8, must + * not exceed 1,500 bytes and cannot be empty. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary<NSString*, GCFSValue*> *fields; +/** The number of items in @c fields without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger fields_Count; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.m b/Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.m new file mode 100644 index 0000000..2c805c3 --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.m @@ -0,0 +1,412 @@ +/* + * 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: google/firestore/v1beta1/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/Struct.pbobjc.h> + #import <Protobuf/Timestamp.pbobjc.h> +#else + #import "Struct.pbobjc.h" + #import "Timestamp.pbobjc.h" +#endif + + #import "Document.pbobjc.h" + #import "Annotations.pbobjc.h" + #import "Latlng.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 - GCFSDocumentRoot + +@implementation GCFSDocumentRoot + + +@end + +#pragma mark - GCFSDocumentRoot_FileDescriptor + +static GPBFileDescriptor *GCFSDocumentRoot_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:@"google.firestore.v1beta1" + objcPrefix:@"GCFS" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GCFSDocument + +@implementation GCFSDocument + +@dynamic name; +@dynamic fields, fields_Count; +@dynamic hasCreateTime, createTime; +@dynamic hasUpdateTime, updateTime; + +typedef struct GCFSDocument__storage_ { + uint32_t _has_storage_[1]; + NSString *name; + NSMutableDictionary *fields; + GPBTimestamp *createTime; + GPBTimestamp *updateTime; +} GCFSDocument__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 = GCFSDocument_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSDocument__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "fields", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), + .number = GCFSDocument_FieldNumber_Fields, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSDocument__storage_, fields), + .flags = GPBFieldMapKeyString, + .dataType = GPBDataTypeMessage, + }, + { + .name = "createTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSDocument_FieldNumber_CreateTime, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSDocument__storage_, createTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "updateTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSDocument_FieldNumber_UpdateTime, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSDocument__storage_, updateTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSDocument class] + rootClass:[GCFSDocumentRoot class] + file:GCFSDocumentRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSDocument__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSValue + +@implementation GCFSValue + +@dynamic valueTypeOneOfCase; +@dynamic nullValue; +@dynamic booleanValue; +@dynamic integerValue; +@dynamic doubleValue; +@dynamic timestampValue; +@dynamic stringValue; +@dynamic bytesValue; +@dynamic referenceValue; +@dynamic geoPointValue; +@dynamic arrayValue; +@dynamic mapValue; + +typedef struct GCFSValue__storage_ { + uint32_t _has_storage_[2]; + GPBNullValue nullValue; + NSString *referenceValue; + GCFSMapValue *mapValue; + GTPLatLng *geoPointValue; + GCFSArrayValue *arrayValue; + GPBTimestamp *timestampValue; + NSString *stringValue; + NSData *bytesValue; + int64_t integerValue; + double doubleValue; +} GCFSValue__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 = "booleanValue", + .dataTypeSpecific.className = NULL, + .number = GCFSValue_FieldNumber_BooleanValue, + .hasIndex = -1, + .offset = 0, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + { + .name = "integerValue", + .dataTypeSpecific.className = NULL, + .number = GCFSValue_FieldNumber_IntegerValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, integerValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt64, + }, + { + .name = "doubleValue", + .dataTypeSpecific.className = NULL, + .number = GCFSValue_FieldNumber_DoubleValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, doubleValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeDouble, + }, + { + .name = "referenceValue", + .dataTypeSpecific.className = NULL, + .number = GCFSValue_FieldNumber_ReferenceValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, referenceValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "mapValue", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSMapValue), + .number = GCFSValue_FieldNumber_MapValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, mapValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "geoPointValue", + .dataTypeSpecific.className = GPBStringifySymbol(GTPLatLng), + .number = GCFSValue_FieldNumber_GeoPointValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, geoPointValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "arrayValue", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSArrayValue), + .number = GCFSValue_FieldNumber_ArrayValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, arrayValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "timestampValue", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSValue_FieldNumber_TimestampValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, timestampValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "nullValue", + .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor, + .number = GCFSValue_FieldNumber_NullValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, nullValue), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + { + .name = "stringValue", + .dataTypeSpecific.className = NULL, + .number = GCFSValue_FieldNumber_StringValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, stringValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "bytesValue", + .dataTypeSpecific.className = NULL, + .number = GCFSValue_FieldNumber_BytesValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSValue__storage_, bytesValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSValue class] + rootClass:[GCFSDocumentRoot class] + file:GCFSDocumentRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "valueType", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GCFSValue_NullValue_RawValue(GCFSValue *message) { + GPBDescriptor *descriptor = [GCFSValue descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSValue_FieldNumber_NullValue]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGCFSValue_NullValue_RawValue(GCFSValue *message, int32_t value) { + GPBDescriptor *descriptor = [GCFSValue descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSValue_FieldNumber_NullValue]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +void GCFSValue_ClearValueTypeOneOfCase(GCFSValue *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSArrayValue + +@implementation GCFSArrayValue + +@dynamic valuesArray, valuesArray_Count; + +typedef struct GCFSArrayValue__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *valuesArray; +} GCFSArrayValue__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 = "valuesArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), + .number = GCFSArrayValue_FieldNumber_ValuesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSArrayValue__storage_, valuesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSArrayValue class] + rootClass:[GCFSDocumentRoot class] + file:GCFSDocumentRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSArrayValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSMapValue + +@implementation GCFSMapValue + +@dynamic fields, fields_Count; + +typedef struct GCFSMapValue__storage_ { + uint32_t _has_storage_[1]; + NSMutableDictionary *fields; +} GCFSMapValue__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 = "fields", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), + .number = GCFSMapValue_FieldNumber_Fields, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSMapValue__storage_, fields), + .flags = GPBFieldMapKeyString, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSMapValue class] + rootClass:[GCFSDocumentRoot class] + file:GCFSDocumentRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSMapValue__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/google/firestore/v1beta1/Firestore.pbobjc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h new file mode 100644 index 0000000..0acd8c0 --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h @@ -0,0 +1,1342 @@ +/* + * 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: google/firestore/v1beta1/firestore.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 GCFSDocument; +@class GCFSDocumentChange; +@class GCFSDocumentDelete; +@class GCFSDocumentMask; +@class GCFSDocumentRemove; +@class GCFSExistenceFilter; +@class GCFSPrecondition; +@class GCFSStructuredQuery; +@class GCFSTarget; +@class GCFSTargetChange; +@class GCFSTarget_DocumentsTarget; +@class GCFSTarget_QueryTarget; +@class GCFSTransactionOptions; +@class GCFSWrite; +@class GCFSWriteResult; +@class GPBTimestamp; +@class RPCStatus; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - Enum GCFSTargetChange_TargetChangeType + +/** The type of change. */ +typedef GPB_ENUM(GCFSTargetChange_TargetChangeType) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GCFSTargetChange_TargetChangeType_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** No change has occurred. Used only to send an updated `resume_token`. */ + GCFSTargetChange_TargetChangeType_NoChange = 0, + + /** The targets have been added. */ + GCFSTargetChange_TargetChangeType_Add = 1, + + /** The targets have been removed. */ + GCFSTargetChange_TargetChangeType_Remove = 2, + + /** + * The targets reflect all changes committed before the targets were added + * to the stream. + * + * This will be sent after or with a `read_time` that is greater than or + * equal to the time at which the targets were added. + * + * Listeners can wait for this change if read-after-write semantics + * are desired. + **/ + GCFSTargetChange_TargetChangeType_Current = 3, + + /** + * The targets have been reset, and a new initial state for the targets + * will be returned in subsequent changes. + * + * After the initial state is complete, `CURRENT` will be returned even + * if the target was previously indicated to be `CURRENT`. + **/ + GCFSTargetChange_TargetChangeType_Reset = 4, +}; + +GPBEnumDescriptor *GCFSTargetChange_TargetChangeType_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GCFSTargetChange_TargetChangeType_IsValidValue(int32_t value); + +#pragma mark - GCFSFirestoreRoot + +/** + * 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 GCFSFirestoreRoot : GPBRootObject +@end + +#pragma mark - GCFSGetDocumentRequest + +typedef GPB_ENUM(GCFSGetDocumentRequest_FieldNumber) { + GCFSGetDocumentRequest_FieldNumber_Name = 1, + GCFSGetDocumentRequest_FieldNumber_Mask = 2, + GCFSGetDocumentRequest_FieldNumber_Transaction = 3, + GCFSGetDocumentRequest_FieldNumber_ReadTime = 5, +}; + +typedef GPB_ENUM(GCFSGetDocumentRequest_ConsistencySelector_OneOfCase) { + GCFSGetDocumentRequest_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSGetDocumentRequest_ConsistencySelector_OneOfCase_Transaction = 3, + GCFSGetDocumentRequest_ConsistencySelector_OneOfCase_ReadTime = 5, +}; + +/** + * The request for [Firestore.GetDocument][google.firestore.v1beta1.Firestore.GetDocument]. + **/ +@interface GCFSGetDocumentRequest : GPBMessage + +/** + * The resource name of the Document to get. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** + * The fields to return. If not set, returns all fields. + * + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; +/** Test to see if @c mask has been set. */ +@property(nonatomic, readwrite) BOOL hasMask; + +/** + * The consistency mode for this transaction. + * If not set, defaults to strong consistency. + **/ +@property(nonatomic, readonly) GCFSGetDocumentRequest_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; + +/** Reads the document in a transaction. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; + +/** + * Reads the version of the document at the given time. + * This may not be older than 60 seconds. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; + +@end + +/** + * Clears whatever value was set for the oneof 'consistencySelector'. + **/ +void GCFSGetDocumentRequest_ClearConsistencySelectorOneOfCase(GCFSGetDocumentRequest *message); + +#pragma mark - GCFSListDocumentsRequest + +typedef GPB_ENUM(GCFSListDocumentsRequest_FieldNumber) { + GCFSListDocumentsRequest_FieldNumber_Parent = 1, + GCFSListDocumentsRequest_FieldNumber_CollectionId = 2, + GCFSListDocumentsRequest_FieldNumber_PageSize = 3, + GCFSListDocumentsRequest_FieldNumber_PageToken = 4, + GCFSListDocumentsRequest_FieldNumber_OrderBy = 6, + GCFSListDocumentsRequest_FieldNumber_Mask = 7, + GCFSListDocumentsRequest_FieldNumber_Transaction = 8, + GCFSListDocumentsRequest_FieldNumber_ReadTime = 10, + GCFSListDocumentsRequest_FieldNumber_ShowMissing = 12, +}; + +typedef GPB_ENUM(GCFSListDocumentsRequest_ConsistencySelector_OneOfCase) { + GCFSListDocumentsRequest_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSListDocumentsRequest_ConsistencySelector_OneOfCase_Transaction = 8, + GCFSListDocumentsRequest_ConsistencySelector_OneOfCase_ReadTime = 10, +}; + +/** + * The request for [Firestore.ListDocuments][google.firestore.v1beta1.Firestore.ListDocuments]. + **/ +@interface GCFSListDocumentsRequest : GPBMessage + +/** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; + +/** + * The collection ID, relative to `parent`, to list. For example: `chatrooms` + * or `messages`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *collectionId; + +/** The maximum number of documents to return. */ +@property(nonatomic, readwrite) int32_t pageSize; + +/** The `next_page_token` value returned from a previous List request, if any. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *pageToken; + +/** The order to sort results by. For example: `priority desc, name`. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *orderBy; + +/** + * The fields to return. If not set, returns all fields. + * + * If a document has a field that is not present in this mask, that field + * will not be returned in the response. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; +/** Test to see if @c mask has been set. */ +@property(nonatomic, readwrite) BOOL hasMask; + +/** + * The consistency mode for this transaction. + * If not set, defaults to strong consistency. + **/ +@property(nonatomic, readonly) GCFSListDocumentsRequest_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; + +/** Reads documents in a transaction. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; + +/** + * Reads documents as they were at the given time. + * This may not be older than 60 seconds. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; + +/** + * If the list should show missing documents. A missing document is a + * document that does not exist but has sub-documents. These documents will + * be returned with a key but will not have fields, [Document.create_time][google.firestore.v1beta1.Document.create_time], + * or [Document.update_time][google.firestore.v1beta1.Document.update_time] set. + * + * Requests with `show_missing` may not specify `where` or + * `order_by`. + **/ +@property(nonatomic, readwrite) BOOL showMissing; + +@end + +/** + * Clears whatever value was set for the oneof 'consistencySelector'. + **/ +void GCFSListDocumentsRequest_ClearConsistencySelectorOneOfCase(GCFSListDocumentsRequest *message); + +#pragma mark - GCFSListDocumentsResponse + +typedef GPB_ENUM(GCFSListDocumentsResponse_FieldNumber) { + GCFSListDocumentsResponse_FieldNumber_DocumentsArray = 1, + GCFSListDocumentsResponse_FieldNumber_NextPageToken = 2, +}; + +/** + * The response for [Firestore.ListDocuments][google.firestore.v1beta1.Firestore.ListDocuments]. + **/ +@interface GCFSListDocumentsResponse : GPBMessage + +/** The Documents found. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSDocument*> *documentsArray; +/** The number of items in @c documentsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger documentsArray_Count; + +/** The next page token. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *nextPageToken; + +@end + +#pragma mark - GCFSCreateDocumentRequest + +typedef GPB_ENUM(GCFSCreateDocumentRequest_FieldNumber) { + GCFSCreateDocumentRequest_FieldNumber_Parent = 1, + GCFSCreateDocumentRequest_FieldNumber_CollectionId = 2, + GCFSCreateDocumentRequest_FieldNumber_DocumentId = 3, + GCFSCreateDocumentRequest_FieldNumber_Document = 4, + GCFSCreateDocumentRequest_FieldNumber_Mask = 5, +}; + +/** + * The request for [Firestore.CreateDocument][google.firestore.v1beta1.Firestore.CreateDocument]. + **/ +@interface GCFSCreateDocumentRequest : GPBMessage + +/** + * The parent resource. For example: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; + +/** The collection ID, relative to `parent`, to list. For example: `chatrooms`. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *collectionId; + +/** + * The client-assigned document ID to use for this document. + * + * Optional. If not specified, an ID will be assigned by the service. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *documentId; + +/** The document to create. `name` must not be set. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document; +/** Test to see if @c document has been set. */ +@property(nonatomic, readwrite) BOOL hasDocument; + +/** + * The fields to return. If not set, returns all fields. + * + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; +/** Test to see if @c mask has been set. */ +@property(nonatomic, readwrite) BOOL hasMask; + +@end + +#pragma mark - GCFSUpdateDocumentRequest + +typedef GPB_ENUM(GCFSUpdateDocumentRequest_FieldNumber) { + GCFSUpdateDocumentRequest_FieldNumber_Document = 1, + GCFSUpdateDocumentRequest_FieldNumber_UpdateMask = 2, + GCFSUpdateDocumentRequest_FieldNumber_Mask = 3, + GCFSUpdateDocumentRequest_FieldNumber_CurrentDocument = 4, +}; + +/** + * The request for [Firestore.UpdateDocument][google.firestore.v1beta1.Firestore.UpdateDocument]. + **/ +@interface GCFSUpdateDocumentRequest : GPBMessage + +/** + * The updated document. + * Creates the document if it does not already exist. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document; +/** Test to see if @c document has been set. */ +@property(nonatomic, readwrite) BOOL hasDocument; + +/** + * The fields to update. + * None of the field paths in the mask may contain a reserved name. + * + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *updateMask; +/** Test to see if @c updateMask has been set. */ +@property(nonatomic, readwrite) BOOL hasUpdateMask; + +/** + * The fields to return. If not set, returns all fields. + * + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; +/** Test to see if @c mask has been set. */ +@property(nonatomic, readwrite) BOOL hasMask; + +/** + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSPrecondition *currentDocument; +/** Test to see if @c currentDocument has been set. */ +@property(nonatomic, readwrite) BOOL hasCurrentDocument; + +@end + +#pragma mark - GCFSDeleteDocumentRequest + +typedef GPB_ENUM(GCFSDeleteDocumentRequest_FieldNumber) { + GCFSDeleteDocumentRequest_FieldNumber_Name = 1, + GCFSDeleteDocumentRequest_FieldNumber_CurrentDocument = 2, +}; + +/** + * The request for [Firestore.DeleteDocument][google.firestore.v1beta1.Firestore.DeleteDocument]. + **/ +@interface GCFSDeleteDocumentRequest : GPBMessage + +/** + * The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSPrecondition *currentDocument; +/** Test to see if @c currentDocument has been set. */ +@property(nonatomic, readwrite) BOOL hasCurrentDocument; + +@end + +#pragma mark - GCFSBatchGetDocumentsRequest + +typedef GPB_ENUM(GCFSBatchGetDocumentsRequest_FieldNumber) { + GCFSBatchGetDocumentsRequest_FieldNumber_Database = 1, + GCFSBatchGetDocumentsRequest_FieldNumber_DocumentsArray = 2, + GCFSBatchGetDocumentsRequest_FieldNumber_Mask = 3, + GCFSBatchGetDocumentsRequest_FieldNumber_Transaction = 4, + GCFSBatchGetDocumentsRequest_FieldNumber_NewTransaction = 5, + GCFSBatchGetDocumentsRequest_FieldNumber_ReadTime = 7, +}; + +typedef GPB_ENUM(GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase) { + GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase_Transaction = 4, + GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase_NewTransaction = 5, + GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase_ReadTime = 7, +}; + +/** + * The request for [Firestore.BatchGetDocuments][google.firestore.v1beta1.Firestore.BatchGetDocuments]. + **/ +@interface GCFSBatchGetDocumentsRequest : GPBMessage + +/** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *database; + +/** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of the + * given `database`. Duplicate names will be elided. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *documentsArray; +/** The number of items in @c documentsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger documentsArray_Count; + +/** + * The fields to return. If not set, returns all fields. + * + * If a document has a field that is not present in this mask, that field will + * not be returned in the response. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; +/** Test to see if @c mask has been set. */ +@property(nonatomic, readwrite) BOOL hasMask; + +/** + * The consistency mode for this transaction. + * If not set, defaults to strong consistency. + **/ +@property(nonatomic, readonly) GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; + +/** Reads documents in a transaction. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; + +/** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions *newTransaction NS_RETURNS_NOT_RETAINED; + +/** + * Reads documents as they were at the given time. + * This may not be older than 60 seconds. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; + +@end + +/** + * Clears whatever value was set for the oneof 'consistencySelector'. + **/ +void GCFSBatchGetDocumentsRequest_ClearConsistencySelectorOneOfCase(GCFSBatchGetDocumentsRequest *message); + +#pragma mark - GCFSBatchGetDocumentsResponse + +typedef GPB_ENUM(GCFSBatchGetDocumentsResponse_FieldNumber) { + GCFSBatchGetDocumentsResponse_FieldNumber_Found = 1, + GCFSBatchGetDocumentsResponse_FieldNumber_Missing = 2, + GCFSBatchGetDocumentsResponse_FieldNumber_Transaction = 3, + GCFSBatchGetDocumentsResponse_FieldNumber_ReadTime = 4, +}; + +typedef GPB_ENUM(GCFSBatchGetDocumentsResponse_Result_OneOfCase) { + GCFSBatchGetDocumentsResponse_Result_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSBatchGetDocumentsResponse_Result_OneOfCase_Found = 1, + GCFSBatchGetDocumentsResponse_Result_OneOfCase_Missing = 2, +}; + +/** + * The streamed response for [Firestore.BatchGetDocuments][google.firestore.v1beta1.Firestore.BatchGetDocuments]. + **/ +@interface GCFSBatchGetDocumentsResponse : GPBMessage + +/** + * A single result. + * This can be empty if the server is just returning a transaction. + **/ +@property(nonatomic, readonly) GCFSBatchGetDocumentsResponse_Result_OneOfCase resultOneOfCase; + +/** A document that was requested. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *found; + +/** + * A document name that was requested but does not exist. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *missing; + +/** + * The transaction that was started as part of this request. + * Will only be set in the first response, and only if + * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1beta1.BatchGetDocumentsRequest.new_transaction] was set in the request. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; + +/** + * The time at which the document was read. + * This may be monotically increasing, in this case the previous documents in + * the result stream are guaranteed not to have changed between their + * read_time and this one. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; +/** Test to see if @c readTime has been set. */ +@property(nonatomic, readwrite) BOOL hasReadTime; + +@end + +/** + * Clears whatever value was set for the oneof 'result'. + **/ +void GCFSBatchGetDocumentsResponse_ClearResultOneOfCase(GCFSBatchGetDocumentsResponse *message); + +#pragma mark - GCFSBeginTransactionRequest + +typedef GPB_ENUM(GCFSBeginTransactionRequest_FieldNumber) { + GCFSBeginTransactionRequest_FieldNumber_Database = 1, + GCFSBeginTransactionRequest_FieldNumber_Options = 2, +}; + +/** + * The request for [Firestore.BeginTransaction][google.firestore.v1beta1.Firestore.BeginTransaction]. + **/ +@interface GCFSBeginTransactionRequest : GPBMessage + +/** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *database; + +/** + * The options for the transaction. + * Defaults to a read-write transaction. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions *options; +/** Test to see if @c options has been set. */ +@property(nonatomic, readwrite) BOOL hasOptions; + +@end + +#pragma mark - GCFSBeginTransactionResponse + +typedef GPB_ENUM(GCFSBeginTransactionResponse_FieldNumber) { + GCFSBeginTransactionResponse_FieldNumber_Transaction = 1, +}; + +/** + * The response for [Firestore.BeginTransaction][google.firestore.v1beta1.Firestore.BeginTransaction]. + **/ +@interface GCFSBeginTransactionResponse : GPBMessage + +/** The transaction that was started. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; + +@end + +#pragma mark - GCFSCommitRequest + +typedef GPB_ENUM(GCFSCommitRequest_FieldNumber) { + GCFSCommitRequest_FieldNumber_Database = 1, + GCFSCommitRequest_FieldNumber_WritesArray = 2, + GCFSCommitRequest_FieldNumber_Transaction = 3, +}; + +/** + * The request for [Firestore.Commit][google.firestore.v1beta1.Firestore.Commit]. + **/ +@interface GCFSCommitRequest : GPBMessage + +/** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *database; + +/** + * The writes to apply. + * + * Always executed atomically and in order. + **/ +@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; + +/** + * If non-empty, applies all writes in this transaction, and commits it. + * Otherwise, applies the writes as if they were in their own transaction. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; + +@end + +#pragma mark - GCFSCommitResponse + +typedef GPB_ENUM(GCFSCommitResponse_FieldNumber) { + GCFSCommitResponse_FieldNumber_WriteResultsArray = 1, + GCFSCommitResponse_FieldNumber_CommitTime = 2, +}; + +/** + * The response for [Firestore.Commit][google.firestore.v1beta1.Firestore.Commit]. + **/ +@interface GCFSCommitResponse : GPBMessage + +/** + * The result of applying the writes. + * + * This i-th write result corresponds to the i-th write in the + * request. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSWriteResult*> *writeResultsArray; +/** The number of items in @c writeResultsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger writeResultsArray_Count; + +/** The time at which the commit occurred. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *commitTime; +/** Test to see if @c commitTime has been set. */ +@property(nonatomic, readwrite) BOOL hasCommitTime; + +@end + +#pragma mark - GCFSRollbackRequest + +typedef GPB_ENUM(GCFSRollbackRequest_FieldNumber) { + GCFSRollbackRequest_FieldNumber_Database = 1, + GCFSRollbackRequest_FieldNumber_Transaction = 2, +}; + +/** + * The request for [Firestore.Rollback][google.firestore.v1beta1.Firestore.Rollback]. + **/ +@interface GCFSRollbackRequest : GPBMessage + +/** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *database; + +/** The transaction to roll back. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; + +@end + +#pragma mark - GCFSRunQueryRequest + +typedef GPB_ENUM(GCFSRunQueryRequest_FieldNumber) { + GCFSRunQueryRequest_FieldNumber_Parent = 1, + GCFSRunQueryRequest_FieldNumber_StructuredQuery = 2, + GCFSRunQueryRequest_FieldNumber_Transaction = 5, + GCFSRunQueryRequest_FieldNumber_NewTransaction = 6, + GCFSRunQueryRequest_FieldNumber_ReadTime = 7, +}; + +typedef GPB_ENUM(GCFSRunQueryRequest_QueryType_OneOfCase) { + GCFSRunQueryRequest_QueryType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSRunQueryRequest_QueryType_OneOfCase_StructuredQuery = 2, +}; + +typedef GPB_ENUM(GCFSRunQueryRequest_ConsistencySelector_OneOfCase) { + GCFSRunQueryRequest_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSRunQueryRequest_ConsistencySelector_OneOfCase_Transaction = 5, + GCFSRunQueryRequest_ConsistencySelector_OneOfCase_NewTransaction = 6, + GCFSRunQueryRequest_ConsistencySelector_OneOfCase_ReadTime = 7, +}; + +/** + * The request for [Firestore.RunQuery][google.firestore.v1beta1.Firestore.RunQuery]. + **/ +@interface GCFSRunQueryRequest : GPBMessage + +/** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; + +/** The query to run. */ +@property(nonatomic, readonly) GCFSRunQueryRequest_QueryType_OneOfCase queryTypeOneOfCase; + +/** A structured query. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery *structuredQuery; + +/** + * The consistency mode for this transaction. + * If not set, defaults to strong consistency. + **/ +@property(nonatomic, readonly) GCFSRunQueryRequest_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; + +/** Reads documents in a transaction. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; + +/** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions *newTransaction NS_RETURNS_NOT_RETAINED; + +/** + * Reads documents as they were at the given time. + * This may not be older than 60 seconds. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; + +@end + +/** + * Clears whatever value was set for the oneof 'queryType'. + **/ +void GCFSRunQueryRequest_ClearQueryTypeOneOfCase(GCFSRunQueryRequest *message); +/** + * Clears whatever value was set for the oneof 'consistencySelector'. + **/ +void GCFSRunQueryRequest_ClearConsistencySelectorOneOfCase(GCFSRunQueryRequest *message); + +#pragma mark - GCFSRunQueryResponse + +typedef GPB_ENUM(GCFSRunQueryResponse_FieldNumber) { + GCFSRunQueryResponse_FieldNumber_Document = 1, + GCFSRunQueryResponse_FieldNumber_Transaction = 2, + GCFSRunQueryResponse_FieldNumber_ReadTime = 3, + GCFSRunQueryResponse_FieldNumber_SkippedResults = 4, +}; + +/** + * The response for [Firestore.RunQuery][google.firestore.v1beta1.Firestore.RunQuery]. + **/ +@interface GCFSRunQueryResponse : GPBMessage + +/** + * The transaction that was started as part of this request. + * Can only be set in the first response, and only if + * [RunQueryRequest.new_transaction][google.firestore.v1beta1.RunQueryRequest.new_transaction] was set in the request. + * If set, no other fields will be set in this response. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; + +/** + * A query result. + * Not set when reporting partial progress. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document; +/** Test to see if @c document has been set. */ +@property(nonatomic, readwrite) BOOL hasDocument; + +/** + * The time at which the document was read. This may be monotonically + * increasing; in this case, the previous documents in the result stream are + * guaranteed not to have changed between their `read_time` and this one. + * + * If the query returns no results, a response with `read_time` and no + * `document` will be sent, and this represents the time at which the query + * was run. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; +/** Test to see if @c readTime has been set. */ +@property(nonatomic, readwrite) BOOL hasReadTime; + +/** + * The number of results that have been skipped due to an offset between + * the last response and the current response. + **/ +@property(nonatomic, readwrite) int32_t skippedResults; + +@end + +#pragma mark - GCFSWriteRequest + +typedef GPB_ENUM(GCFSWriteRequest_FieldNumber) { + GCFSWriteRequest_FieldNumber_Database = 1, + GCFSWriteRequest_FieldNumber_StreamId = 2, + GCFSWriteRequest_FieldNumber_WritesArray = 3, + GCFSWriteRequest_FieldNumber_StreamToken = 4, + GCFSWriteRequest_FieldNumber_Labels = 5, +}; + +/** + * The request for [Firestore.Write][google.firestore.v1beta1.Firestore.Write]. + * + * The first request creates a stream, or resumes an existing one from a token. + * + * When creating a new stream, the server replies with a response containing + * only an ID and a token, to use in the next request. + * + * When resuming a stream, the server first streams any responses later than the + * given token, then a response containing only an up-to-date token, to use in + * the next request. + **/ +@interface GCFSWriteRequest : GPBMessage + +/** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * This is only required in the first message. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *database; + +/** + * The ID of the write stream to resume. + * This may only be set in the first message. When left empty, a new write + * stream will be created. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *streamId; + +/** + * The writes to apply. + * + * Always executed atomically and in order. + * This must be empty on the first request. + * This may be empty on the last request. + * This must not be empty on all other requests. + **/ +@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; + +/** + * A stream token that was previously sent by the server. + * + * The client should set this field to the token from the most recent + * [WriteResponse][google.firestore.v1beta1.WriteResponse] it has received. This acknowledges that the client has + * received responses up to this token. After sending this token, earlier + * tokens may not be used anymore. + * + * The server may close the stream if there are too many unacknowledged + * responses. + * + * Leave this field unset when creating a new stream. To resume a stream at + * a specific point, set this field and the `stream_id` field. + * + * Leave this field unset when creating a new stream. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *streamToken; + +/** Labels associated with this write request. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary<NSString*, NSString*> *labels; +/** The number of items in @c labels without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger labels_Count; + +@end + +#pragma mark - GCFSWriteResponse + +typedef GPB_ENUM(GCFSWriteResponse_FieldNumber) { + GCFSWriteResponse_FieldNumber_StreamId = 1, + GCFSWriteResponse_FieldNumber_StreamToken = 2, + GCFSWriteResponse_FieldNumber_WriteResultsArray = 3, + GCFSWriteResponse_FieldNumber_CommitTime = 4, +}; + +/** + * The response for [Firestore.Write][google.firestore.v1beta1.Firestore.Write]. + **/ +@interface GCFSWriteResponse : GPBMessage + +/** + * The ID of the stream. + * Only set on the first message, when a new stream was created. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *streamId; + +/** + * A token that represents the position of this response in the stream. + * This can be used by a client to resume the stream at this point. + * + * This field is always set. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *streamToken; + +/** + * The result of applying the writes. + * + * This i-th write result corresponds to the i-th write in the + * request. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSWriteResult*> *writeResultsArray; +/** The number of items in @c writeResultsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger writeResultsArray_Count; + +/** The time at which the commit occurred. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *commitTime; +/** Test to see if @c commitTime has been set. */ +@property(nonatomic, readwrite) BOOL hasCommitTime; + +@end + +#pragma mark - GCFSListenRequest + +typedef GPB_ENUM(GCFSListenRequest_FieldNumber) { + GCFSListenRequest_FieldNumber_Database = 1, + GCFSListenRequest_FieldNumber_AddTarget = 2, + GCFSListenRequest_FieldNumber_RemoveTarget = 3, + GCFSListenRequest_FieldNumber_Labels = 4, +}; + +typedef GPB_ENUM(GCFSListenRequest_TargetChange_OneOfCase) { + GCFSListenRequest_TargetChange_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSListenRequest_TargetChange_OneOfCase_AddTarget = 2, + GCFSListenRequest_TargetChange_OneOfCase_RemoveTarget = 3, +}; + +/** + * A request for [Firestore.Listen][google.firestore.v1beta1.Firestore.Listen] + **/ +@interface GCFSListenRequest : GPBMessage + +/** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *database; + +/** The supported target changes. */ +@property(nonatomic, readonly) GCFSListenRequest_TargetChange_OneOfCase targetChangeOneOfCase; + +/** A target to add to this stream. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSTarget *addTarget; + +/** The ID of a target to remove from this stream. */ +@property(nonatomic, readwrite) int32_t removeTarget; + +/** Labels associated with this target change. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary<NSString*, NSString*> *labels; +/** The number of items in @c labels without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger labels_Count; + +@end + +/** + * Clears whatever value was set for the oneof 'targetChange'. + **/ +void GCFSListenRequest_ClearTargetChangeOneOfCase(GCFSListenRequest *message); + +#pragma mark - GCFSListenResponse + +typedef GPB_ENUM(GCFSListenResponse_FieldNumber) { + GCFSListenResponse_FieldNumber_TargetChange = 2, + GCFSListenResponse_FieldNumber_DocumentChange = 3, + GCFSListenResponse_FieldNumber_DocumentDelete = 4, + GCFSListenResponse_FieldNumber_Filter = 5, + GCFSListenResponse_FieldNumber_DocumentRemove = 6, +}; + +typedef GPB_ENUM(GCFSListenResponse_ResponseType_OneOfCase) { + GCFSListenResponse_ResponseType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSListenResponse_ResponseType_OneOfCase_TargetChange = 2, + GCFSListenResponse_ResponseType_OneOfCase_DocumentChange = 3, + GCFSListenResponse_ResponseType_OneOfCase_DocumentDelete = 4, + GCFSListenResponse_ResponseType_OneOfCase_DocumentRemove = 6, + GCFSListenResponse_ResponseType_OneOfCase_Filter = 5, +}; + +/** + * The response for [Firestore.Listen][google.firestore.v1beta1.Firestore.Listen]. + **/ +@interface GCFSListenResponse : GPBMessage + +/** The supported responses. */ +@property(nonatomic, readonly) GCFSListenResponse_ResponseType_OneOfCase responseTypeOneOfCase; + +/** Targets have changed. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSTargetChange *targetChange; + +/** A [Document][google.firestore.v1beta1.Document] has changed. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentChange *documentChange; + +/** A [Document][google.firestore.v1beta1.Document] has been deleted. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentDelete *documentDelete; + +/** + * A [Document][google.firestore.v1beta1.Document] has been removed from a target (because it is no longer + * relevant to that target). + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentRemove *documentRemove; + +/** + * A filter to apply to the set of documents previously returned for the + * given target. + * + * Returned when documents may have been removed from the given target, but + * the exact documents are unknown. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSExistenceFilter *filter; + +@end + +/** + * Clears whatever value was set for the oneof 'responseType'. + **/ +void GCFSListenResponse_ClearResponseTypeOneOfCase(GCFSListenResponse *message); + +#pragma mark - GCFSTarget + +typedef GPB_ENUM(GCFSTarget_FieldNumber) { + GCFSTarget_FieldNumber_Query = 2, + GCFSTarget_FieldNumber_Documents = 3, + GCFSTarget_FieldNumber_ResumeToken = 4, + GCFSTarget_FieldNumber_TargetId = 5, + GCFSTarget_FieldNumber_Once = 6, + GCFSTarget_FieldNumber_ReadTime = 11, +}; + +typedef GPB_ENUM(GCFSTarget_TargetType_OneOfCase) { + GCFSTarget_TargetType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSTarget_TargetType_OneOfCase_Query = 2, + GCFSTarget_TargetType_OneOfCase_Documents = 3, +}; + +typedef GPB_ENUM(GCFSTarget_ResumeType_OneOfCase) { + GCFSTarget_ResumeType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSTarget_ResumeType_OneOfCase_ResumeToken = 4, + GCFSTarget_ResumeType_OneOfCase_ReadTime = 11, +}; + +/** + * A specification of a set of documents to listen to. + **/ +@interface GCFSTarget : GPBMessage + +/** The type of target to listen to. */ +@property(nonatomic, readonly) GCFSTarget_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; + +/** + * When to start listening. + * + * If not specified, all matching Documents are returned before any + * subsequent changes. + **/ +@property(nonatomic, readonly) GCFSTarget_ResumeType_OneOfCase resumeTypeOneOfCase; + +/** + * A resume token from a prior [TargetChange][google.firestore.v1beta1.TargetChange] for an identical target. + * + * Using a resume token with a different target is unsupported and may fail. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *resumeToken; + +/** + * Start listening after a specific `read_time`. + * + * The client must know the state of matching documents at this time. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; + +/** + * A client provided target ID. + * + * If not set, the server will assign an ID for the target. + * + * Used for resuming a target without changing IDs. The IDs can either be + * client-assigned or be server-assigned in a previous stream. All targets + * with client provided IDs must be added before adding a target that needs + * a server-assigned id. + **/ +@property(nonatomic, readwrite) int32_t targetId; + +/** If the target should be removed once it is current and consistent. */ +@property(nonatomic, readwrite) BOOL once; + +@end + +/** + * Clears whatever value was set for the oneof 'targetType'. + **/ +void GCFSTarget_ClearTargetTypeOneOfCase(GCFSTarget *message); +/** + * Clears whatever value was set for the oneof 'resumeType'. + **/ +void GCFSTarget_ClearResumeTypeOneOfCase(GCFSTarget *message); + +#pragma mark - GCFSTarget_DocumentsTarget + +typedef GPB_ENUM(GCFSTarget_DocumentsTarget_FieldNumber) { + GCFSTarget_DocumentsTarget_FieldNumber_DocumentsArray = 2, +}; + +/** + * A target specified by a set of documents names. + **/ +@interface GCFSTarget_DocumentsTarget : GPBMessage + +/** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of + * the given `database`. Duplicate names will be elided. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *documentsArray; +/** The number of items in @c documentsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger documentsArray_Count; + +@end + +#pragma mark - GCFSTarget_QueryTarget + +typedef GPB_ENUM(GCFSTarget_QueryTarget_FieldNumber) { + GCFSTarget_QueryTarget_FieldNumber_Parent = 1, + GCFSTarget_QueryTarget_FieldNumber_StructuredQuery = 2, +}; + +typedef GPB_ENUM(GCFSTarget_QueryTarget_QueryType_OneOfCase) { + GCFSTarget_QueryTarget_QueryType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSTarget_QueryTarget_QueryType_OneOfCase_StructuredQuery = 2, +}; + +/** + * A target specified by a query. + **/ +@interface GCFSTarget_QueryTarget : GPBMessage + +/** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; + +/** The query to run. */ +@property(nonatomic, readonly) GCFSTarget_QueryTarget_QueryType_OneOfCase queryTypeOneOfCase; + +/** A structured query. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery *structuredQuery; + +@end + +/** + * Clears whatever value was set for the oneof 'queryType'. + **/ +void GCFSTarget_QueryTarget_ClearQueryTypeOneOfCase(GCFSTarget_QueryTarget *message); + +#pragma mark - GCFSTargetChange + +typedef GPB_ENUM(GCFSTargetChange_FieldNumber) { + GCFSTargetChange_FieldNumber_TargetChangeType = 1, + GCFSTargetChange_FieldNumber_TargetIdsArray = 2, + GCFSTargetChange_FieldNumber_Cause = 3, + GCFSTargetChange_FieldNumber_ResumeToken = 4, + GCFSTargetChange_FieldNumber_ReadTime = 6, +}; + +/** + * Targets being watched have changed. + **/ +@interface GCFSTargetChange : GPBMessage + +/** The type of change that occurred. */ +@property(nonatomic, readwrite) GCFSTargetChange_TargetChangeType targetChangeType; + +/** + * The target IDs of targets that have changed. + * + * If empty, the change applies to all targets. + * + * For `target_change_type=ADD`, the order of the target IDs matches the order + * of the requests to add the targets. This allows clients to unambiguously + * associate server-assigned target IDs with added targets. + * + * For other states, the order of the target IDs is not defined. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *targetIdsArray; +/** The number of items in @c targetIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger targetIdsArray_Count; + +/** The error that resulted in this change, if applicable. */ +@property(nonatomic, readwrite, strong, null_resettable) RPCStatus *cause; +/** Test to see if @c cause has been set. */ +@property(nonatomic, readwrite) BOOL hasCause; + +/** + * A token that can be used to resume the stream for the given `target_ids`, + * or all targets if `target_ids` is empty. + * + * Not set on every target change. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSData *resumeToken; + +/** + * The consistent `read_time` for the given `target_ids` (omitted when the + * target_ids are not at a consistent snapshot). + * + * The stream is guaranteed to send a `read_time` with `target_ids` empty + * whenever the entire stream reaches a new consistent snapshot. ADD, + * CURRENT, and RESET messages are guaranteed to (eventually) result in a + * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + * + * For a given stream, `read_time` is guaranteed to be monotonically + * increasing. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; +/** Test to see if @c readTime has been set. */ +@property(nonatomic, readwrite) BOOL hasReadTime; + +@end + +/** + * Fetches the raw value of a @c GCFSTargetChange's @c targetChangeType property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GCFSTargetChange_TargetChangeType_RawValue(GCFSTargetChange *message); +/** + * Sets the raw value of an @c GCFSTargetChange's @c targetChangeType property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGCFSTargetChange_TargetChangeType_RawValue(GCFSTargetChange *message, int32_t value); + +#pragma mark - GCFSListCollectionIdsRequest + +typedef GPB_ENUM(GCFSListCollectionIdsRequest_FieldNumber) { + GCFSListCollectionIdsRequest_FieldNumber_Parent = 1, + GCFSListCollectionIdsRequest_FieldNumber_PageSize = 2, + GCFSListCollectionIdsRequest_FieldNumber_PageToken = 3, +}; + +/** + * The request for [Firestore.ListCollectionIds][google.firestore.v1beta1.Firestore.ListCollectionIds]. + **/ +@interface GCFSListCollectionIdsRequest : GPBMessage + +/** + * The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; + +/** The maximum number of results to return. */ +@property(nonatomic, readwrite) int32_t pageSize; + +/** + * A page token. Must be a value from + * [ListCollectionIdsResponse][google.firestore.v1beta1.ListCollectionIdsResponse]. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *pageToken; + +@end + +#pragma mark - GCFSListCollectionIdsResponse + +typedef GPB_ENUM(GCFSListCollectionIdsResponse_FieldNumber) { + GCFSListCollectionIdsResponse_FieldNumber_CollectionIdsArray = 1, + GCFSListCollectionIdsResponse_FieldNumber_NextPageToken = 2, +}; + +/** + * The response from [Firestore.ListCollectionIds][google.firestore.v1beta1.Firestore.ListCollectionIds]. + **/ +@interface GCFSListCollectionIdsResponse : GPBMessage + +/** The collection ids. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *collectionIdsArray; +/** The number of items in @c collectionIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger collectionIdsArray_Count; + +/** A page token that may be used to continue the list. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *nextPageToken; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.m b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.m new file mode 100644 index 0000000..4bdee01 --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.m @@ -0,0 +1,2064 @@ +/* + * 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: google/firestore/v1beta1/firestore.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/Empty.pbobjc.h> + #import <Protobuf/Timestamp.pbobjc.h> +#else + #import "Empty.pbobjc.h" + #import "Timestamp.pbobjc.h" +#endif + + #import "Firestore.pbobjc.h" + #import "Annotations.pbobjc.h" + #import "Common.pbobjc.h" + #import "Document.pbobjc.h" + #import "Query.pbobjc.h" + #import "Write.pbobjc.h" + #import "Status.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 - GCFSFirestoreRoot + +@implementation GCFSFirestoreRoot + + +@end + +#pragma mark - GCFSFirestoreRoot_FileDescriptor + +static GPBFileDescriptor *GCFSFirestoreRoot_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:@"google.firestore.v1beta1" + objcPrefix:@"GCFS" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GCFSGetDocumentRequest + +@implementation GCFSGetDocumentRequest + +@dynamic consistencySelectorOneOfCase; +@dynamic name; +@dynamic hasMask, mask; +@dynamic transaction; +@dynamic readTime; + +typedef struct GCFSGetDocumentRequest__storage_ { + uint32_t _has_storage_[2]; + NSString *name; + GCFSDocumentMask *mask; + NSData *transaction; + GPBTimestamp *readTime; +} GCFSGetDocumentRequest__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 = GCFSGetDocumentRequest_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSGetDocumentRequest__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "mask", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), + .number = GCFSGetDocumentRequest_FieldNumber_Mask, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSGetDocumentRequest__storage_, mask), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "transaction", + .dataTypeSpecific.className = NULL, + .number = GCFSGetDocumentRequest_FieldNumber_Transaction, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSGetDocumentRequest__storage_, transaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSGetDocumentRequest_FieldNumber_ReadTime, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSGetDocumentRequest__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSGetDocumentRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSGetDocumentRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "consistencySelector", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSGetDocumentRequest_ClearConsistencySelectorOneOfCase(GCFSGetDocumentRequest *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSListDocumentsRequest + +@implementation GCFSListDocumentsRequest + +@dynamic consistencySelectorOneOfCase; +@dynamic parent; +@dynamic collectionId; +@dynamic pageSize; +@dynamic pageToken; +@dynamic orderBy; +@dynamic hasMask, mask; +@dynamic transaction; +@dynamic readTime; +@dynamic showMissing; + +typedef struct GCFSListDocumentsRequest__storage_ { + uint32_t _has_storage_[2]; + int32_t pageSize; + NSString *parent; + NSString *collectionId; + NSString *pageToken; + NSString *orderBy; + GCFSDocumentMask *mask; + NSData *transaction; + GPBTimestamp *readTime; +} GCFSListDocumentsRequest__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 = "parent", + .dataTypeSpecific.className = NULL, + .number = GCFSListDocumentsRequest_FieldNumber_Parent, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, parent), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "collectionId", + .dataTypeSpecific.className = NULL, + .number = GCFSListDocumentsRequest_FieldNumber_CollectionId, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, collectionId), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "pageSize", + .dataTypeSpecific.className = NULL, + .number = GCFSListDocumentsRequest_FieldNumber_PageSize, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, pageSize), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + { + .name = "pageToken", + .dataTypeSpecific.className = NULL, + .number = GCFSListDocumentsRequest_FieldNumber_PageToken, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, pageToken), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "orderBy", + .dataTypeSpecific.className = NULL, + .number = GCFSListDocumentsRequest_FieldNumber_OrderBy, + .hasIndex = 4, + .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, orderBy), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "mask", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), + .number = GCFSListDocumentsRequest_FieldNumber_Mask, + .hasIndex = 5, + .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, mask), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "transaction", + .dataTypeSpecific.className = NULL, + .number = GCFSListDocumentsRequest_FieldNumber_Transaction, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, transaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSListDocumentsRequest_FieldNumber_ReadTime, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "showMissing", + .dataTypeSpecific.className = NULL, + .number = GCFSListDocumentsRequest_FieldNumber_ShowMissing, + .hasIndex = 6, + .offset = 7, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSListDocumentsRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSListDocumentsRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "consistencySelector", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSListDocumentsRequest_ClearConsistencySelectorOneOfCase(GCFSListDocumentsRequest *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSListDocumentsResponse + +@implementation GCFSListDocumentsResponse + +@dynamic documentsArray, documentsArray_Count; +@dynamic nextPageToken; + +typedef struct GCFSListDocumentsResponse__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *documentsArray; + NSString *nextPageToken; +} GCFSListDocumentsResponse__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 = "documentsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), + .number = GCFSListDocumentsResponse_FieldNumber_DocumentsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSListDocumentsResponse__storage_, documentsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "nextPageToken", + .dataTypeSpecific.className = NULL, + .number = GCFSListDocumentsResponse_FieldNumber_NextPageToken, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSListDocumentsResponse__storage_, nextPageToken), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSListDocumentsResponse class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSListDocumentsResponse__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSCreateDocumentRequest + +@implementation GCFSCreateDocumentRequest + +@dynamic parent; +@dynamic collectionId; +@dynamic documentId; +@dynamic hasDocument, document; +@dynamic hasMask, mask; + +typedef struct GCFSCreateDocumentRequest__storage_ { + uint32_t _has_storage_[1]; + NSString *parent; + NSString *collectionId; + NSString *documentId; + GCFSDocument *document; + GCFSDocumentMask *mask; +} GCFSCreateDocumentRequest__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 = "parent", + .dataTypeSpecific.className = NULL, + .number = GCFSCreateDocumentRequest_FieldNumber_Parent, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, parent), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "collectionId", + .dataTypeSpecific.className = NULL, + .number = GCFSCreateDocumentRequest_FieldNumber_CollectionId, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, collectionId), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "documentId", + .dataTypeSpecific.className = NULL, + .number = GCFSCreateDocumentRequest_FieldNumber_DocumentId, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, documentId), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "document", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), + .number = GCFSCreateDocumentRequest_FieldNumber_Document, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, document), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "mask", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), + .number = GCFSCreateDocumentRequest_FieldNumber_Mask, + .hasIndex = 4, + .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, mask), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSCreateDocumentRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSCreateDocumentRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSUpdateDocumentRequest + +@implementation GCFSUpdateDocumentRequest + +@dynamic hasDocument, document; +@dynamic hasUpdateMask, updateMask; +@dynamic hasMask, mask; +@dynamic hasCurrentDocument, currentDocument; + +typedef struct GCFSUpdateDocumentRequest__storage_ { + uint32_t _has_storage_[1]; + GCFSDocument *document; + GCFSDocumentMask *updateMask; + GCFSDocumentMask *mask; + GCFSPrecondition *currentDocument; +} GCFSUpdateDocumentRequest__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 = "document", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), + .number = GCFSUpdateDocumentRequest_FieldNumber_Document, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSUpdateDocumentRequest__storage_, document), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "updateMask", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), + .number = GCFSUpdateDocumentRequest_FieldNumber_UpdateMask, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSUpdateDocumentRequest__storage_, updateMask), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "mask", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), + .number = GCFSUpdateDocumentRequest_FieldNumber_Mask, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSUpdateDocumentRequest__storage_, mask), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "currentDocument", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSPrecondition), + .number = GCFSUpdateDocumentRequest_FieldNumber_CurrentDocument, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GCFSUpdateDocumentRequest__storage_, currentDocument), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSUpdateDocumentRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSUpdateDocumentRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSDeleteDocumentRequest + +@implementation GCFSDeleteDocumentRequest + +@dynamic name; +@dynamic hasCurrentDocument, currentDocument; + +typedef struct GCFSDeleteDocumentRequest__storage_ { + uint32_t _has_storage_[1]; + NSString *name; + GCFSPrecondition *currentDocument; +} GCFSDeleteDocumentRequest__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 = GCFSDeleteDocumentRequest_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSDeleteDocumentRequest__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "currentDocument", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSPrecondition), + .number = GCFSDeleteDocumentRequest_FieldNumber_CurrentDocument, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSDeleteDocumentRequest__storage_, currentDocument), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSDeleteDocumentRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSDeleteDocumentRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSBatchGetDocumentsRequest + +@implementation GCFSBatchGetDocumentsRequest + +@dynamic consistencySelectorOneOfCase; +@dynamic database; +@dynamic documentsArray, documentsArray_Count; +@dynamic hasMask, mask; +@dynamic transaction; +@dynamic newTransaction; +@dynamic readTime; + +typedef struct GCFSBatchGetDocumentsRequest__storage_ { + uint32_t _has_storage_[2]; + NSString *database; + NSMutableArray *documentsArray; + GCFSDocumentMask *mask; + NSData *transaction; + GCFSTransactionOptions *newTransaction; + GPBTimestamp *readTime; +} GCFSBatchGetDocumentsRequest__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 = "database", + .dataTypeSpecific.className = NULL, + .number = GCFSBatchGetDocumentsRequest_FieldNumber_Database, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, database), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "documentsArray", + .dataTypeSpecific.className = NULL, + .number = GCFSBatchGetDocumentsRequest_FieldNumber_DocumentsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, documentsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeString, + }, + { + .name = "mask", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), + .number = GCFSBatchGetDocumentsRequest_FieldNumber_Mask, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, mask), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "transaction", + .dataTypeSpecific.className = NULL, + .number = GCFSBatchGetDocumentsRequest_FieldNumber_Transaction, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, transaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "newTransaction", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions), + .number = GCFSBatchGetDocumentsRequest_FieldNumber_NewTransaction, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, newTransaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSBatchGetDocumentsRequest_FieldNumber_ReadTime, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSBatchGetDocumentsRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSBatchGetDocumentsRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "consistencySelector", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSBatchGetDocumentsRequest_ClearConsistencySelectorOneOfCase(GCFSBatchGetDocumentsRequest *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSBatchGetDocumentsResponse + +@implementation GCFSBatchGetDocumentsResponse + +@dynamic resultOneOfCase; +@dynamic found; +@dynamic missing; +@dynamic transaction; +@dynamic hasReadTime, readTime; + +typedef struct GCFSBatchGetDocumentsResponse__storage_ { + uint32_t _has_storage_[2]; + GCFSDocument *found; + NSString *missing; + NSData *transaction; + GPBTimestamp *readTime; +} GCFSBatchGetDocumentsResponse__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 = "found", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), + .number = GCFSBatchGetDocumentsResponse_FieldNumber_Found, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsResponse__storage_, found), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "missing", + .dataTypeSpecific.className = NULL, + .number = GCFSBatchGetDocumentsResponse_FieldNumber_Missing, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsResponse__storage_, missing), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "transaction", + .dataTypeSpecific.className = NULL, + .number = GCFSBatchGetDocumentsResponse_FieldNumber_Transaction, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsResponse__storage_, transaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSBatchGetDocumentsResponse_FieldNumber_ReadTime, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsResponse__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSBatchGetDocumentsResponse class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSBatchGetDocumentsResponse__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "result", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSBatchGetDocumentsResponse_ClearResultOneOfCase(GCFSBatchGetDocumentsResponse *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSBeginTransactionRequest + +@implementation GCFSBeginTransactionRequest + +@dynamic database; +@dynamic hasOptions, options; + +typedef struct GCFSBeginTransactionRequest__storage_ { + uint32_t _has_storage_[1]; + NSString *database; + GCFSTransactionOptions *options; +} GCFSBeginTransactionRequest__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 = "database", + .dataTypeSpecific.className = NULL, + .number = GCFSBeginTransactionRequest_FieldNumber_Database, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSBeginTransactionRequest__storage_, database), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "options", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions), + .number = GCFSBeginTransactionRequest_FieldNumber_Options, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSBeginTransactionRequest__storage_, options), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSBeginTransactionRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSBeginTransactionRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSBeginTransactionResponse + +@implementation GCFSBeginTransactionResponse + +@dynamic transaction; + +typedef struct GCFSBeginTransactionResponse__storage_ { + uint32_t _has_storage_[1]; + NSData *transaction; +} GCFSBeginTransactionResponse__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 = "transaction", + .dataTypeSpecific.className = NULL, + .number = GCFSBeginTransactionResponse_FieldNumber_Transaction, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSBeginTransactionResponse__storage_, transaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSBeginTransactionResponse class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSBeginTransactionResponse__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSCommitRequest + +@implementation GCFSCommitRequest + +@dynamic database; +@dynamic writesArray, writesArray_Count; +@dynamic transaction; + +typedef struct GCFSCommitRequest__storage_ { + uint32_t _has_storage_[1]; + NSString *database; + NSMutableArray *writesArray; + NSData *transaction; +} GCFSCommitRequest__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 = "database", + .dataTypeSpecific.className = NULL, + .number = GCFSCommitRequest_FieldNumber_Database, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSCommitRequest__storage_, database), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "writesArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSWrite), + .number = GCFSCommitRequest_FieldNumber_WritesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSCommitRequest__storage_, writesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "transaction", + .dataTypeSpecific.className = NULL, + .number = GCFSCommitRequest_FieldNumber_Transaction, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSCommitRequest__storage_, transaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSCommitRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSCommitRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSCommitResponse + +@implementation GCFSCommitResponse + +@dynamic writeResultsArray, writeResultsArray_Count; +@dynamic hasCommitTime, commitTime; + +typedef struct GCFSCommitResponse__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *writeResultsArray; + GPBTimestamp *commitTime; +} GCFSCommitResponse__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 = "writeResultsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSWriteResult), + .number = GCFSCommitResponse_FieldNumber_WriteResultsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSCommitResponse__storage_, writeResultsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "commitTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSCommitResponse_FieldNumber_CommitTime, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSCommitResponse__storage_, commitTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSCommitResponse class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSCommitResponse__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSRollbackRequest + +@implementation GCFSRollbackRequest + +@dynamic database; +@dynamic transaction; + +typedef struct GCFSRollbackRequest__storage_ { + uint32_t _has_storage_[1]; + NSString *database; + NSData *transaction; +} GCFSRollbackRequest__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 = "database", + .dataTypeSpecific.className = NULL, + .number = GCFSRollbackRequest_FieldNumber_Database, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSRollbackRequest__storage_, database), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "transaction", + .dataTypeSpecific.className = NULL, + .number = GCFSRollbackRequest_FieldNumber_Transaction, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSRollbackRequest__storage_, transaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSRollbackRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSRollbackRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSRunQueryRequest + +@implementation GCFSRunQueryRequest + +@dynamic queryTypeOneOfCase; +@dynamic consistencySelectorOneOfCase; +@dynamic parent; +@dynamic structuredQuery; +@dynamic transaction; +@dynamic newTransaction; +@dynamic readTime; + +typedef struct GCFSRunQueryRequest__storage_ { + uint32_t _has_storage_[3]; + NSString *parent; + GCFSStructuredQuery *structuredQuery; + NSData *transaction; + GCFSTransactionOptions *newTransaction; + GPBTimestamp *readTime; +} GCFSRunQueryRequest__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 = "parent", + .dataTypeSpecific.className = NULL, + .number = GCFSRunQueryRequest_FieldNumber_Parent, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, parent), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "structuredQuery", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery), + .number = GCFSRunQueryRequest_FieldNumber_StructuredQuery, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, structuredQuery), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "transaction", + .dataTypeSpecific.className = NULL, + .number = GCFSRunQueryRequest_FieldNumber_Transaction, + .hasIndex = -2, + .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, transaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "newTransaction", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions), + .number = GCFSRunQueryRequest_FieldNumber_NewTransaction, + .hasIndex = -2, + .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, newTransaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSRunQueryRequest_FieldNumber_ReadTime, + .hasIndex = -2, + .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSRunQueryRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSRunQueryRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "queryType", + "consistencySelector", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSRunQueryRequest_ClearQueryTypeOneOfCase(GCFSRunQueryRequest *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +void GCFSRunQueryRequest_ClearConsistencySelectorOneOfCase(GCFSRunQueryRequest *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:1]; + GPBMaybeClearOneof(message, oneof, -2, 0); +} +#pragma mark - GCFSRunQueryResponse + +@implementation GCFSRunQueryResponse + +@dynamic transaction; +@dynamic hasDocument, document; +@dynamic hasReadTime, readTime; +@dynamic skippedResults; + +typedef struct GCFSRunQueryResponse__storage_ { + uint32_t _has_storage_[1]; + int32_t skippedResults; + GCFSDocument *document; + NSData *transaction; + GPBTimestamp *readTime; +} GCFSRunQueryResponse__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 = "document", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), + .number = GCFSRunQueryResponse_FieldNumber_Document, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSRunQueryResponse__storage_, document), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "transaction", + .dataTypeSpecific.className = NULL, + .number = GCFSRunQueryResponse_FieldNumber_Transaction, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSRunQueryResponse__storage_, transaction), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSRunQueryResponse_FieldNumber_ReadTime, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSRunQueryResponse__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "skippedResults", + .dataTypeSpecific.className = NULL, + .number = GCFSRunQueryResponse_FieldNumber_SkippedResults, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GCFSRunQueryResponse__storage_, skippedResults), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSRunQueryResponse class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSRunQueryResponse__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSWriteRequest + +@implementation GCFSWriteRequest + +@dynamic database; +@dynamic streamId; +@dynamic writesArray, writesArray_Count; +@dynamic streamToken; +@dynamic labels, labels_Count; + +typedef struct GCFSWriteRequest__storage_ { + uint32_t _has_storage_[1]; + NSString *database; + NSString *streamId; + NSMutableArray *writesArray; + NSData *streamToken; + NSMutableDictionary *labels; +} GCFSWriteRequest__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 = "database", + .dataTypeSpecific.className = NULL, + .number = GCFSWriteRequest_FieldNumber_Database, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, database), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "streamId", + .dataTypeSpecific.className = NULL, + .number = GCFSWriteRequest_FieldNumber_StreamId, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, streamId), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "writesArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSWrite), + .number = GCFSWriteRequest_FieldNumber_WritesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, writesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "streamToken", + .dataTypeSpecific.className = NULL, + .number = GCFSWriteRequest_FieldNumber_StreamToken, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, streamToken), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "labels", + .dataTypeSpecific.className = NULL, + .number = GCFSWriteRequest_FieldNumber_Labels, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, labels), + .flags = GPBFieldMapKeyString, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSWriteRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSWriteRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSWriteResponse + +@implementation GCFSWriteResponse + +@dynamic streamId; +@dynamic streamToken; +@dynamic writeResultsArray, writeResultsArray_Count; +@dynamic hasCommitTime, commitTime; + +typedef struct GCFSWriteResponse__storage_ { + uint32_t _has_storage_[1]; + NSString *streamId; + NSData *streamToken; + NSMutableArray *writeResultsArray; + GPBTimestamp *commitTime; +} GCFSWriteResponse__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 = "streamId", + .dataTypeSpecific.className = NULL, + .number = GCFSWriteResponse_FieldNumber_StreamId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSWriteResponse__storage_, streamId), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "streamToken", + .dataTypeSpecific.className = NULL, + .number = GCFSWriteResponse_FieldNumber_StreamToken, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSWriteResponse__storage_, streamToken), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "writeResultsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSWriteResult), + .number = GCFSWriteResponse_FieldNumber_WriteResultsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSWriteResponse__storage_, writeResultsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "commitTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSWriteResponse_FieldNumber_CommitTime, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSWriteResponse__storage_, commitTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSWriteResponse class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSWriteResponse__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSListenRequest + +@implementation GCFSListenRequest + +@dynamic targetChangeOneOfCase; +@dynamic database; +@dynamic addTarget; +@dynamic removeTarget; +@dynamic labels, labels_Count; + +typedef struct GCFSListenRequest__storage_ { + uint32_t _has_storage_[2]; + int32_t removeTarget; + NSString *database; + GCFSTarget *addTarget; + NSMutableDictionary *labels; +} GCFSListenRequest__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 = "database", + .dataTypeSpecific.className = NULL, + .number = GCFSListenRequest_FieldNumber_Database, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSListenRequest__storage_, database), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "addTarget", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget), + .number = GCFSListenRequest_FieldNumber_AddTarget, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSListenRequest__storage_, addTarget), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "removeTarget", + .dataTypeSpecific.className = NULL, + .number = GCFSListenRequest_FieldNumber_RemoveTarget, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSListenRequest__storage_, removeTarget), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + { + .name = "labels", + .dataTypeSpecific.className = NULL, + .number = GCFSListenRequest_FieldNumber_Labels, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSListenRequest__storage_, labels), + .flags = GPBFieldMapKeyString, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSListenRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSListenRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "targetChange", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSListenRequest_ClearTargetChangeOneOfCase(GCFSListenRequest *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSListenResponse + +@implementation GCFSListenResponse + +@dynamic responseTypeOneOfCase; +@dynamic targetChange; +@dynamic documentChange; +@dynamic documentDelete; +@dynamic documentRemove; +@dynamic filter; + +typedef struct GCFSListenResponse__storage_ { + uint32_t _has_storage_[2]; + GCFSTargetChange *targetChange; + GCFSDocumentChange *documentChange; + GCFSDocumentDelete *documentDelete; + GCFSExistenceFilter *filter; + GCFSDocumentRemove *documentRemove; +} GCFSListenResponse__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 = "targetChange", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSTargetChange), + .number = GCFSListenResponse_FieldNumber_TargetChange, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, targetChange), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "documentChange", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentChange), + .number = GCFSListenResponse_FieldNumber_DocumentChange, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, documentChange), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "documentDelete", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentDelete), + .number = GCFSListenResponse_FieldNumber_DocumentDelete, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, documentDelete), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "filter", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSExistenceFilter), + .number = GCFSListenResponse_FieldNumber_Filter, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, filter), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "documentRemove", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentRemove), + .number = GCFSListenResponse_FieldNumber_DocumentRemove, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, documentRemove), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSListenResponse class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSListenResponse__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "responseType", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSListenResponse_ClearResponseTypeOneOfCase(GCFSListenResponse *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSTarget + +@implementation GCFSTarget + +@dynamic targetTypeOneOfCase; +@dynamic resumeTypeOneOfCase; +@dynamic query; +@dynamic documents; +@dynamic resumeToken; +@dynamic readTime; +@dynamic targetId; +@dynamic once; + +typedef struct GCFSTarget__storage_ { + uint32_t _has_storage_[3]; + int32_t targetId; + GCFSTarget_QueryTarget *query; + GCFSTarget_DocumentsTarget *documents; + NSData *resumeToken; + GPBTimestamp *readTime; +} GCFSTarget__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 = "query", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget_QueryTarget), + .number = GCFSTarget_FieldNumber_Query, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSTarget__storage_, query), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "documents", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget_DocumentsTarget), + .number = GCFSTarget_FieldNumber_Documents, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSTarget__storage_, documents), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "resumeToken", + .dataTypeSpecific.className = NULL, + .number = GCFSTarget_FieldNumber_ResumeToken, + .hasIndex = -2, + .offset = (uint32_t)offsetof(GCFSTarget__storage_, resumeToken), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "targetId", + .dataTypeSpecific.className = NULL, + .number = GCFSTarget_FieldNumber_TargetId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSTarget__storage_, targetId), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + { + .name = "once", + .dataTypeSpecific.className = NULL, + .number = GCFSTarget_FieldNumber_Once, + .hasIndex = 1, + .offset = 2, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSTarget_FieldNumber_ReadTime, + .hasIndex = -2, + .offset = (uint32_t)offsetof(GCFSTarget__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSTarget class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSTarget__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "targetType", + "resumeType", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSTarget_ClearTargetTypeOneOfCase(GCFSTarget *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +void GCFSTarget_ClearResumeTypeOneOfCase(GCFSTarget *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:1]; + GPBMaybeClearOneof(message, oneof, -2, 0); +} +#pragma mark - GCFSTarget_DocumentsTarget + +@implementation GCFSTarget_DocumentsTarget + +@dynamic documentsArray, documentsArray_Count; + +typedef struct GCFSTarget_DocumentsTarget__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *documentsArray; +} GCFSTarget_DocumentsTarget__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 = "documentsArray", + .dataTypeSpecific.className = NULL, + .number = GCFSTarget_DocumentsTarget_FieldNumber_DocumentsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSTarget_DocumentsTarget__storage_, documentsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSTarget_DocumentsTarget class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSTarget_DocumentsTarget__storage_) + flags:GPBDescriptorInitializationFlag_None]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSTarget)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSTarget_QueryTarget + +@implementation GCFSTarget_QueryTarget + +@dynamic queryTypeOneOfCase; +@dynamic parent; +@dynamic structuredQuery; + +typedef struct GCFSTarget_QueryTarget__storage_ { + uint32_t _has_storage_[2]; + NSString *parent; + GCFSStructuredQuery *structuredQuery; +} GCFSTarget_QueryTarget__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 = "parent", + .dataTypeSpecific.className = NULL, + .number = GCFSTarget_QueryTarget_FieldNumber_Parent, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSTarget_QueryTarget__storage_, parent), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "structuredQuery", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery), + .number = GCFSTarget_QueryTarget_FieldNumber_StructuredQuery, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSTarget_QueryTarget__storage_, structuredQuery), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSTarget_QueryTarget class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSTarget_QueryTarget__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "queryType", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSTarget)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSTarget_QueryTarget_ClearQueryTypeOneOfCase(GCFSTarget_QueryTarget *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSTargetChange + +@implementation GCFSTargetChange + +@dynamic targetChangeType; +@dynamic targetIdsArray, targetIdsArray_Count; +@dynamic hasCause, cause; +@dynamic resumeToken; +@dynamic hasReadTime, readTime; + +typedef struct GCFSTargetChange__storage_ { + uint32_t _has_storage_[1]; + GCFSTargetChange_TargetChangeType targetChangeType; + GPBInt32Array *targetIdsArray; + RPCStatus *cause; + NSData *resumeToken; + GPBTimestamp *readTime; +} GCFSTargetChange__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 = "targetChangeType", + .dataTypeSpecific.enumDescFunc = GCFSTargetChange_TargetChangeType_EnumDescriptor, + .number = GCFSTargetChange_FieldNumber_TargetChangeType, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, targetChangeType), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + { + .name = "targetIdsArray", + .dataTypeSpecific.className = NULL, + .number = GCFSTargetChange_FieldNumber_TargetIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, targetIdsArray), + .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), + .dataType = GPBDataTypeInt32, + }, + { + .name = "cause", + .dataTypeSpecific.className = GPBStringifySymbol(RPCStatus), + .number = GCFSTargetChange_FieldNumber_Cause, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, cause), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "resumeToken", + .dataTypeSpecific.className = NULL, + .number = GCFSTargetChange_FieldNumber_ResumeToken, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, resumeToken), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSTargetChange_FieldNumber_ReadTime, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSTargetChange class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSTargetChange__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GCFSTargetChange_TargetChangeType_RawValue(GCFSTargetChange *message) { + GPBDescriptor *descriptor = [GCFSTargetChange descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSTargetChange_FieldNumber_TargetChangeType]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGCFSTargetChange_TargetChangeType_RawValue(GCFSTargetChange *message, int32_t value) { + GPBDescriptor *descriptor = [GCFSTargetChange descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSTargetChange_FieldNumber_TargetChangeType]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - Enum GCFSTargetChange_TargetChangeType + +GPBEnumDescriptor *GCFSTargetChange_TargetChangeType_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "NoChange\000Add\000Remove\000Current\000Reset\000"; + static const int32_t values[] = { + GCFSTargetChange_TargetChangeType_NoChange, + GCFSTargetChange_TargetChangeType_Add, + GCFSTargetChange_TargetChangeType_Remove, + GCFSTargetChange_TargetChangeType_Current, + GCFSTargetChange_TargetChangeType_Reset, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSTargetChange_TargetChangeType) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GCFSTargetChange_TargetChangeType_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GCFSTargetChange_TargetChangeType_IsValidValue(int32_t value__) { + switch (value__) { + case GCFSTargetChange_TargetChangeType_NoChange: + case GCFSTargetChange_TargetChangeType_Add: + case GCFSTargetChange_TargetChangeType_Remove: + case GCFSTargetChange_TargetChangeType_Current: + case GCFSTargetChange_TargetChangeType_Reset: + return YES; + default: + return NO; + } +} + +#pragma mark - GCFSListCollectionIdsRequest + +@implementation GCFSListCollectionIdsRequest + +@dynamic parent; +@dynamic pageSize; +@dynamic pageToken; + +typedef struct GCFSListCollectionIdsRequest__storage_ { + uint32_t _has_storage_[1]; + int32_t pageSize; + NSString *parent; + NSString *pageToken; +} GCFSListCollectionIdsRequest__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 = "parent", + .dataTypeSpecific.className = NULL, + .number = GCFSListCollectionIdsRequest_FieldNumber_Parent, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSListCollectionIdsRequest__storage_, parent), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "pageSize", + .dataTypeSpecific.className = NULL, + .number = GCFSListCollectionIdsRequest_FieldNumber_PageSize, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSListCollectionIdsRequest__storage_, pageSize), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + { + .name = "pageToken", + .dataTypeSpecific.className = NULL, + .number = GCFSListCollectionIdsRequest_FieldNumber_PageToken, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSListCollectionIdsRequest__storage_, pageToken), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSListCollectionIdsRequest class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSListCollectionIdsRequest__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSListCollectionIdsResponse + +@implementation GCFSListCollectionIdsResponse + +@dynamic collectionIdsArray, collectionIdsArray_Count; +@dynamic nextPageToken; + +typedef struct GCFSListCollectionIdsResponse__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *collectionIdsArray; + NSString *nextPageToken; +} GCFSListCollectionIdsResponse__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 = "collectionIdsArray", + .dataTypeSpecific.className = NULL, + .number = GCFSListCollectionIdsResponse_FieldNumber_CollectionIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSListCollectionIdsResponse__storage_, collectionIdsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeString, + }, + { + .name = "nextPageToken", + .dataTypeSpecific.className = NULL, + .number = GCFSListCollectionIdsResponse_FieldNumber_NextPageToken, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSListCollectionIdsResponse__storage_, nextPageToken), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSListCollectionIdsResponse class] + rootClass:[GCFSFirestoreRoot class] + file:GCFSFirestoreRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSListCollectionIdsResponse__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/google/firestore/v1beta1/Firestore.pbrpc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h new file mode 100644 index 0000000..5704c2b --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.h @@ -0,0 +1,232 @@ +/* + * 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. + */ + +#import "Firestore.pbobjc.h" + +#import <ProtoRPC/ProtoService.h> +#import <ProtoRPC/ProtoRPC.h> +#import <RxLibrary/GRXWriteable.h> +#import <RxLibrary/GRXWriter.h> + +#import "Annotations.pbobjc.h" +#import "Common.pbobjc.h" +#import "Document.pbobjc.h" +#import "Query.pbobjc.h" +#import "Write.pbobjc.h" +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Empty.pbobjc.h> +#else + #import "Empty.pbobjc.h" +#endif +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Timestamp.pbobjc.h> +#else + #import "Timestamp.pbobjc.h" +#endif +#import "Status.pbobjc.h" + + +NS_ASSUME_NONNULL_BEGIN + +@protocol GCFSFirestore <NSObject> + +#pragma mark GetDocument(GetDocumentRequest) returns (Document) + +/** + * Gets a single document. + */ +- (void)getDocumentWithRequest:(GCFSGetDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler; + +/** + * Gets a single document. + */ +- (GRPCProtoCall *)RPCToGetDocumentWithRequest:(GCFSGetDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) + +/** + * Lists documents. + */ +- (void)listDocumentsWithRequest:(GCFSListDocumentsRequest *)request handler:(void(^)(GCFSListDocumentsResponse *_Nullable response, NSError *_Nullable error))handler; + +/** + * Lists documents. + */ +- (GRPCProtoCall *)RPCToListDocumentsWithRequest:(GCFSListDocumentsRequest *)request handler:(void(^)(GCFSListDocumentsResponse *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark CreateDocument(CreateDocumentRequest) returns (Document) + +/** + * Creates a new document. + */ +- (void)createDocumentWithRequest:(GCFSCreateDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler; + +/** + * Creates a new document. + */ +- (GRPCProtoCall *)RPCToCreateDocumentWithRequest:(GCFSCreateDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark UpdateDocument(UpdateDocumentRequest) returns (Document) + +/** + * Updates or inserts a document. + */ +- (void)updateDocumentWithRequest:(GCFSUpdateDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler; + +/** + * Updates or inserts a document. + */ +- (GRPCProtoCall *)RPCToUpdateDocumentWithRequest:(GCFSUpdateDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark DeleteDocument(DeleteDocumentRequest) returns (Empty) + +/** + * Deletes a document. + */ +- (void)deleteDocumentWithRequest:(GCFSDeleteDocumentRequest *)request handler:(void(^)(GPBEmpty *_Nullable response, NSError *_Nullable error))handler; + +/** + * Deletes a document. + */ +- (GRPCProtoCall *)RPCToDeleteDocumentWithRequest:(GCFSDeleteDocumentRequest *)request handler:(void(^)(GPBEmpty *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark BatchGetDocuments(BatchGetDocumentsRequest) returns (stream BatchGetDocumentsResponse) + +/** + * Gets multiple documents. + * + * Documents returned by this method are not guaranteed to be returned in the + * same order that they were requested. + */ +- (void)batchGetDocumentsWithRequest:(GCFSBatchGetDocumentsRequest *)request eventHandler:(void(^)(BOOL done, GCFSBatchGetDocumentsResponse *_Nullable response, NSError *_Nullable error))eventHandler; + +/** + * Gets multiple documents. + * + * Documents returned by this method are not guaranteed to be returned in the + * same order that they were requested. + */ +- (GRPCProtoCall *)RPCToBatchGetDocumentsWithRequest:(GCFSBatchGetDocumentsRequest *)request eventHandler:(void(^)(BOOL done, GCFSBatchGetDocumentsResponse *_Nullable response, NSError *_Nullable error))eventHandler; + + +#pragma mark BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse) + +/** + * Starts a new transaction. + */ +- (void)beginTransactionWithRequest:(GCFSBeginTransactionRequest *)request handler:(void(^)(GCFSBeginTransactionResponse *_Nullable response, NSError *_Nullable error))handler; + +/** + * Starts a new transaction. + */ +- (GRPCProtoCall *)RPCToBeginTransactionWithRequest:(GCFSBeginTransactionRequest *)request handler:(void(^)(GCFSBeginTransactionResponse *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark Commit(CommitRequest) returns (CommitResponse) + +/** + * Commits a transaction, while optionally updating documents. + */ +- (void)commitWithRequest:(GCFSCommitRequest *)request handler:(void(^)(GCFSCommitResponse *_Nullable response, NSError *_Nullable error))handler; + +/** + * Commits a transaction, while optionally updating documents. + */ +- (GRPCProtoCall *)RPCToCommitWithRequest:(GCFSCommitRequest *)request handler:(void(^)(GCFSCommitResponse *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark Rollback(RollbackRequest) returns (Empty) + +/** + * Rolls back a transaction. + */ +- (void)rollbackWithRequest:(GCFSRollbackRequest *)request handler:(void(^)(GPBEmpty *_Nullable response, NSError *_Nullable error))handler; + +/** + * Rolls back a transaction. + */ +- (GRPCProtoCall *)RPCToRollbackWithRequest:(GCFSRollbackRequest *)request handler:(void(^)(GPBEmpty *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark RunQuery(RunQueryRequest) returns (stream RunQueryResponse) + +/** + * Runs a query. + */ +- (void)runQueryWithRequest:(GCFSRunQueryRequest *)request eventHandler:(void(^)(BOOL done, GCFSRunQueryResponse *_Nullable response, NSError *_Nullable error))eventHandler; + +/** + * Runs a query. + */ +- (GRPCProtoCall *)RPCToRunQueryWithRequest:(GCFSRunQueryRequest *)request eventHandler:(void(^)(BOOL done, GCFSRunQueryResponse *_Nullable response, NSError *_Nullable error))eventHandler; + + +#pragma mark Write(stream WriteRequest) returns (stream WriteResponse) + +/** + * Streams batches of document updates and deletes, in order. + */ +- (void)writeWithRequestsWriter:(GRXWriter *)requestWriter eventHandler:(void(^)(BOOL done, GCFSWriteResponse *_Nullable response, NSError *_Nullable error))eventHandler; + +/** + * Streams batches of document updates and deletes, in order. + */ +- (GRPCProtoCall *)RPCToWriteWithRequestsWriter:(GRXWriter *)requestWriter eventHandler:(void(^)(BOOL done, GCFSWriteResponse *_Nullable response, NSError *_Nullable error))eventHandler; + + +#pragma mark Listen(stream ListenRequest) returns (stream ListenResponse) + +/** + * Listens to changes. + */ +- (void)listenWithRequestsWriter:(GRXWriter *)requestWriter eventHandler:(void(^)(BOOL done, GCFSListenResponse *_Nullable response, NSError *_Nullable error))eventHandler; + +/** + * Listens to changes. + */ +- (GRPCProtoCall *)RPCToListenWithRequestsWriter:(GRXWriter *)requestWriter eventHandler:(void(^)(BOOL done, GCFSListenResponse *_Nullable response, NSError *_Nullable error))eventHandler; + + +#pragma mark ListCollectionIds(ListCollectionIdsRequest) returns (ListCollectionIdsResponse) + +/** + * Lists all the collection IDs underneath a document. + */ +- (void)listCollectionIdsWithRequest:(GCFSListCollectionIdsRequest *)request handler:(void(^)(GCFSListCollectionIdsResponse *_Nullable response, NSError *_Nullable error))handler; + +/** + * Lists all the collection IDs underneath a document. + */ +- (GRPCProtoCall *)RPCToListCollectionIdsWithRequest:(GCFSListCollectionIdsRequest *)request handler:(void(^)(GCFSListCollectionIdsResponse *_Nullable response, NSError *_Nullable error))handler; + + +@end + +/** + * Basic service implementation, over gRPC, that only does + * marshalling and parsing. + */ +@interface GCFSFirestore : GRPCProtoService<GCFSFirestore> +- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER; ++ (instancetype)serviceWithHost:(NSString *)host; +@end + +NS_ASSUME_NONNULL_END diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.m b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.m new file mode 100644 index 0000000..a3e338d --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbrpc.m @@ -0,0 +1,281 @@ +/* + * 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. + */ + +#import "Firestore.pbrpc.h" + +#import <ProtoRPC/ProtoRPC.h> +#import <RxLibrary/GRXWriter+Immediate.h> + +@implementation GCFSFirestore + +// Designated initializer +- (instancetype)initWithHost:(NSString *)host { + return (self = [super initWithHost:host packageName:@"google.firestore.v1beta1" serviceName:@"Firestore"]); +} + +// Override superclass initializer to disallow different package and service names. +- (instancetype)initWithHost:(NSString *)host + packageName:(NSString *)packageName + serviceName:(NSString *)serviceName { + return [self initWithHost:host]; +} + ++ (instancetype)serviceWithHost:(NSString *)host { + return [[self alloc] initWithHost:host]; +} + + +#pragma mark GetDocument(GetDocumentRequest) returns (Document) + +/** + * Gets a single document. + */ +- (void)getDocumentWithRequest:(GCFSGetDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCToGetDocumentWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Gets a single document. + */ +- (GRPCProtoCall *)RPCToGetDocumentWithRequest:(GCFSGetDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"GetDocument" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GCFSDocument class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +#pragma mark ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) + +/** + * Lists documents. + */ +- (void)listDocumentsWithRequest:(GCFSListDocumentsRequest *)request handler:(void(^)(GCFSListDocumentsResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCToListDocumentsWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Lists documents. + */ +- (GRPCProtoCall *)RPCToListDocumentsWithRequest:(GCFSListDocumentsRequest *)request handler:(void(^)(GCFSListDocumentsResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"ListDocuments" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GCFSListDocumentsResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +#pragma mark CreateDocument(CreateDocumentRequest) returns (Document) + +/** + * Creates a new document. + */ +- (void)createDocumentWithRequest:(GCFSCreateDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCToCreateDocumentWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Creates a new document. + */ +- (GRPCProtoCall *)RPCToCreateDocumentWithRequest:(GCFSCreateDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"CreateDocument" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GCFSDocument class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +#pragma mark UpdateDocument(UpdateDocumentRequest) returns (Document) + +/** + * Updates or inserts a document. + */ +- (void)updateDocumentWithRequest:(GCFSUpdateDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCToUpdateDocumentWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Updates or inserts a document. + */ +- (GRPCProtoCall *)RPCToUpdateDocumentWithRequest:(GCFSUpdateDocumentRequest *)request handler:(void(^)(GCFSDocument *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"UpdateDocument" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GCFSDocument class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +#pragma mark DeleteDocument(DeleteDocumentRequest) returns (Empty) + +/** + * Deletes a document. + */ +- (void)deleteDocumentWithRequest:(GCFSDeleteDocumentRequest *)request handler:(void(^)(GPBEmpty *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCToDeleteDocumentWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Deletes a document. + */ +- (GRPCProtoCall *)RPCToDeleteDocumentWithRequest:(GCFSDeleteDocumentRequest *)request handler:(void(^)(GPBEmpty *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"DeleteDocument" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GPBEmpty class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +#pragma mark BatchGetDocuments(BatchGetDocumentsRequest) returns (stream BatchGetDocumentsResponse) + +/** + * Gets multiple documents. + * + * Documents returned by this method are not guaranteed to be returned in the + * same order that they were requested. + */ +- (void)batchGetDocumentsWithRequest:(GCFSBatchGetDocumentsRequest *)request eventHandler:(void(^)(BOOL done, GCFSBatchGetDocumentsResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + [[self RPCToBatchGetDocumentsWithRequest:request eventHandler:eventHandler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Gets multiple documents. + * + * Documents returned by this method are not guaranteed to be returned in the + * same order that they were requested. + */ +- (GRPCProtoCall *)RPCToBatchGetDocumentsWithRequest:(GCFSBatchGetDocumentsRequest *)request eventHandler:(void(^)(BOOL done, GCFSBatchGetDocumentsResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + return [self RPCToMethod:@"BatchGetDocuments" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GCFSBatchGetDocumentsResponse class] + responsesWriteable:[GRXWriteable writeableWithEventHandler:eventHandler]]; +} +#pragma mark BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse) + +/** + * Starts a new transaction. + */ +- (void)beginTransactionWithRequest:(GCFSBeginTransactionRequest *)request handler:(void(^)(GCFSBeginTransactionResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCToBeginTransactionWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Starts a new transaction. + */ +- (GRPCProtoCall *)RPCToBeginTransactionWithRequest:(GCFSBeginTransactionRequest *)request handler:(void(^)(GCFSBeginTransactionResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"BeginTransaction" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GCFSBeginTransactionResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +#pragma mark Commit(CommitRequest) returns (CommitResponse) + +/** + * Commits a transaction, while optionally updating documents. + */ +- (void)commitWithRequest:(GCFSCommitRequest *)request handler:(void(^)(GCFSCommitResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCToCommitWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Commits a transaction, while optionally updating documents. + */ +- (GRPCProtoCall *)RPCToCommitWithRequest:(GCFSCommitRequest *)request handler:(void(^)(GCFSCommitResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"Commit" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GCFSCommitResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +#pragma mark Rollback(RollbackRequest) returns (Empty) + +/** + * Rolls back a transaction. + */ +- (void)rollbackWithRequest:(GCFSRollbackRequest *)request handler:(void(^)(GPBEmpty *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCToRollbackWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Rolls back a transaction. + */ +- (GRPCProtoCall *)RPCToRollbackWithRequest:(GCFSRollbackRequest *)request handler:(void(^)(GPBEmpty *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"Rollback" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GPBEmpty class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +#pragma mark RunQuery(RunQueryRequest) returns (stream RunQueryResponse) + +/** + * Runs a query. + */ +- (void)runQueryWithRequest:(GCFSRunQueryRequest *)request eventHandler:(void(^)(BOOL done, GCFSRunQueryResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + [[self RPCToRunQueryWithRequest:request eventHandler:eventHandler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Runs a query. + */ +- (GRPCProtoCall *)RPCToRunQueryWithRequest:(GCFSRunQueryRequest *)request eventHandler:(void(^)(BOOL done, GCFSRunQueryResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + return [self RPCToMethod:@"RunQuery" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GCFSRunQueryResponse class] + responsesWriteable:[GRXWriteable writeableWithEventHandler:eventHandler]]; +} +#pragma mark Write(stream WriteRequest) returns (stream WriteResponse) + +/** + * Streams batches of document updates and deletes, in order. + */ +- (void)writeWithRequestsWriter:(GRXWriter *)requestWriter eventHandler:(void(^)(BOOL done, GCFSWriteResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + [[self RPCToWriteWithRequestsWriter:requestWriter eventHandler:eventHandler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Streams batches of document updates and deletes, in order. + */ +- (GRPCProtoCall *)RPCToWriteWithRequestsWriter:(GRXWriter *)requestWriter eventHandler:(void(^)(BOOL done, GCFSWriteResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + return [self RPCToMethod:@"Write" + requestsWriter:requestWriter + responseClass:[GCFSWriteResponse class] + responsesWriteable:[GRXWriteable writeableWithEventHandler:eventHandler]]; +} +#pragma mark Listen(stream ListenRequest) returns (stream ListenResponse) + +/** + * Listens to changes. + */ +- (void)listenWithRequestsWriter:(GRXWriter *)requestWriter eventHandler:(void(^)(BOOL done, GCFSListenResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + [[self RPCToListenWithRequestsWriter:requestWriter eventHandler:eventHandler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Listens to changes. + */ +- (GRPCProtoCall *)RPCToListenWithRequestsWriter:(GRXWriter *)requestWriter eventHandler:(void(^)(BOOL done, GCFSListenResponse *_Nullable response, NSError *_Nullable error))eventHandler{ + return [self RPCToMethod:@"Listen" + requestsWriter:requestWriter + responseClass:[GCFSListenResponse class] + responsesWriteable:[GRXWriteable writeableWithEventHandler:eventHandler]]; +} +#pragma mark ListCollectionIds(ListCollectionIdsRequest) returns (ListCollectionIdsResponse) + +/** + * Lists all the collection IDs underneath a document. + */ +- (void)listCollectionIdsWithRequest:(GCFSListCollectionIdsRequest *)request handler:(void(^)(GCFSListCollectionIdsResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCToListCollectionIdsWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * Lists all the collection IDs underneath a document. + */ +- (GRPCProtoCall *)RPCToListCollectionIdsWithRequest:(GCFSListCollectionIdsRequest *)request handler:(void(^)(GCFSListCollectionIdsResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"ListCollectionIds" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GCFSListCollectionIdsResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +@end diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h new file mode 100644 index 0000000..c2d80e7 --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h @@ -0,0 +1,579 @@ +/* + * 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: google/firestore/v1beta1/query.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 GCFSCursor; +@class GCFSStructuredQuery_CollectionSelector; +@class GCFSStructuredQuery_CompositeFilter; +@class GCFSStructuredQuery_FieldFilter; +@class GCFSStructuredQuery_FieldReference; +@class GCFSStructuredQuery_Filter; +@class GCFSStructuredQuery_Order; +@class GCFSStructuredQuery_Projection; +@class GCFSStructuredQuery_UnaryFilter; +@class GCFSValue; +@class GPBInt32Value; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - Enum GCFSStructuredQuery_Direction + +/** A sort direction. */ +typedef GPB_ENUM(GCFSStructuredQuery_Direction) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GCFSStructuredQuery_Direction_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Unspecified. */ + GCFSStructuredQuery_Direction_DirectionUnspecified = 0, + + /** Ascending. */ + GCFSStructuredQuery_Direction_Ascending = 1, + + /** Descending. */ + GCFSStructuredQuery_Direction_Descending = 2, +}; + +GPBEnumDescriptor *GCFSStructuredQuery_Direction_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GCFSStructuredQuery_Direction_IsValidValue(int32_t value); + +#pragma mark - Enum GCFSStructuredQuery_CompositeFilter_Operator + +/** A composite filter operator. */ +typedef GPB_ENUM(GCFSStructuredQuery_CompositeFilter_Operator) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GCFSStructuredQuery_CompositeFilter_Operator_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Unspecified. This value must not be used. */ + GCFSStructuredQuery_CompositeFilter_Operator_OperatorUnspecified = 0, + + /** The results are required to satisfy each of the combined filters. */ + GCFSStructuredQuery_CompositeFilter_Operator_And = 1, +}; + +GPBEnumDescriptor *GCFSStructuredQuery_CompositeFilter_Operator_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GCFSStructuredQuery_CompositeFilter_Operator_IsValidValue(int32_t value); + +#pragma mark - Enum GCFSStructuredQuery_FieldFilter_Operator + +/** A field filter operator. */ +typedef GPB_ENUM(GCFSStructuredQuery_FieldFilter_Operator) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GCFSStructuredQuery_FieldFilter_Operator_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Unspecified. This value must not be used. */ + GCFSStructuredQuery_FieldFilter_Operator_OperatorUnspecified = 0, + + /** Less than. Requires that the field come first in `order_by`. */ + GCFSStructuredQuery_FieldFilter_Operator_LessThan = 1, + + /** Less than or equal. Requires that the field come first in `order_by`. */ + GCFSStructuredQuery_FieldFilter_Operator_LessThanOrEqual = 2, + + /** Greater than. Requires that the field come first in `order_by`. */ + GCFSStructuredQuery_FieldFilter_Operator_GreaterThan = 3, + + /** + * Greater than or equal. Requires that the field come first in + * `order_by`. + **/ + GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual = 4, + + /** Equal. */ + GCFSStructuredQuery_FieldFilter_Operator_Equal = 5, +}; + +GPBEnumDescriptor *GCFSStructuredQuery_FieldFilter_Operator_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GCFSStructuredQuery_FieldFilter_Operator_IsValidValue(int32_t value); + +#pragma mark - Enum GCFSStructuredQuery_UnaryFilter_Operator + +/** A unary operator. */ +typedef GPB_ENUM(GCFSStructuredQuery_UnaryFilter_Operator) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GCFSStructuredQuery_UnaryFilter_Operator_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Unspecified. This value must not be used. */ + GCFSStructuredQuery_UnaryFilter_Operator_OperatorUnspecified = 0, + + /** Test if a field is equal to NaN. */ + GCFSStructuredQuery_UnaryFilter_Operator_IsNan = 2, + + /** Test if an exprestion evaluates to Null. */ + GCFSStructuredQuery_UnaryFilter_Operator_IsNull = 3, +}; + +GPBEnumDescriptor *GCFSStructuredQuery_UnaryFilter_Operator_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GCFSStructuredQuery_UnaryFilter_Operator_IsValidValue(int32_t value); + +#pragma mark - GCFSQueryRoot + +/** + * 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 GCFSQueryRoot : GPBRootObject +@end + +#pragma mark - GCFSStructuredQuery + +typedef GPB_ENUM(GCFSStructuredQuery_FieldNumber) { + GCFSStructuredQuery_FieldNumber_Select = 1, + GCFSStructuredQuery_FieldNumber_FromArray = 2, + GCFSStructuredQuery_FieldNumber_Where = 3, + GCFSStructuredQuery_FieldNumber_OrderByArray = 4, + GCFSStructuredQuery_FieldNumber_Limit = 5, + GCFSStructuredQuery_FieldNumber_Offset = 6, + GCFSStructuredQuery_FieldNumber_StartAt = 7, + GCFSStructuredQuery_FieldNumber_EndAt = 8, +}; + +/** + * A Firestore query. + **/ +@interface GCFSStructuredQuery : GPBMessage + +/** The projection to return. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_Projection *select; +/** Test to see if @c select has been set. */ +@property(nonatomic, readwrite) BOOL hasSelect; + +/** The collections to query. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSStructuredQuery_CollectionSelector*> *fromArray; +/** The number of items in @c fromArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger fromArray_Count; + +/** The filter to apply. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_Filter *where; +/** Test to see if @c where has been set. */ +@property(nonatomic, readwrite) BOOL hasWhere; + +/** + * The order to apply to the query results. + * + * Firestore guarantees a stable ordering through the following rules: + * + * * Any field required to appear in `order_by`, that is not already + * specified in `order_by`, is appended to the order in field name order + * by default. + * * If an order on `__name__` is not specified, it is appended by default. + * + * Fields are appended with the same sort direction as the last order + * specified, or 'ASCENDING' if no order was specified. For example: + * + * * `SELECT * FROM Foo ORDER BY A` becomes + * `SELECT * FROM Foo ORDER BY A, __name__` + * * `SELECT * FROM Foo ORDER BY A DESC` becomes + * `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC` + * * `SELECT * FROM Foo WHERE A > 1` becomes + * `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__` + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSStructuredQuery_Order*> *orderByArray; +/** The number of items in @c orderByArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger orderByArray_Count; + +/** A starting point for the query results. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSCursor *startAt; +/** Test to see if @c startAt has been set. */ +@property(nonatomic, readwrite) BOOL hasStartAt; + +/** A end point for the query results. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSCursor *endAt; +/** Test to see if @c endAt has been set. */ +@property(nonatomic, readwrite) BOOL hasEndAt; + +/** + * The number of results to skip. + * + * Applies before limit, but after all other constraints. Must be >= 0 if + * specified. + **/ +@property(nonatomic, readwrite) int32_t offset; + +/** + * The maximum number of results to return. + * + * Applies after all other constraints. + * Must be >= 0 if specified. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Value *limit; +/** Test to see if @c limit has been set. */ +@property(nonatomic, readwrite) BOOL hasLimit; + +@end + +#pragma mark - GCFSStructuredQuery_CollectionSelector + +typedef GPB_ENUM(GCFSStructuredQuery_CollectionSelector_FieldNumber) { + GCFSStructuredQuery_CollectionSelector_FieldNumber_CollectionId = 2, + GCFSStructuredQuery_CollectionSelector_FieldNumber_AllDescendants = 3, +}; + +/** + * A selection of a collection, such as `messages as m1`. + **/ +@interface GCFSStructuredQuery_CollectionSelector : GPBMessage + +/** + * The collection ID. + * When set, selects only collections with this ID. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *collectionId; + +/** + * When false, selects only collections that are immediate children of + * the `parent` specified in the containing `RunQueryRequest`. + * When true, selects all descendant collections. + **/ +@property(nonatomic, readwrite) BOOL allDescendants; + +@end + +#pragma mark - GCFSStructuredQuery_Filter + +typedef GPB_ENUM(GCFSStructuredQuery_Filter_FieldNumber) { + GCFSStructuredQuery_Filter_FieldNumber_CompositeFilter = 1, + GCFSStructuredQuery_Filter_FieldNumber_FieldFilter = 2, + GCFSStructuredQuery_Filter_FieldNumber_UnaryFilter = 3, +}; + +typedef GPB_ENUM(GCFSStructuredQuery_Filter_FilterType_OneOfCase) { + GCFSStructuredQuery_Filter_FilterType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSStructuredQuery_Filter_FilterType_OneOfCase_CompositeFilter = 1, + GCFSStructuredQuery_Filter_FilterType_OneOfCase_FieldFilter = 2, + GCFSStructuredQuery_Filter_FilterType_OneOfCase_UnaryFilter = 3, +}; + +/** + * A filter. + **/ +@interface GCFSStructuredQuery_Filter : GPBMessage + +/** The type of filter. */ +@property(nonatomic, readonly) GCFSStructuredQuery_Filter_FilterType_OneOfCase filterTypeOneOfCase; + +/** A composite filter. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_CompositeFilter *compositeFilter; + +/** A filter on a document field. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_FieldFilter *fieldFilter; + +/** A filter that takes exactly one argument. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_UnaryFilter *unaryFilter; + +@end + +/** + * Clears whatever value was set for the oneof 'filterType'. + **/ +void GCFSStructuredQuery_Filter_ClearFilterTypeOneOfCase(GCFSStructuredQuery_Filter *message); + +#pragma mark - GCFSStructuredQuery_CompositeFilter + +typedef GPB_ENUM(GCFSStructuredQuery_CompositeFilter_FieldNumber) { + GCFSStructuredQuery_CompositeFilter_FieldNumber_Op = 1, + GCFSStructuredQuery_CompositeFilter_FieldNumber_FiltersArray = 2, +}; + +/** + * A filter that merges multiple other filters using the given operator. + **/ +@interface GCFSStructuredQuery_CompositeFilter : GPBMessage + +/** The operator for combining multiple filters. */ +@property(nonatomic, readwrite) GCFSStructuredQuery_CompositeFilter_Operator op; + +/** + * The list of filters to combine. + * Must contain at least one filter. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSStructuredQuery_Filter*> *filtersArray; +/** The number of items in @c filtersArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger filtersArray_Count; + +@end + +/** + * Fetches the raw value of a @c GCFSStructuredQuery_CompositeFilter's @c op property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GCFSStructuredQuery_CompositeFilter_Op_RawValue(GCFSStructuredQuery_CompositeFilter *message); +/** + * Sets the raw value of an @c GCFSStructuredQuery_CompositeFilter's @c op property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGCFSStructuredQuery_CompositeFilter_Op_RawValue(GCFSStructuredQuery_CompositeFilter *message, int32_t value); + +#pragma mark - GCFSStructuredQuery_FieldFilter + +typedef GPB_ENUM(GCFSStructuredQuery_FieldFilter_FieldNumber) { + GCFSStructuredQuery_FieldFilter_FieldNumber_Field = 1, + GCFSStructuredQuery_FieldFilter_FieldNumber_Op = 2, + GCFSStructuredQuery_FieldFilter_FieldNumber_Value = 3, +}; + +/** + * A filter on a specific field. + **/ +@interface GCFSStructuredQuery_FieldFilter : GPBMessage + +/** The field to filter by. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_FieldReference *field; +/** Test to see if @c field has been set. */ +@property(nonatomic, readwrite) BOOL hasField; + +/** The operator to filter by. */ +@property(nonatomic, readwrite) GCFSStructuredQuery_FieldFilter_Operator op; + +/** The value to compare to. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSValue *value; +/** Test to see if @c value has been set. */ +@property(nonatomic, readwrite) BOOL hasValue; + +@end + +/** + * Fetches the raw value of a @c GCFSStructuredQuery_FieldFilter's @c op property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GCFSStructuredQuery_FieldFilter_Op_RawValue(GCFSStructuredQuery_FieldFilter *message); +/** + * Sets the raw value of an @c GCFSStructuredQuery_FieldFilter's @c op property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGCFSStructuredQuery_FieldFilter_Op_RawValue(GCFSStructuredQuery_FieldFilter *message, int32_t value); + +#pragma mark - GCFSStructuredQuery_UnaryFilter + +typedef GPB_ENUM(GCFSStructuredQuery_UnaryFilter_FieldNumber) { + GCFSStructuredQuery_UnaryFilter_FieldNumber_Op = 1, + GCFSStructuredQuery_UnaryFilter_FieldNumber_Field = 2, +}; + +typedef GPB_ENUM(GCFSStructuredQuery_UnaryFilter_OperandType_OneOfCase) { + GCFSStructuredQuery_UnaryFilter_OperandType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSStructuredQuery_UnaryFilter_OperandType_OneOfCase_Field = 2, +}; + +/** + * A filter with a single operand. + **/ +@interface GCFSStructuredQuery_UnaryFilter : GPBMessage + +/** The unary operator to apply. */ +@property(nonatomic, readwrite) GCFSStructuredQuery_UnaryFilter_Operator op; + +/** The argument to the filter. */ +@property(nonatomic, readonly) GCFSStructuredQuery_UnaryFilter_OperandType_OneOfCase operandTypeOneOfCase; + +/** The field to which to apply the operator. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_FieldReference *field; + +@end + +/** + * Fetches the raw value of a @c GCFSStructuredQuery_UnaryFilter's @c op property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GCFSStructuredQuery_UnaryFilter_Op_RawValue(GCFSStructuredQuery_UnaryFilter *message); +/** + * Sets the raw value of an @c GCFSStructuredQuery_UnaryFilter's @c op property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGCFSStructuredQuery_UnaryFilter_Op_RawValue(GCFSStructuredQuery_UnaryFilter *message, int32_t value); + +/** + * Clears whatever value was set for the oneof 'operandType'. + **/ +void GCFSStructuredQuery_UnaryFilter_ClearOperandTypeOneOfCase(GCFSStructuredQuery_UnaryFilter *message); + +#pragma mark - GCFSStructuredQuery_Order + +typedef GPB_ENUM(GCFSStructuredQuery_Order_FieldNumber) { + GCFSStructuredQuery_Order_FieldNumber_Field = 1, + GCFSStructuredQuery_Order_FieldNumber_Direction = 2, +}; + +/** + * An order on a field. + **/ +@interface GCFSStructuredQuery_Order : GPBMessage + +/** The field to order by. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_FieldReference *field; +/** Test to see if @c field has been set. */ +@property(nonatomic, readwrite) BOOL hasField; + +/** The direction to order by. Defaults to `ASCENDING`. */ +@property(nonatomic, readwrite) GCFSStructuredQuery_Direction direction; + +@end + +/** + * Fetches the raw value of a @c GCFSStructuredQuery_Order's @c direction property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GCFSStructuredQuery_Order_Direction_RawValue(GCFSStructuredQuery_Order *message); +/** + * Sets the raw value of an @c GCFSStructuredQuery_Order's @c direction property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGCFSStructuredQuery_Order_Direction_RawValue(GCFSStructuredQuery_Order *message, int32_t value); + +#pragma mark - GCFSStructuredQuery_FieldReference + +typedef GPB_ENUM(GCFSStructuredQuery_FieldReference_FieldNumber) { + GCFSStructuredQuery_FieldReference_FieldNumber_FieldPath = 2, +}; + +/** + * A reference to a field, such as `max(messages.time) as max_time`. + **/ +@interface GCFSStructuredQuery_FieldReference : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSString *fieldPath; + +@end + +#pragma mark - GCFSStructuredQuery_Projection + +typedef GPB_ENUM(GCFSStructuredQuery_Projection_FieldNumber) { + GCFSStructuredQuery_Projection_FieldNumber_FieldsArray = 2, +}; + +/** + * The projection of document's fields to return. + **/ +@interface GCFSStructuredQuery_Projection : GPBMessage + +/** + * The fields to return. + * + * If empty, all fields are returned. To only return the name + * of the document, use `['__name__']`. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSStructuredQuery_FieldReference*> *fieldsArray; +/** The number of items in @c fieldsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger fieldsArray_Count; + +@end + +#pragma mark - GCFSCursor + +typedef GPB_ENUM(GCFSCursor_FieldNumber) { + GCFSCursor_FieldNumber_ValuesArray = 1, + GCFSCursor_FieldNumber_Before = 2, +}; + +/** + * A position in a query result set. + **/ +@interface GCFSCursor : GPBMessage + +/** + * The values that represent a position, in the order they appear in + * the order by clause of a query. + * + * Can contain fewer values than specified in the order by clause. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSValue*> *valuesArray; +/** The number of items in @c valuesArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger valuesArray_Count; + +/** + * If the position is just before or just after the given values, relative + * to the sort order defined by the query. + **/ +@property(nonatomic, readwrite) BOOL before; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.m b/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.m new file mode 100644 index 0000000..804a5d0 --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.m @@ -0,0 +1,907 @@ +/* + * 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: google/firestore/v1beta1/query.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/Wrappers.pbobjc.h> +#else + #import "Wrappers.pbobjc.h" +#endif + + #import "Query.pbobjc.h" + #import "Annotations.pbobjc.h" + #import "Document.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 - GCFSQueryRoot + +@implementation GCFSQueryRoot + + +@end + +#pragma mark - GCFSQueryRoot_FileDescriptor + +static GPBFileDescriptor *GCFSQueryRoot_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:@"google.firestore.v1beta1" + objcPrefix:@"GCFS" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GCFSStructuredQuery + +@implementation GCFSStructuredQuery + +@dynamic hasSelect, select; +@dynamic fromArray, fromArray_Count; +@dynamic hasWhere, where; +@dynamic orderByArray, orderByArray_Count; +@dynamic hasStartAt, startAt; +@dynamic hasEndAt, endAt; +@dynamic offset; +@dynamic hasLimit, limit; + +typedef struct GCFSStructuredQuery__storage_ { + uint32_t _has_storage_[1]; + int32_t offset; + GCFSStructuredQuery_Projection *select; + NSMutableArray *fromArray; + GCFSStructuredQuery_Filter *where; + NSMutableArray *orderByArray; + GPBInt32Value *limit; + GCFSCursor *startAt; + GCFSCursor *endAt; +} GCFSStructuredQuery__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 = "select", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_Projection), + .number = GCFSStructuredQuery_FieldNumber_Select, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, select), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "fromArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_CollectionSelector), + .number = GCFSStructuredQuery_FieldNumber_FromArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, fromArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "where", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_Filter), + .number = GCFSStructuredQuery_FieldNumber_Where, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, where), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "orderByArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_Order), + .number = GCFSStructuredQuery_FieldNumber_OrderByArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, orderByArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "limit", + .dataTypeSpecific.className = GPBStringifySymbol(GPBInt32Value), + .number = GCFSStructuredQuery_FieldNumber_Limit, + .hasIndex = 5, + .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, limit), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "offset", + .dataTypeSpecific.className = NULL, + .number = GCFSStructuredQuery_FieldNumber_Offset, + .hasIndex = 4, + .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, offset), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + { + .name = "startAt", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSCursor), + .number = GCFSStructuredQuery_FieldNumber_StartAt, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, startAt), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "endAt", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSCursor), + .number = GCFSStructuredQuery_FieldNumber_EndAt, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, endAt), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSStructuredQuery__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - Enum GCFSStructuredQuery_Direction + +GPBEnumDescriptor *GCFSStructuredQuery_Direction_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "DirectionUnspecified\000Ascending\000Descendin" + "g\000"; + static const int32_t values[] = { + GCFSStructuredQuery_Direction_DirectionUnspecified, + GCFSStructuredQuery_Direction_Ascending, + GCFSStructuredQuery_Direction_Descending, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSStructuredQuery_Direction) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GCFSStructuredQuery_Direction_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GCFSStructuredQuery_Direction_IsValidValue(int32_t value__) { + switch (value__) { + case GCFSStructuredQuery_Direction_DirectionUnspecified: + case GCFSStructuredQuery_Direction_Ascending: + case GCFSStructuredQuery_Direction_Descending: + return YES; + default: + return NO; + } +} + +#pragma mark - GCFSStructuredQuery_CollectionSelector + +@implementation GCFSStructuredQuery_CollectionSelector + +@dynamic collectionId; +@dynamic allDescendants; + +typedef struct GCFSStructuredQuery_CollectionSelector__storage_ { + uint32_t _has_storage_[1]; + NSString *collectionId; +} GCFSStructuredQuery_CollectionSelector__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 = "collectionId", + .dataTypeSpecific.className = NULL, + .number = GCFSStructuredQuery_CollectionSelector_FieldNumber_CollectionId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_CollectionSelector__storage_, collectionId), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "allDescendants", + .dataTypeSpecific.className = NULL, + .number = GCFSStructuredQuery_CollectionSelector_FieldNumber_AllDescendants, + .hasIndex = 1, + .offset = 2, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_CollectionSelector class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSStructuredQuery_CollectionSelector__storage_) + flags:GPBDescriptorInitializationFlag_None]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSStructuredQuery_Filter + +@implementation GCFSStructuredQuery_Filter + +@dynamic filterTypeOneOfCase; +@dynamic compositeFilter; +@dynamic fieldFilter; +@dynamic unaryFilter; + +typedef struct GCFSStructuredQuery_Filter__storage_ { + uint32_t _has_storage_[2]; + GCFSStructuredQuery_CompositeFilter *compositeFilter; + GCFSStructuredQuery_FieldFilter *fieldFilter; + GCFSStructuredQuery_UnaryFilter *unaryFilter; +} GCFSStructuredQuery_Filter__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 = "compositeFilter", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_CompositeFilter), + .number = GCFSStructuredQuery_Filter_FieldNumber_CompositeFilter, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_Filter__storage_, compositeFilter), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "fieldFilter", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldFilter), + .number = GCFSStructuredQuery_Filter_FieldNumber_FieldFilter, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_Filter__storage_, fieldFilter), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "unaryFilter", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_UnaryFilter), + .number = GCFSStructuredQuery_Filter_FieldNumber_UnaryFilter, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_Filter__storage_, unaryFilter), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_Filter class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSStructuredQuery_Filter__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "filterType", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSStructuredQuery_Filter_ClearFilterTypeOneOfCase(GCFSStructuredQuery_Filter *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSStructuredQuery_CompositeFilter + +@implementation GCFSStructuredQuery_CompositeFilter + +@dynamic op; +@dynamic filtersArray, filtersArray_Count; + +typedef struct GCFSStructuredQuery_CompositeFilter__storage_ { + uint32_t _has_storage_[1]; + GCFSStructuredQuery_CompositeFilter_Operator op; + NSMutableArray *filtersArray; +} GCFSStructuredQuery_CompositeFilter__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 = "op", + .dataTypeSpecific.enumDescFunc = GCFSStructuredQuery_CompositeFilter_Operator_EnumDescriptor, + .number = GCFSStructuredQuery_CompositeFilter_FieldNumber_Op, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_CompositeFilter__storage_, op), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + { + .name = "filtersArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_Filter), + .number = GCFSStructuredQuery_CompositeFilter_FieldNumber_FiltersArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_CompositeFilter__storage_, filtersArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_CompositeFilter class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSStructuredQuery_CompositeFilter__storage_) + flags:GPBDescriptorInitializationFlag_None]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GCFSStructuredQuery_CompositeFilter_Op_RawValue(GCFSStructuredQuery_CompositeFilter *message) { + GPBDescriptor *descriptor = [GCFSStructuredQuery_CompositeFilter descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_CompositeFilter_FieldNumber_Op]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGCFSStructuredQuery_CompositeFilter_Op_RawValue(GCFSStructuredQuery_CompositeFilter *message, int32_t value) { + GPBDescriptor *descriptor = [GCFSStructuredQuery_CompositeFilter descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_CompositeFilter_FieldNumber_Op]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - Enum GCFSStructuredQuery_CompositeFilter_Operator + +GPBEnumDescriptor *GCFSStructuredQuery_CompositeFilter_Operator_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "OperatorUnspecified\000And\000"; + static const int32_t values[] = { + GCFSStructuredQuery_CompositeFilter_Operator_OperatorUnspecified, + GCFSStructuredQuery_CompositeFilter_Operator_And, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSStructuredQuery_CompositeFilter_Operator) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GCFSStructuredQuery_CompositeFilter_Operator_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GCFSStructuredQuery_CompositeFilter_Operator_IsValidValue(int32_t value__) { + switch (value__) { + case GCFSStructuredQuery_CompositeFilter_Operator_OperatorUnspecified: + case GCFSStructuredQuery_CompositeFilter_Operator_And: + return YES; + default: + return NO; + } +} + +#pragma mark - GCFSStructuredQuery_FieldFilter + +@implementation GCFSStructuredQuery_FieldFilter + +@dynamic hasField, field; +@dynamic op; +@dynamic hasValue, value; + +typedef struct GCFSStructuredQuery_FieldFilter__storage_ { + uint32_t _has_storage_[1]; + GCFSStructuredQuery_FieldFilter_Operator op; + GCFSStructuredQuery_FieldReference *field; + GCFSValue *value; +} GCFSStructuredQuery_FieldFilter__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 = "field", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldReference), + .number = GCFSStructuredQuery_FieldFilter_FieldNumber_Field, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_FieldFilter__storage_, field), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "op", + .dataTypeSpecific.enumDescFunc = GCFSStructuredQuery_FieldFilter_Operator_EnumDescriptor, + .number = GCFSStructuredQuery_FieldFilter_FieldNumber_Op, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_FieldFilter__storage_, op), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + { + .name = "value", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), + .number = GCFSStructuredQuery_FieldFilter_FieldNumber_Value, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_FieldFilter__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_FieldFilter class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSStructuredQuery_FieldFilter__storage_) + flags:GPBDescriptorInitializationFlag_None]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GCFSStructuredQuery_FieldFilter_Op_RawValue(GCFSStructuredQuery_FieldFilter *message) { + GPBDescriptor *descriptor = [GCFSStructuredQuery_FieldFilter descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_FieldFilter_FieldNumber_Op]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGCFSStructuredQuery_FieldFilter_Op_RawValue(GCFSStructuredQuery_FieldFilter *message, int32_t value) { + GPBDescriptor *descriptor = [GCFSStructuredQuery_FieldFilter descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_FieldFilter_FieldNumber_Op]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - Enum GCFSStructuredQuery_FieldFilter_Operator + +GPBEnumDescriptor *GCFSStructuredQuery_FieldFilter_Operator_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "OperatorUnspecified\000LessThan\000LessThanOrE" + "qual\000GreaterThan\000GreaterThanOrEqual\000Equa" + "l\000"; + static const int32_t values[] = { + GCFSStructuredQuery_FieldFilter_Operator_OperatorUnspecified, + GCFSStructuredQuery_FieldFilter_Operator_LessThan, + GCFSStructuredQuery_FieldFilter_Operator_LessThanOrEqual, + GCFSStructuredQuery_FieldFilter_Operator_GreaterThan, + GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual, + GCFSStructuredQuery_FieldFilter_Operator_Equal, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSStructuredQuery_FieldFilter_Operator) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GCFSStructuredQuery_FieldFilter_Operator_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GCFSStructuredQuery_FieldFilter_Operator_IsValidValue(int32_t value__) { + switch (value__) { + case GCFSStructuredQuery_FieldFilter_Operator_OperatorUnspecified: + case GCFSStructuredQuery_FieldFilter_Operator_LessThan: + case GCFSStructuredQuery_FieldFilter_Operator_LessThanOrEqual: + case GCFSStructuredQuery_FieldFilter_Operator_GreaterThan: + case GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual: + case GCFSStructuredQuery_FieldFilter_Operator_Equal: + return YES; + default: + return NO; + } +} + +#pragma mark - GCFSStructuredQuery_UnaryFilter + +@implementation GCFSStructuredQuery_UnaryFilter + +@dynamic operandTypeOneOfCase; +@dynamic op; +@dynamic field; + +typedef struct GCFSStructuredQuery_UnaryFilter__storage_ { + uint32_t _has_storage_[2]; + GCFSStructuredQuery_UnaryFilter_Operator op; + GCFSStructuredQuery_FieldReference *field; +} GCFSStructuredQuery_UnaryFilter__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 = "op", + .dataTypeSpecific.enumDescFunc = GCFSStructuredQuery_UnaryFilter_Operator_EnumDescriptor, + .number = GCFSStructuredQuery_UnaryFilter_FieldNumber_Op, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_UnaryFilter__storage_, op), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + { + .name = "field", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldReference), + .number = GCFSStructuredQuery_UnaryFilter_FieldNumber_Field, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_UnaryFilter__storage_, field), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_UnaryFilter class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSStructuredQuery_UnaryFilter__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "operandType", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GCFSStructuredQuery_UnaryFilter_Op_RawValue(GCFSStructuredQuery_UnaryFilter *message) { + GPBDescriptor *descriptor = [GCFSStructuredQuery_UnaryFilter descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_UnaryFilter_FieldNumber_Op]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGCFSStructuredQuery_UnaryFilter_Op_RawValue(GCFSStructuredQuery_UnaryFilter *message, int32_t value) { + GPBDescriptor *descriptor = [GCFSStructuredQuery_UnaryFilter descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_UnaryFilter_FieldNumber_Op]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +void GCFSStructuredQuery_UnaryFilter_ClearOperandTypeOneOfCase(GCFSStructuredQuery_UnaryFilter *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - Enum GCFSStructuredQuery_UnaryFilter_Operator + +GPBEnumDescriptor *GCFSStructuredQuery_UnaryFilter_Operator_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "OperatorUnspecified\000IsNan\000IsNull\000"; + static const int32_t values[] = { + GCFSStructuredQuery_UnaryFilter_Operator_OperatorUnspecified, + GCFSStructuredQuery_UnaryFilter_Operator_IsNan, + GCFSStructuredQuery_UnaryFilter_Operator_IsNull, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSStructuredQuery_UnaryFilter_Operator) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GCFSStructuredQuery_UnaryFilter_Operator_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GCFSStructuredQuery_UnaryFilter_Operator_IsValidValue(int32_t value__) { + switch (value__) { + case GCFSStructuredQuery_UnaryFilter_Operator_OperatorUnspecified: + case GCFSStructuredQuery_UnaryFilter_Operator_IsNan: + case GCFSStructuredQuery_UnaryFilter_Operator_IsNull: + return YES; + default: + return NO; + } +} + +#pragma mark - GCFSStructuredQuery_Order + +@implementation GCFSStructuredQuery_Order + +@dynamic hasField, field; +@dynamic direction; + +typedef struct GCFSStructuredQuery_Order__storage_ { + uint32_t _has_storage_[1]; + GCFSStructuredQuery_Direction direction; + GCFSStructuredQuery_FieldReference *field; +} GCFSStructuredQuery_Order__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 = "field", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldReference), + .number = GCFSStructuredQuery_Order_FieldNumber_Field, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_Order__storage_, field), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "direction", + .dataTypeSpecific.enumDescFunc = GCFSStructuredQuery_Direction_EnumDescriptor, + .number = GCFSStructuredQuery_Order_FieldNumber_Direction, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_Order__storage_, direction), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_Order class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSStructuredQuery_Order__storage_) + flags:GPBDescriptorInitializationFlag_None]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GCFSStructuredQuery_Order_Direction_RawValue(GCFSStructuredQuery_Order *message) { + GPBDescriptor *descriptor = [GCFSStructuredQuery_Order descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_Order_FieldNumber_Direction]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGCFSStructuredQuery_Order_Direction_RawValue(GCFSStructuredQuery_Order *message, int32_t value) { + GPBDescriptor *descriptor = [GCFSStructuredQuery_Order descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_Order_FieldNumber_Direction]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - GCFSStructuredQuery_FieldReference + +@implementation GCFSStructuredQuery_FieldReference + +@dynamic fieldPath; + +typedef struct GCFSStructuredQuery_FieldReference__storage_ { + uint32_t _has_storage_[1]; + NSString *fieldPath; +} GCFSStructuredQuery_FieldReference__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 = "fieldPath", + .dataTypeSpecific.className = NULL, + .number = GCFSStructuredQuery_FieldReference_FieldNumber_FieldPath, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_FieldReference__storage_, fieldPath), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_FieldReference class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSStructuredQuery_FieldReference__storage_) + flags:GPBDescriptorInitializationFlag_None]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSStructuredQuery_Projection + +@implementation GCFSStructuredQuery_Projection + +@dynamic fieldsArray, fieldsArray_Count; + +typedef struct GCFSStructuredQuery_Projection__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *fieldsArray; +} GCFSStructuredQuery_Projection__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 = "fieldsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldReference), + .number = GCFSStructuredQuery_Projection_FieldNumber_FieldsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSStructuredQuery_Projection__storage_, fieldsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_Projection class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSStructuredQuery_Projection__storage_) + flags:GPBDescriptorInitializationFlag_None]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSCursor + +@implementation GCFSCursor + +@dynamic valuesArray, valuesArray_Count; +@dynamic before; + +typedef struct GCFSCursor__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *valuesArray; +} GCFSCursor__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 = "valuesArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), + .number = GCFSCursor_FieldNumber_ValuesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSCursor__storage_, valuesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "before", + .dataTypeSpecific.className = NULL, + .number = GCFSCursor_FieldNumber_Before, + .hasIndex = 0, + .offset = 1, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSCursor class] + rootClass:[GCFSQueryRoot class] + file:GCFSQueryRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSCursor__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/google/firestore/v1beta1/Write.pbobjc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h new file mode 100644 index 0000000..c3c4498 --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h @@ -0,0 +1,432 @@ +/* + * 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: google/firestore/v1beta1/write.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 GCFSDocument; +@class GCFSDocumentMask; +@class GCFSDocumentTransform; +@class GCFSDocumentTransform_FieldTransform; +@class GCFSPrecondition; +@class GCFSValue; +@class GPBTimestamp; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - Enum GCFSDocumentTransform_FieldTransform_ServerValue + +/** A value that is calculated by the server. */ +typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_ServerValue) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GCFSDocumentTransform_FieldTransform_ServerValue_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Unspecified. This value must not be used. */ + GCFSDocumentTransform_FieldTransform_ServerValue_ServerValueUnspecified = 0, + + /** The time at which the server processed the request. */ + GCFSDocumentTransform_FieldTransform_ServerValue_RequestTime = 1, +}; + +GPBEnumDescriptor *GCFSDocumentTransform_FieldTransform_ServerValue_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GCFSDocumentTransform_FieldTransform_ServerValue_IsValidValue(int32_t value); + +#pragma mark - GCFSWriteRoot + +/** + * 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 GCFSWriteRoot : GPBRootObject +@end + +#pragma mark - GCFSWrite + +typedef GPB_ENUM(GCFSWrite_FieldNumber) { + GCFSWrite_FieldNumber_Update = 1, + GCFSWrite_FieldNumber_Delete_p = 2, + GCFSWrite_FieldNumber_UpdateMask = 3, + GCFSWrite_FieldNumber_CurrentDocument = 4, + GCFSWrite_FieldNumber_Verify = 5, + GCFSWrite_FieldNumber_Transform = 6, +}; + +typedef GPB_ENUM(GCFSWrite_Operation_OneOfCase) { + GCFSWrite_Operation_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSWrite_Operation_OneOfCase_Update = 1, + GCFSWrite_Operation_OneOfCase_Delete_p = 2, + GCFSWrite_Operation_OneOfCase_Verify = 5, + GCFSWrite_Operation_OneOfCase_Transform = 6, +}; + +/** + * A write on a document. + **/ +@interface GCFSWrite : GPBMessage + +/** The operation to execute. */ +@property(nonatomic, readonly) GCFSWrite_Operation_OneOfCase operationOneOfCase; + +/** A document to write. */ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *update; + +/** + * A document name to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *delete_p; + +/** + * The name of a document on which to verify the `current_document` + * precondition. + * This only requires read access to the document. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *verify; + +/** + * Applies a tranformation to a document. + * At most one `transform` per document is allowed in a given request. + * An `update` cannot follow a `transform` on the same document in a given + * request. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentTransform *transform; + +/** + * The fields to update in this write. + * + * This field can be set only when the operation is `update`. + * None of the field paths in the mask may contain a reserved name. + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * The field paths in this mask must not contain a reserved field name. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *updateMask; +/** Test to see if @c updateMask has been set. */ +@property(nonatomic, readwrite) BOOL hasUpdateMask; + +/** + * An optional precondition on the document. + * + * The write will fail if this is set and not met by the target document. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSPrecondition *currentDocument; +/** Test to see if @c currentDocument has been set. */ +@property(nonatomic, readwrite) BOOL hasCurrentDocument; + +@end + +/** + * Clears whatever value was set for the oneof 'operation'. + **/ +void GCFSWrite_ClearOperationOneOfCase(GCFSWrite *message); + +#pragma mark - GCFSDocumentTransform + +typedef GPB_ENUM(GCFSDocumentTransform_FieldNumber) { + GCFSDocumentTransform_FieldNumber_Document = 1, + GCFSDocumentTransform_FieldNumber_FieldTransformsArray = 2, +}; + +/** + * A transformation of a document. + **/ +@interface GCFSDocumentTransform : GPBMessage + +/** The name of the document to transform. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *document; + +/** + * The list of transformations to apply to the fields of the document, in + * order. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSDocumentTransform_FieldTransform*> *fieldTransformsArray; +/** The number of items in @c fieldTransformsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger fieldTransformsArray_Count; + +@end + +#pragma mark - GCFSDocumentTransform_FieldTransform + +typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_FieldNumber) { + GCFSDocumentTransform_FieldTransform_FieldNumber_FieldPath = 1, + GCFSDocumentTransform_FieldTransform_FieldNumber_SetToServerValue = 2, +}; + +typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase) { + GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_GPBUnsetOneOfCase = 0, + GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_SetToServerValue = 2, +}; + +/** + * A transformation of a field of the document. + **/ +@interface GCFSDocumentTransform_FieldTransform : GPBMessage + +/** + * The path of the field. See [Document.fields][google.firestore.v1beta1.Document.fields] for the field path syntax + * reference. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *fieldPath; + +/** The transformation to apply on the field. */ +@property(nonatomic, readonly) GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase transformTypeOneOfCase; + +/** Sets the field to the given server value. */ +@property(nonatomic, readwrite) GCFSDocumentTransform_FieldTransform_ServerValue setToServerValue; + +@end + +/** + * Fetches the raw value of a @c GCFSDocumentTransform_FieldTransform's @c setToServerValue property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GCFSDocumentTransform_FieldTransform_SetToServerValue_RawValue(GCFSDocumentTransform_FieldTransform *message); +/** + * Sets the raw value of an @c GCFSDocumentTransform_FieldTransform's @c setToServerValue property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGCFSDocumentTransform_FieldTransform_SetToServerValue_RawValue(GCFSDocumentTransform_FieldTransform *message, int32_t value); + +/** + * Clears whatever value was set for the oneof 'transformType'. + **/ +void GCFSDocumentTransform_FieldTransform_ClearTransformTypeOneOfCase(GCFSDocumentTransform_FieldTransform *message); + +#pragma mark - GCFSWriteResult + +typedef GPB_ENUM(GCFSWriteResult_FieldNumber) { + GCFSWriteResult_FieldNumber_UpdateTime = 1, + GCFSWriteResult_FieldNumber_TransformResultsArray = 2, +}; + +/** + * The result of applying a write. + **/ +@interface GCFSWriteResult : GPBMessage + +/** + * The last update time of the document after applying the write. Not set + * after a `delete`. + * + * If the write did not actually change the document, this will be the + * previous update_time. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *updateTime; +/** Test to see if @c updateTime has been set. */ +@property(nonatomic, readwrite) BOOL hasUpdateTime; + +/** + * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1beta1.DocumentTransform.FieldTransform], in the + * same order. + **/ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GCFSValue*> *transformResultsArray; +/** The number of items in @c transformResultsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger transformResultsArray_Count; + +@end + +#pragma mark - GCFSDocumentChange + +typedef GPB_ENUM(GCFSDocumentChange_FieldNumber) { + GCFSDocumentChange_FieldNumber_Document = 1, + GCFSDocumentChange_FieldNumber_TargetIdsArray = 5, + GCFSDocumentChange_FieldNumber_RemovedTargetIdsArray = 6, +}; + +/** + * A [Document][google.firestore.v1beta1.Document] has changed. + * + * May be the result of multiple [writes][google.firestore.v1beta1.Write], including deletes, that + * ultimately resulted in a new value for the [Document][google.firestore.v1beta1.Document]. + * + * Multiple [DocumentChange][google.firestore.v1beta1.DocumentChange] messages may be returned for the same logical + * change, if multiple targets are affected. + **/ +@interface GCFSDocumentChange : GPBMessage + +/** + * The new state of the [Document][google.firestore.v1beta1.Document]. + * + * If `mask` is set, contains only fields that were updated or added. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document; +/** Test to see if @c document has been set. */ +@property(nonatomic, readwrite) BOOL hasDocument; + +/** A set of target IDs of targets that match this document. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *targetIdsArray; +/** The number of items in @c targetIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger targetIdsArray_Count; + +/** A set of target IDs for targets that no longer match this document. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *removedTargetIdsArray; +/** The number of items in @c removedTargetIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger removedTargetIdsArray_Count; + +@end + +#pragma mark - GCFSDocumentDelete + +typedef GPB_ENUM(GCFSDocumentDelete_FieldNumber) { + GCFSDocumentDelete_FieldNumber_Document = 1, + GCFSDocumentDelete_FieldNumber_ReadTime = 4, + GCFSDocumentDelete_FieldNumber_RemovedTargetIdsArray = 6, +}; + +/** + * A [Document][google.firestore.v1beta1.Document] has been deleted. + * + * May be the result of multiple [writes][google.firestore.v1beta1.Write], including updates, the + * last of which deleted the [Document][google.firestore.v1beta1.Document]. + * + * Multiple [DocumentDelete][google.firestore.v1beta1.DocumentDelete] messages may be returned for the same logical + * delete, if multiple targets are affected. + **/ +@interface GCFSDocumentDelete : GPBMessage + +/** The resource name of the [Document][google.firestore.v1beta1.Document] that was deleted. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *document; + +/** A set of target IDs for targets that previously matched this entity. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *removedTargetIdsArray; +/** The number of items in @c removedTargetIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger removedTargetIdsArray_Count; + +/** + * The read timestamp at which the delete was observed. + * + * Greater or equal to the `commit_time` of the delete. + **/ +@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 - GCFSDocumentRemove + +typedef GPB_ENUM(GCFSDocumentRemove_FieldNumber) { + GCFSDocumentRemove_FieldNumber_Document = 1, + GCFSDocumentRemove_FieldNumber_RemovedTargetIdsArray = 2, + GCFSDocumentRemove_FieldNumber_ReadTime = 4, +}; + +/** + * A [Document][google.firestore.v1beta1.Document] has been removed from the view of the targets. + * + * Sent if the document is no longer relevant to a target and is out of view. + * Can be sent instead of a DocumentDelete or a DocumentChange if the server + * can not send the new value of the document. + * + * Multiple [DocumentRemove][google.firestore.v1beta1.DocumentRemove] messages may be returned for the same logical + * write or delete, if multiple targets are affected. + **/ +@interface GCFSDocumentRemove : GPBMessage + +/** The resource name of the [Document][google.firestore.v1beta1.Document] that has gone out of view. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *document; + +/** A set of target IDs for targets that previously matched this document. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *removedTargetIdsArray; +/** The number of items in @c removedTargetIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger removedTargetIdsArray_Count; + +/** + * The read timestamp at which the remove was observed. + * + * Greater or equal to the `commit_time` of the change/delete/remove. + **/ +@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 - GCFSExistenceFilter + +typedef GPB_ENUM(GCFSExistenceFilter_FieldNumber) { + GCFSExistenceFilter_FieldNumber_TargetId = 1, + GCFSExistenceFilter_FieldNumber_Count = 2, +}; + +/** + * A digest of all the documents that match a given target. + **/ +@interface GCFSExistenceFilter : GPBMessage + +/** The target ID to which this filter applies. */ +@property(nonatomic, readwrite) int32_t targetId; + +/** + * The total count of documents that match [target_id][google.firestore.v1beta1.ExistenceFilter.target_id]. + * + * If different from the count of documents in the client that match, the + * client must manually determine which documents no longer match the target. + **/ +@property(nonatomic, readwrite) int32_t count; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.m b/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.m new file mode 100644 index 0000000..e6fd0f4 --- /dev/null +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.m @@ -0,0 +1,653 @@ +/* + * 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: google/firestore/v1beta1/write.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 "Write.pbobjc.h" + #import "Annotations.pbobjc.h" + #import "Common.pbobjc.h" + #import "Document.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 - GCFSWriteRoot + +@implementation GCFSWriteRoot + + +@end + +#pragma mark - GCFSWriteRoot_FileDescriptor + +static GPBFileDescriptor *GCFSWriteRoot_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:@"google.firestore.v1beta1" + objcPrefix:@"GCFS" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GCFSWrite + +@implementation GCFSWrite + +@dynamic operationOneOfCase; +@dynamic update; +@dynamic delete_p; +@dynamic verify; +@dynamic transform; +@dynamic hasUpdateMask, updateMask; +@dynamic hasCurrentDocument, currentDocument; + +typedef struct GCFSWrite__storage_ { + uint32_t _has_storage_[2]; + GCFSDocument *update; + NSString *delete_p; + GCFSDocumentMask *updateMask; + GCFSPrecondition *currentDocument; + NSString *verify; + GCFSDocumentTransform *transform; +} GCFSWrite__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 = "update", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), + .number = GCFSWrite_FieldNumber_Update, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSWrite__storage_, update), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "delete_p", + .dataTypeSpecific.className = NULL, + .number = GCFSWrite_FieldNumber_Delete_p, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSWrite__storage_, delete_p), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "updateMask", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), + .number = GCFSWrite_FieldNumber_UpdateMask, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSWrite__storage_, updateMask), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "currentDocument", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSPrecondition), + .number = GCFSWrite_FieldNumber_CurrentDocument, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSWrite__storage_, currentDocument), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "verify", + .dataTypeSpecific.className = NULL, + .number = GCFSWrite_FieldNumber_Verify, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSWrite__storage_, verify), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "transform", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentTransform), + .number = GCFSWrite_FieldNumber_Transform, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSWrite__storage_, transform), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSWrite class] + rootClass:[GCFSWriteRoot class] + file:GCFSWriteRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSWrite__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "operation", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GCFSWrite_ClearOperationOneOfCase(GCFSWrite *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GCFSDocumentTransform + +@implementation GCFSDocumentTransform + +@dynamic document; +@dynamic fieldTransformsArray, fieldTransformsArray_Count; + +typedef struct GCFSDocumentTransform__storage_ { + uint32_t _has_storage_[1]; + NSString *document; + NSMutableArray *fieldTransformsArray; +} GCFSDocumentTransform__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 = "document", + .dataTypeSpecific.className = NULL, + .number = GCFSDocumentTransform_FieldNumber_Document, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSDocumentTransform__storage_, document), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "fieldTransformsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentTransform_FieldTransform), + .number = GCFSDocumentTransform_FieldNumber_FieldTransformsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSDocumentTransform__storage_, fieldTransformsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSDocumentTransform class] + rootClass:[GCFSWriteRoot class] + file:GCFSWriteRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSDocumentTransform__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSDocumentTransform_FieldTransform + +@implementation GCFSDocumentTransform_FieldTransform + +@dynamic transformTypeOneOfCase; +@dynamic fieldPath; +@dynamic setToServerValue; + +typedef struct GCFSDocumentTransform_FieldTransform__storage_ { + uint32_t _has_storage_[2]; + GCFSDocumentTransform_FieldTransform_ServerValue setToServerValue; + NSString *fieldPath; +} GCFSDocumentTransform_FieldTransform__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 = "fieldPath", + .dataTypeSpecific.className = NULL, + .number = GCFSDocumentTransform_FieldTransform_FieldNumber_FieldPath, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, fieldPath), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "setToServerValue", + .dataTypeSpecific.enumDescFunc = GCFSDocumentTransform_FieldTransform_ServerValue_EnumDescriptor, + .number = GCFSDocumentTransform_FieldTransform_FieldNumber_SetToServerValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, setToServerValue), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSDocumentTransform_FieldTransform class] + rootClass:[GCFSWriteRoot class] + file:GCFSWriteRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSDocumentTransform_FieldTransform__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "transformType", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSDocumentTransform)]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GCFSDocumentTransform_FieldTransform_SetToServerValue_RawValue(GCFSDocumentTransform_FieldTransform *message) { + GPBDescriptor *descriptor = [GCFSDocumentTransform_FieldTransform descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSDocumentTransform_FieldTransform_FieldNumber_SetToServerValue]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGCFSDocumentTransform_FieldTransform_SetToServerValue_RawValue(GCFSDocumentTransform_FieldTransform *message, int32_t value) { + GPBDescriptor *descriptor = [GCFSDocumentTransform_FieldTransform descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSDocumentTransform_FieldTransform_FieldNumber_SetToServerValue]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +void GCFSDocumentTransform_FieldTransform_ClearTransformTypeOneOfCase(GCFSDocumentTransform_FieldTransform *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - Enum GCFSDocumentTransform_FieldTransform_ServerValue + +GPBEnumDescriptor *GCFSDocumentTransform_FieldTransform_ServerValue_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "ServerValueUnspecified\000RequestTime\000"; + static const int32_t values[] = { + GCFSDocumentTransform_FieldTransform_ServerValue_ServerValueUnspecified, + GCFSDocumentTransform_FieldTransform_ServerValue_RequestTime, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSDocumentTransform_FieldTransform_ServerValue) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GCFSDocumentTransform_FieldTransform_ServerValue_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GCFSDocumentTransform_FieldTransform_ServerValue_IsValidValue(int32_t value__) { + switch (value__) { + case GCFSDocumentTransform_FieldTransform_ServerValue_ServerValueUnspecified: + case GCFSDocumentTransform_FieldTransform_ServerValue_RequestTime: + return YES; + default: + return NO; + } +} + +#pragma mark - GCFSWriteResult + +@implementation GCFSWriteResult + +@dynamic hasUpdateTime, updateTime; +@dynamic transformResultsArray, transformResultsArray_Count; + +typedef struct GCFSWriteResult__storage_ { + uint32_t _has_storage_[1]; + GPBTimestamp *updateTime; + NSMutableArray *transformResultsArray; +} GCFSWriteResult__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 = "updateTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSWriteResult_FieldNumber_UpdateTime, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSWriteResult__storage_, updateTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "transformResultsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), + .number = GCFSWriteResult_FieldNumber_TransformResultsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSWriteResult__storage_, transformResultsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSWriteResult class] + rootClass:[GCFSWriteRoot class] + file:GCFSWriteRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSWriteResult__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSDocumentChange + +@implementation GCFSDocumentChange + +@dynamic hasDocument, document; +@dynamic targetIdsArray, targetIdsArray_Count; +@dynamic removedTargetIdsArray, removedTargetIdsArray_Count; + +typedef struct GCFSDocumentChange__storage_ { + uint32_t _has_storage_[1]; + GCFSDocument *document; + GPBInt32Array *targetIdsArray; + GPBInt32Array *removedTargetIdsArray; +} GCFSDocumentChange__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 = "document", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), + .number = GCFSDocumentChange_FieldNumber_Document, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSDocumentChange__storage_, document), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "targetIdsArray", + .dataTypeSpecific.className = NULL, + .number = GCFSDocumentChange_FieldNumber_TargetIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSDocumentChange__storage_, targetIdsArray), + .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), + .dataType = GPBDataTypeInt32, + }, + { + .name = "removedTargetIdsArray", + .dataTypeSpecific.className = NULL, + .number = GCFSDocumentChange_FieldNumber_RemovedTargetIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSDocumentChange__storage_, removedTargetIdsArray), + .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), + .dataType = GPBDataTypeInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSDocumentChange class] + rootClass:[GCFSWriteRoot class] + file:GCFSWriteRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSDocumentChange__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSDocumentDelete + +@implementation GCFSDocumentDelete + +@dynamic document; +@dynamic removedTargetIdsArray, removedTargetIdsArray_Count; +@dynamic hasReadTime, readTime; + +typedef struct GCFSDocumentDelete__storage_ { + uint32_t _has_storage_[1]; + NSString *document; + GPBTimestamp *readTime; + GPBInt32Array *removedTargetIdsArray; +} GCFSDocumentDelete__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 = "document", + .dataTypeSpecific.className = NULL, + .number = GCFSDocumentDelete_FieldNumber_Document, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSDocumentDelete__storage_, document), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSDocumentDelete_FieldNumber_ReadTime, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSDocumentDelete__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "removedTargetIdsArray", + .dataTypeSpecific.className = NULL, + .number = GCFSDocumentDelete_FieldNumber_RemovedTargetIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSDocumentDelete__storage_, removedTargetIdsArray), + .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), + .dataType = GPBDataTypeInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSDocumentDelete class] + rootClass:[GCFSWriteRoot class] + file:GCFSWriteRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSDocumentDelete__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSDocumentRemove + +@implementation GCFSDocumentRemove + +@dynamic document; +@dynamic removedTargetIdsArray, removedTargetIdsArray_Count; +@dynamic hasReadTime, readTime; + +typedef struct GCFSDocumentRemove__storage_ { + uint32_t _has_storage_[1]; + NSString *document; + GPBInt32Array *removedTargetIdsArray; + GPBTimestamp *readTime; +} GCFSDocumentRemove__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 = "document", + .dataTypeSpecific.className = NULL, + .number = GCFSDocumentRemove_FieldNumber_Document, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSDocumentRemove__storage_, document), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "removedTargetIdsArray", + .dataTypeSpecific.className = NULL, + .number = GCFSDocumentRemove_FieldNumber_RemovedTargetIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GCFSDocumentRemove__storage_, removedTargetIdsArray), + .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), + .dataType = GPBDataTypeInt32, + }, + { + .name = "readTime", + .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), + .number = GCFSDocumentRemove_FieldNumber_ReadTime, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSDocumentRemove__storage_, readTime), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSDocumentRemove class] + rootClass:[GCFSWriteRoot class] + file:GCFSWriteRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSDocumentRemove__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GCFSExistenceFilter + +@implementation GCFSExistenceFilter + +@dynamic targetId; +@dynamic count; + +typedef struct GCFSExistenceFilter__storage_ { + uint32_t _has_storage_[1]; + int32_t targetId; + int32_t count; +} GCFSExistenceFilter__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 = GCFSExistenceFilter_FieldNumber_TargetId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GCFSExistenceFilter__storage_, targetId), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + { + .name = "count", + .dataTypeSpecific.className = NULL, + .number = GCFSExistenceFilter_FieldNumber_Count, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GCFSExistenceFilter__storage_, count), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GCFSExistenceFilter class] + rootClass:[GCFSWriteRoot class] + file:GCFSWriteRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GCFSExistenceFilter__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) |