From 6f2ef7d3899f05dae7eb03847d8dddf9b04a7738 Mon Sep 17 00:00:00 2001 From: Michael Lehenbauer Date: Thu, 12 Apr 2018 09:08:18 -0700 Subject: Update protos. (#1075) --- Firestore/Protos/objc/google/api/HTTP.pbobjc.h | 75 +++++++++++++++------- Firestore/Protos/objc/google/api/HTTP.pbobjc.m | 10 +++ .../google/firestore/v1beta1/Document.pbobjc.h | 4 +- .../google/firestore/v1beta1/Firestore.pbobjc.h | 5 +- .../objc/google/firestore/v1beta1/Query.pbobjc.h | 3 + .../objc/google/firestore/v1beta1/Query.pbobjc.m | 4 +- .../objc/google/firestore/v1beta1/Write.pbobjc.h | 57 ++++++++++++---- .../objc/google/firestore/v1beta1/Write.pbobjc.m | 33 ++++++---- 8 files changed, 136 insertions(+), 55 deletions(-) (limited to 'Firestore/Protos/objc') diff --git a/Firestore/Protos/objc/google/api/HTTP.pbobjc.h b/Firestore/Protos/objc/google/api/HTTP.pbobjc.h index 9cc00dc..c9e5bb5 100644 --- a/Firestore/Protos/objc/google/api/HTTP.pbobjc.h +++ b/Firestore/Protos/objc/google/api/HTTP.pbobjc.h @@ -67,10 +67,11 @@ NS_ASSUME_NONNULL_BEGIN typedef GPB_ENUM(GAPIHttp_FieldNumber) { GAPIHttp_FieldNumber_RulesArray = 1, + GAPIHttp_FieldNumber_FullyDecodeReservedExpansion = 2, }; /** - * Defines the HTTP configuration for a service. It contains a list of + * Defines the HTTP configuration for an API service. It contains a list of * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method * to one or more HTTP REST API methods. **/ @@ -85,6 +86,16 @@ typedef GPB_ENUM(GAPIHttp_FieldNumber) { /** The number of items in @c rulesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger rulesArray_Count; +/** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + **/ +@property(nonatomic, readwrite) BOOL fullyDecodeReservedExpansion; + @end #pragma mark - GAPIHttpRule @@ -113,11 +124,11 @@ typedef GPB_ENUM(GAPIHttpRule_Pattern_OneOfCase) { /** * `HttpRule` defines the mapping of an RPC method to one or more HTTP - * REST APIs. The mapping determines what portions of the request - * message are populated from the path, query parameters, or body of - * the HTTP request. The mapping is typically specified as an - * `google.api.http` annotation, see "google/api/annotations.proto" - * for details. + * REST API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and + * HTTP request body. The mapping is typically specified as an + * `google.api.http` annotation on the RPC method, + * see "google/api/annotations.proto" for details. * * The mapping consists of a field specifying the path template and * method kind. The path template can refer to fields in the request @@ -165,6 +176,11 @@ typedef GPB_ENUM(GAPIHttpRule_Pattern_OneOfCase) { * parameters. Assume the following definition of the request message: * * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}"; + * } + * } * message GetMessageRequest { * message SubMessage { * string subfield = 1; @@ -277,7 +293,7 @@ typedef GPB_ENUM(GAPIHttpRule_Pattern_OneOfCase) { * to the request message are as follows: * * 1. The `body` field specifies either `*` or a field path, or is - * omitted. If omitted, it assumes there is no HTTP body. + * omitted. If omitted, it indicates there is no HTTP request body. * 2. Leaf fields (recursive expansion of nested messages in the * request) can be classified into three types: * (a) Matched in the URL template. @@ -296,28 +312,34 @@ typedef GPB_ENUM(GAPIHttpRule_Pattern_OneOfCase) { * FieldPath = IDENT { "." IDENT } ; * Verb = ":" LITERAL ; * - * The syntax `*` matches a single path segment. It follows the semantics of - * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String - * Expansion. + * The syntax `*` matches a single path segment. The syntax `**` matches zero + * or more path segments, which must be the last part of the path except the + * `Verb`. The syntax `LITERAL` matches literal text in the path. * - * The syntax `**` matches zero or more path segments. It follows the semantics - * of [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.3 Reserved - * Expansion. NOTE: it must be the last segment in the path except the Verb. - * - * The syntax `LITERAL` matches literal text in the URL path. - * - * The syntax `Variable` matches the entire path as specified by its template; - * this nested template must not contain further variables. If a variable + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable * matches a single path segment, its template may be omitted, e.g. `{var}` * is equivalent to `{var=*}`. * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, all characters + * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the + * Discovery Document as `{var}`. + * + * If a variable contains one or more path segments, such as `"{var=foo/\*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path, all + * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{+var}`. + * + * NOTE: While the single segment variable matches the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 + * Simple String Expansion, the multi segment variable **does not** match + * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. + * * NOTE: the field paths in variables and in the `body` must not refer to * repeated fields or map fields. - * - * Use CustomHttpPattern to specify any HTTP method that is not included in the - * `pattern` field, such as HEAD, or "*" to leave the HTTP method unspecified for - * a given URL path rule. The wild-card rule is useful for services that provide - * content to Web (HTML) clients. **/ @interface GAPIHttpRule : GPBMessage @@ -350,7 +372,12 @@ typedef GPB_ENUM(GAPIHttpRule_Pattern_OneOfCase) { /** Used for updating a resource. */ @property(nonatomic, readwrite, copy, null_resettable) NSString *patch; -/** Custom pattern is used for defining custom verbs. */ +/** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + **/ @property(nonatomic, readwrite, strong, null_resettable) GAPICustomHttpPattern *custom; /** diff --git a/Firestore/Protos/objc/google/api/HTTP.pbobjc.m b/Firestore/Protos/objc/google/api/HTTP.pbobjc.m index 5adf41c..67d8732 100644 --- a/Firestore/Protos/objc/google/api/HTTP.pbobjc.m +++ b/Firestore/Protos/objc/google/api/HTTP.pbobjc.m @@ -65,6 +65,7 @@ static GPBFileDescriptor *GAPIHTTPRoot_FileDescriptor(void) { @implementation GAPIHttp @dynamic rulesArray, rulesArray_Count; +@dynamic fullyDecodeReservedExpansion; typedef struct GAPIHttp__storage_ { uint32_t _has_storage_[1]; @@ -86,6 +87,15 @@ typedef struct GAPIHttp__storage_ { .flags = GPBFieldRepeated, .dataType = GPBDataTypeMessage, }, + { + .name = "fullyDecodeReservedExpansion", + .dataTypeSpecific.className = NULL, + .number = GAPIHttp_FieldNumber_FullyDecodeReservedExpansion, + .hasIndex = 0, + .offset = 1, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[GAPIHttp class] diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h index 3c5bfb1..b960b00 100644 --- a/Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Document.pbobjc.h @@ -95,7 +95,7 @@ typedef GPB_ENUM(GCFSDocument_FieldNumber) { * 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, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, * `foo_bar_17`. * * Field names matching the regular expression `__.*__` are reserved. Reserved @@ -133,7 +133,7 @@ typedef GPB_ENUM(GCFSDocument_FieldNumber) { /** * Output only. The time at which the document was last changed. * - * This value is initally set to the `create_time` then increases + * This value is initially 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. **/ diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h index 0acd8c0..11f55a9 100644 --- a/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Firestore.pbobjc.h @@ -642,10 +642,7 @@ typedef GPB_ENUM(GCFSCommitRequest_FieldNumber) { /** 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. - **/ +/** If set, applies all writes in this transaction, and commits it. */ @property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; @end diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h index c2d80e7..7e32934 100644 --- a/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.h @@ -140,6 +140,9 @@ typedef GPB_ENUM(GCFSStructuredQuery_FieldFilter_Operator) { /** Equal. */ GCFSStructuredQuery_FieldFilter_Operator_Equal = 5, + + /** Contains. Requires that the field is an array. */ + GCFSStructuredQuery_FieldFilter_Operator_ArrayContains = 7, }; GPBEnumDescriptor *GCFSStructuredQuery_FieldFilter_Operator_EnumDescriptor(void); diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.m b/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.m index 804a5d0..124930a 100644 --- a/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.m +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Query.pbobjc.m @@ -542,7 +542,7 @@ GPBEnumDescriptor *GCFSStructuredQuery_FieldFilter_Operator_EnumDescriptor(void) static const char *valueNames = "OperatorUnspecified\000LessThan\000LessThanOrE" "qual\000GreaterThan\000GreaterThanOrEqual\000Equa" - "l\000"; + "l\000ArrayContains\000"; static const int32_t values[] = { GCFSStructuredQuery_FieldFilter_Operator_OperatorUnspecified, GCFSStructuredQuery_FieldFilter_Operator_LessThan, @@ -550,6 +550,7 @@ GPBEnumDescriptor *GCFSStructuredQuery_FieldFilter_Operator_EnumDescriptor(void) GCFSStructuredQuery_FieldFilter_Operator_GreaterThan, GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual, GCFSStructuredQuery_FieldFilter_Operator_Equal, + GCFSStructuredQuery_FieldFilter_Operator_ArrayContains, }; GPBEnumDescriptor *worker = [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSStructuredQuery_FieldFilter_Operator) @@ -572,6 +573,7 @@ BOOL GCFSStructuredQuery_FieldFilter_Operator_IsValidValue(int32_t value__) { case GCFSStructuredQuery_FieldFilter_Operator_GreaterThan: case GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual: case GCFSStructuredQuery_FieldFilter_Operator_Equal: + case GCFSStructuredQuery_FieldFilter_Operator_ArrayContains: return YES; default: return NO; diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h b/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h index c3c4498..539bfa3 100644 --- a/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.h @@ -43,6 +43,7 @@ CF_EXTERN_C_BEGIN +@class GCFSArrayValue; @class GCFSDocument; @class GCFSDocumentMask; @class GCFSDocumentTransform; @@ -66,7 +67,10 @@ typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_ServerValue) { /** Unspecified. This value must not be used. */ GCFSDocumentTransform_FieldTransform_ServerValue_ServerValueUnspecified = 0, - /** The time at which the server processed the request. */ + /** + * The time at which the server processed the request, with millisecond + * precision. + **/ GCFSDocumentTransform_FieldTransform_ServerValue_RequestTime = 1, }; @@ -100,7 +104,6 @@ typedef GPB_ENUM(GCFSWrite_FieldNumber) { GCFSWrite_FieldNumber_Delete_p = 2, GCFSWrite_FieldNumber_UpdateMask = 3, GCFSWrite_FieldNumber_CurrentDocument = 4, - GCFSWrite_FieldNumber_Verify = 5, GCFSWrite_FieldNumber_Transform = 6, }; @@ -108,7 +111,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, }; @@ -129,13 +131,6 @@ typedef GPB_ENUM(GCFSWrite_Operation_OneOfCase) { **/ @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. @@ -148,9 +143,10 @@ typedef GPB_ENUM(GCFSWrite_Operation_OneOfCase) { * 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. + * If the mask is not set for an `update` and the document exists, any + * existing data will be overwritten. + * If the mask is set and the document on the server has fields not covered by + * 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. @@ -193,6 +189,7 @@ typedef GPB_ENUM(GCFSDocumentTransform_FieldNumber) { /** * The list of transformations to apply to the fields of the document, in * order. + * This must not be empty. **/ @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *fieldTransformsArray; /** The number of items in @c fieldTransformsArray without causing the array to be created. */ @@ -205,11 +202,15 @@ typedef GPB_ENUM(GCFSDocumentTransform_FieldNumber) { typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_FieldNumber) { GCFSDocumentTransform_FieldTransform_FieldNumber_FieldPath = 1, GCFSDocumentTransform_FieldTransform_FieldNumber_SetToServerValue = 2, + GCFSDocumentTransform_FieldTransform_FieldNumber_AppendMissingElements = 6, + GCFSDocumentTransform_FieldTransform_FieldNumber_RemoveAllFromArray_p = 7, }; typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase) { GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_GPBUnsetOneOfCase = 0, GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_SetToServerValue = 2, + GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_AppendMissingElements = 6, + GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_RemoveAllFromArray_p = 7, }; /** @@ -229,6 +230,36 @@ typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase) { /** Sets the field to the given server value. */ @property(nonatomic, readwrite) GCFSDocumentTransform_FieldTransform_ServerValue setToServerValue; +/** + * Append the given elements in order if they are not already present in + * the current field value. + * If the field is not an array, or if the field does not yet exist, it is + * first set to the empty array. + * + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and Null is equal to Null. + * If the input contains multiple equivalent values, only the first will + * be considered. + * + * The corresponding transform_result will be the null value. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSArrayValue *appendMissingElements; + +/** + * Remove all of the given elements from the array in the field. + * If the field is not an array, or if the field does not yet exist, it is + * set to the empty array. + * + * Equivalent numbers of the different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and Null is equal to Null. + * This will remove all equivalent values if there are duplicates. + * + * The corresponding transform_result will be the null value. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GCFSArrayValue *removeAllFromArray_p; + @end /** diff --git a/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.m b/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.m index e6fd0f4..591e634 100644 --- a/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.m +++ b/Firestore/Protos/objc/google/firestore/v1beta1/Write.pbobjc.m @@ -74,7 +74,6 @@ static GPBFileDescriptor *GCFSWriteRoot_FileDescriptor(void) { @dynamic operationOneOfCase; @dynamic update; @dynamic delete_p; -@dynamic verify; @dynamic transform; @dynamic hasUpdateMask, updateMask; @dynamic hasCurrentDocument, currentDocument; @@ -85,7 +84,6 @@ typedef struct GCFSWrite__storage_ { NSString *delete_p; GCFSDocumentMask *updateMask; GCFSPrecondition *currentDocument; - NSString *verify; GCFSDocumentTransform *transform; } GCFSWrite__storage_; @@ -131,15 +129,6 @@ typedef struct GCFSWrite__storage_ { .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), @@ -238,11 +227,15 @@ typedef struct GCFSDocumentTransform__storage_ { @dynamic transformTypeOneOfCase; @dynamic fieldPath; @dynamic setToServerValue; +@dynamic appendMissingElements; +@dynamic removeAllFromArray_p; typedef struct GCFSDocumentTransform_FieldTransform__storage_ { uint32_t _has_storage_[2]; GCFSDocumentTransform_FieldTransform_ServerValue setToServerValue; NSString *fieldPath; + GCFSArrayValue *appendMissingElements; + GCFSArrayValue *removeAllFromArray_p; } GCFSDocumentTransform_FieldTransform__storage_; // This method is threadsafe because it is initially called @@ -269,6 +262,24 @@ typedef struct GCFSDocumentTransform_FieldTransform__storage_ { .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), .dataType = GPBDataTypeEnum, }, + { + .name = "appendMissingElements", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSArrayValue), + .number = GCFSDocumentTransform_FieldTransform_FieldNumber_AppendMissingElements, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, appendMissingElements), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "removeAllFromArray_p", + .dataTypeSpecific.className = GPBStringifySymbol(GCFSArrayValue), + .number = GCFSDocumentTransform_FieldTransform_FieldNumber_RemoveAllFromArray_p, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, removeAllFromArray_p), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, }; GPBDescriptor *localDescriptor = [GPBDescriptor allocDescriptorForClass:[GCFSDocumentTransform_FieldTransform class] -- cgit v1.2.3