"description":"The path of the field. Must match the field path specification described\nby google.firestore.v1beta1.Document.fields.\nSpecial field path `__name__` may be used by itself or at the end of a\npath. `__type__` may be used only at the end of path.",
"type":"string"
},
"mode":{
"type":"string",
"enumDescriptions":[
"The mode is unspecified.",
"The field's values are indexed so as to support sequencing in\nascending order and also query by \u003c, \u003e, \u003c=, \u003e=, and =.",
"The field's values are indexed so as to support sequencing in\ndescending order and also query by \u003c, \u003e, \u003c=, \u003e=, and =."
"description":"The number of results that have been skipped due to an offset between\nthe last response and the current response.",
"format":"int32",
"type":"integer"
},
"transaction":{
"type":"string",
"description":"The transaction that was started as part of this request.\nCan only be set in the first response, and only if\nRunQueryRequest.new_transaction was set in the request.\nIf set, no other fields will be set in this response.",
"format":"byte"
},
"document":{
"$ref":"Document",
"description":"A query result.\nNot set when reporting partial progress."
},
"readTime":{
"description":"The time at which the document was read. This may be monotonically\nincreasing; in this case, the previous documents in the result stream are\nguaranteed not to have changed between their `read_time` and this one.\n\nIf the query returns no results, a response with `read_time` and no\n`document` will be sent, and this represents the time at which the query\nwas run.",
"format":"google-datetime",
"type":"string"
}
},
"id":"RunQueryResponse",
"description":"The response for Firestore.RunQuery."
"description":"The latitude in degrees. It must be in the range [-90.0, +90.0].",
"format":"double"
},
"longitude":{
"description":"The longitude in degrees. It must be in the range [-180.0, +180.0].",
"format":"double",
"type":"number"
}
},
"id":"LatLng",
"description":"An object representing a latitude/longitude pair. This is expressed as a pair\nof doubles representing degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n\u003ca href=\"http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf\"\u003eWGS84\nstandard\u003c/a\u003e. Values must be within normalized ranges."
"description":"A selection of a collection, such as `messages as m1`.",
"type":"object",
"properties":{
"allDescendants":{
"description":"When false, selects only collections that are immediate children of\nthe `parent` specified in the containing `RunQueryRequest`.\nWhen true, selects all descendant collections.",
"type":"boolean"
},
"collectionId":{
"type":"string",
"description":"The collection ID.\nWhen set, selects only collections with this ID."
}
},
"id":"CollectionSelector"
},
"ArrayValue":{
"type":"object",
"properties":{
"values":{
"type":"array",
"items":{
"$ref":"Value"
},
"description":"Values in the array."
}
},
"id":"ArrayValue",
"description":"An array value."
},
"Index":{
"type":"object",
"properties":{
"fields":{
"description":"The fields to index.",
"type":"array",
"items":{
"$ref":"IndexField"
}
},
"state":{
"enum":[
"STATE_UNSPECIFIED",
"CREATING",
"READY",
"ERROR"
],
"description":"The state of the index.\nOutput only.",
"type":"string",
"enumDescriptions":[
"The state is unspecified.",
"The index is being created.\nThere is an active long-running operation for the index.\nThe index is updated when writing a document.\nSome index data may exist.",
"The index is ready to be used.\nThe index is updated when writing a document.\nThe index is fully populated from all stored documents it applies to.",
"The index was being created, but something went wrong.\nThere is no active long-running operation for the index,\nand the most recently finished long-running operation failed.\nThe index is not updated when writing a document.\nSome index data may exist."
]
},
"name":{
"type":"string",
"description":"The resource name of the index.\nOutput only."
},
"collectionId":{
"type":"string",
"description":"The collection ID to which this index applies. Required."
}
},
"id":"Index",
"description":"An index definition."
},
"StructuredQuery":{
"description":"A Firestore query.",
"type":"object",
"properties":{
"where":{
"$ref":"Filter",
"description":"The filter to apply."
},
"orderBy":{
"description":"The order to apply to the query results.\n\nFirestore guarantees a stable ordering through the following rules:\n\n * Any field required to appear in `order_by`, that is not already\n specified in `order_by`, is appended to the order in field name order\n by default.\n * If an order on `__name__` is not specified, it is appended by default.\n\nFields are appended with the same sort direction as the last order\nspecified, or 'ASCENDING' if no order was specified. For example:\n\n * `SELECT * FROM Foo ORDER BY A` becomes\n `SELECT * FROM Foo ORDER BY A, __name__`\n * `SELECT * FROM Foo ORDER BY A DESC` becomes\n `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`\n * `SELECT * FROM Foo WHERE A \u003e 1` becomes\n `SELECT * FROM Foo WHERE A \u003e 1 ORDER BY A, __name__`",
"type":"array",
"items":{
"$ref":"Order"
}
},
"select":{
"$ref":"Projection",
"description":"The projection to return."
},
"limit":{
"description":"The maximum number of results to return.\n\nApplies after all other constraints.\nMust be \u003e= 0 if specified.",
"format":"int32",
"type":"integer"
},
"offset":{
"description":"The number of results to skip.\n\nApplies before limit, but after all other constraints. Must be \u003e= 0 if\nspecified.",
"format":"int32",
"type":"integer"
},
"from":{
"description":"The collections to query.",
"type":"array",
"items":{
"$ref":"CollectionSelector"
}
},
"endAt":{
"$ref":"Cursor",
"description":"A end point for the query results."
},
"startAt":{
"$ref":"Cursor",
"description":"A starting point for the query results."
"description":"The ID of the write stream to resume.\nThis may only be set in the first message. When left empty, a new write\nstream will be created."
},
"streamToken":{
"type":"string",
"description":"A stream token that was previously sent by the server.\n\nThe client should set this field to the token from the most recent\nWriteResponse it has received. This acknowledges that the client has\nreceived responses up to this token. After sending this token, earlier\ntokens may not be used anymore.\n\nThe server may close the stream if there are too many unacknowledged\nresponses.\n\nLeave this field unset when creating a new stream. To resume a stream at\na specific point, set this field and the `stream_id` field.\n\nLeave this field unset when creating a new stream.",
"format":"byte"
},
"writes":{
"type":"array",
"items":{
"$ref":"Write"
},
"description":"The writes to apply.\n\nAlways executed atomically and in order.\nThis must be empty on the first request.\nThis may be empty on the last request.\nThis must not be empty on all other requests."
},
"labels":{
"type":"object",
"additionalProperties":{
"type":"string"
},
"description":"Labels associated with this write request."
}
},
"id":"WriteRequest",
"description":"The request for Firestore.Write.\n\nThe first request creates a stream, or resumes an existing one from a token.\n\nWhen creating a new stream, the server replies with a response containing\nonly an ID and a token, to use in the next request.\n\nWhen resuming a stream, the server first streams any responses later than the\ngiven token, then a response containing only an up-to-date token, to use in\nthe next request."
"description":"The streamed response for Firestore.BatchGetDocuments.",
"type":"object",
"properties":{
"transaction":{
"description":"The transaction that was started as part of this request.\nWill only be set in the first response, and only if\nBatchGetDocumentsRequest.new_transaction was set in the request.",
"format":"byte",
"type":"string"
},
"readTime":{
"type":"string",
"description":"The time at which the document was read.\nThis may be monotically increasing, in this case the previous documents in\nthe result stream are guaranteed not to have changed between their\nread_time and this one.",
"format":"google-datetime"
},
"found":{
"$ref":"Document",
"description":"A document that was requested."
},
"missing":{
"description":"A document name that was requested but does not exist. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.",
"description":"A resume token from a prior TargetChange for an identical target.\n\nUsing a resume token with a different target is unsupported and may fail.",
"description":"A client provided target ID.\n\nIf not set, the server will assign an ID for the target.\n\nUsed for resuming a target without changing IDs. The IDs can either be\nclient-assigned or be server-assigned in a previous stream. All targets\nwith client provided IDs must be added before adding a target that needs\na server-assigned id.",
"description":"Reads documents as they were at the given time.\nThis may not be older than 60 seconds.",
"format":"google-datetime"
},
"newTransaction":{
"$ref":"TransactionOptions",
"description":"Starts a new transaction and reads the documents.\nDefaults to a read-only transaction.\nThe new transaction ID will be returned as the first response in the\nstream."
"description":"A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`."
"description":"A filter to apply to the set of documents previously returned for the\ngiven target.\n\nReturned when documents may have been removed from the given target, but\nthe exact documents are unknown."
"description":"The total count of documents that match target_id.\n\nIf different from the count of documents in the client that match, the\nclient must manually determine which documents no longer match the target.",
"description":"The last update time of the document after applying the write. Not set\nafter a `delete`.\n\nIf the write did not actually change the document, this will be the\nprevious update_time.",
"description":"A string value.\n\nThe string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.\nOnly the first 1,500 bytes of the UTF-8 representation are considered by\nqueries.",
"description":"Applies a tranformation to a document.\nAt most one `transform` per document is allowed in a given request.\nAn `update` cannot follow a `transform` on the same document in a given\nrequest."
"description":"The fields to update in this write.\n\nThis field can be set only when the operation is `update`.\nNone of the field paths in the mask may contain a reserved name.\nIf the document exists on the server and has fields not referenced in the\nmask, they are left unchanged.\nFields referenced in the mask, but not present in the input document, are\ndeleted from the document on the server.\nThe field paths in this mask must not contain a reserved field name."
"description":"The values that represent a position, in the order they appear in\nthe order by clause of a query.\n\nCan contain fewer values than specified in the order by clause."
},
"before":{
"type":"boolean",
"description":"If the position is just before or just after the given values, relative\nto the sort order defined by the query."
"description":"The names of the documents to retrieve. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nThe request will fail if any of the document is not a child resource of the\ngiven `database`. Duplicate names will be elided.",
"description":"Starts a new transaction and reads the documents.\nDefaults to a read-only transaction.\nThe new transaction ID will be returned as the first response in the\nstream."
},
"mask":{
"$ref":"DocumentMask",
"description":"The fields to return. If not set, returns all fields.\n\nIf a document has a field that is not present in this mask, that field will\nnot be returned in the response."
"description":"A Document has changed.\n\nMay be the result of multiple writes, including deletes, that\nultimately resulted in a new value for the Document.\n\nMultiple DocumentChange messages may be returned for the same logical\nchange, if multiple targets are affected.",
"type":"object",
"properties":{
"targetIds":{
"description":"A set of target IDs of targets that match this document.",
"type":"array",
"items":{
"format":"int32",
"type":"integer"
}
},
"removedTargetIds":{
"description":"A set of target IDs for targets that no longer match this document.",
"type":"array",
"items":{
"format":"int32",
"type":"integer"
}
},
"document":{
"$ref":"Document",
"description":"The new state of the Document.\n\nIf `mask` is set, contains only fields that were updated or added."
"description":"Service-specific metadata associated with the operation. It typically\ncontains progress information and common metadata such as create time.\nSome services might not provide such metadata. Any method that returns a\nlong-running operation should document the metadata type, if any.",
"description":"If the value is `false`, it means the operation is still in progress.\nIf `true`, the operation is completed, and either `error` or `response` is\navailable."
"description":"The normal response of the operation in case of success. If the original\nmethod returns no data on success, such as `Delete`, the response is\n`google.protobuf.Empty`. If the original method is standard\n`Get`/`Create`/`Update`, the response should be the resource. For other\nmethods, the response should have the type `XxxResponse`, where `Xxx`\nis the original method name. For example, if the original method name\nis `TakeSnapshot()`, the inferred response type is\n`TakeSnapshotResponse`.",
"description":"The server-assigned name, which is only unique within the same service that\noriginally returns it. If you use the default HTTP mapping, the\n`name` should have the format of `operations/some/unique/name`."
"description":"The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`"
"description":"The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https://github.com/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` that can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
"type":"object",
"properties":{
"details":{
"description":"A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use.",
"description":"A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client."
"description":"Output only. The time at which the document was created.\n\nThis value increases monotonically when a document is deleted then\nrecreated. It can also be compared to values from other documents and\nthe `read_time` of a query.",
"description":"The document's fields.\n\nThe map keys represent field names.\n\nA simple field name contains only characters `a` to `z`, `A` to `Z`,\n`0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example,\n`foo_bar_17`.\n\nField names matching the regular expression `__.*__` are reserved. Reserved\nfield names are forbidden except in certain documented contexts. The map\nkeys, represented as UTF-8, must not exceed 1,500 bytes and cannot be\nempty.\n\nField paths may be used in other contexts to refer to structured fields\ndefined here. For `map_value`, the field path is represented by the simple\nor quoted field names of the containing fields, delimited by `.`. For\nexample, the structured field\n`\"foo\" : { map_value: { \"x&y\" : { string_value: \"hello\" }}}` would be\nrepresented by the field path `foo.x&y`.\n\nWithin a field path, a quoted field name starts and ends with `` ` `` and\nmay contain any character. Some characters, including `` ` ``, must be\nescaped using a `\\`. For example, `` `x&y` `` represents `x&y` and\n`` `bak\\`tik` `` represents `` bak`tik ``.",
"description":"Output only. The time at which the document was last changed.\n\nThis value is initally set to the `create_time` then increases\nmonotonically with each change to the document. It can also be\ncompared to values from other documents and the `read_time` of a query.",
"description":"A Document has been removed from the view of the targets.\n\nSent if the document is no longer relevant to a target and is out of view.\nCan be sent instead of a DocumentDelete or a DocumentChange if the server\ncan not send the new value of the document.\n\nMultiple DocumentRemove messages may be returned for the same logical\nwrite or delete, if multiple targets are affected.",
"type":"object",
"properties":{
"removedTargetIds":{
"description":"A set of target IDs for targets that previously matched this document.",
"description":"The names of the documents to retrieve. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nThe request will fail if any of the document is not a child resource of\nthe given `database`. Duplicate names will be elided.",
"description":"A set of field paths on a document.\nUsed to restrict a get or update operation on a document to a subset of its\nfields.\nThis is different from standard field masks, as this is always scoped to a\nDocument, and takes in account the dynamic nature of Value."
"description":"A token that represents the position of this response in the stream.\nThis can be used by a client to resume the stream at this point.\n\nThis field is always set.",
"description":"A token that can be used to resume the stream for the given `target_ids`,\nor all targets if `target_ids` is empty.\n\nNot set on every target change.",
"format":"byte",
"type":"string"
},
"targetIds":{
"type":"array",
"items":{
"type":"integer",
"format":"int32"
},
"description":"The target IDs of targets that have changed.\n\nIf empty, the change applies to all targets.\n\nFor `target_change_type=ADD`, the order of the target IDs matches the order\nof the requests to add the targets. This allows clients to unambiguously\nassociate server-assigned target IDs with added targets.\n\nFor other states, the order of the target IDs is not defined."
},
"cause":{
"$ref":"Status",
"description":"The error that resulted in this change, if applicable."
},
"readTime":{
"type":"string",
"description":"The consistent `read_time` for the given `target_ids` (omitted when the\ntarget_ids are not at a consistent snapshot).\n\nThe stream is guaranteed to send a `read_time` with `target_ids` empty\nwhenever the entire stream reaches a new consistent snapshot. ADD,\nCURRENT, and RESET messages are guaranteed to (eventually) result in a\nnew consistent snapshot (while NO_CHANGE and REMOVE messages are not).\n\nFor a given stream, `read_time` is guaranteed to be monotonically\nincreasing.",
"description":"The type of change that occurred.",
"type":"string",
"enumDescriptions":[
"No change has occurred. Used only to send an updated `resume_token`.",
"The targets have been added.",
"The targets have been removed.",
"The targets reflect all changes committed before the targets were added\nto the stream.\n\nThis will be sent after or with a `read_time` that is greater than or\nequal to the time at which the targets were added.\n\nListeners can wait for this change if read-after-write semantics\nare desired.",
"The targets have been reset, and a new initial state for the targets\nwill be returned in subsequent changes.\n\nAfter the initial state is complete, `CURRENT` will be returned even\nif the target was previously indicated to be `CURRENT`."
"description":"The map's fields.\n\nThe map keys represent field names. Field names matching the regular\nexpression `__.*__` are reserved. Reserved field names are forbidden except\nin certain documented contexts. The map keys, represented as UTF-8, must\nnot exceed 1,500 bytes and cannot be empty.",
"description":"A Document has been deleted.\n\nMay be the result of multiple writes, including updates, the\nlast of which deleted the Document.\n\nMultiple DocumentDelete messages may be returned for the same logical\ndelete, if multiple targets are affected."
"description":"Gets multiple documents.\n\nDocuments returned by this method are not guaranteed to be returned in the\nsame order that they were requested."
},
"list":{
"httpMethod":"GET",
"parameterOrder":[
"parent",
"collectionId"
],
"response":{
"$ref":"ListDocumentsResponse"
},
"scopes":[
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/datastore"
],
"parameters":{
"readTime":{
"location":"query",
"description":"Reads documents as they were at the given time.\nThis may not be older than 60 seconds.",
"format":"google-datetime",
"type":"string"
},
"orderBy":{
"type":"string",
"location":"query",
"description":"The order to sort results by. For example: `priority desc, name`."
},
"showMissing":{
"location":"query",
"description":"If the list should show missing documents. A missing document is a\ndocument that does not exist but has sub-documents. These documents will\nbe returned with a key but will not have fields, Document.create_time,\nor Document.update_time set.\n\nRequests with `show_missing` may not specify `where` or\n`order_by`.",
"type":"boolean"
},
"pageToken":{
"location":"query",
"description":"The `next_page_token` value returned from a previous List request, if any.",
"type":"string"
},
"mask.fieldPaths":{
"location":"query",
"description":"The list of field paths in the mask. See Document.fields for a field\npath syntax reference.",
"type":"string",
"repeated":true
},
"pageSize":{
"type":"integer",
"location":"query",
"description":"The maximum number of documents to return.",
"format":"int32"
},
"collectionId":{
"location":"path",
"description":"The collection ID, relative to `parent`, to list. For example: `chatrooms`\nor `messages`.",
"required":true,
"type":"string"
},
"transaction":{
"type":"string",
"location":"query",
"description":"Reads documents in a transaction.",
"format":"byte"
},
"parent":{
"location":"path",
"description":"The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`",
"description":"The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`",
"description":"The parent document. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`"
"description":"The resource name of the Document to delete. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`."
},
"currentDocument.updateTime":{
"type":"string",
"location":"query",
"description":"When set, the target document must exist and have been last updated at\nthat time.",
"description":"Creates the specified index.\nA newly created index's initial state is `CREATING`. On completion of the\nreturned google.longrunning.Operation, the state will be `READY`.\nIf the index already exists, the call will return an `ALREADY_EXISTS`\nstatus.\n\nDuring creation, the process could result in an error, in which case the\nindex will move to the `ERROR` state. The process can be recovered by\nfixing the data that caused the error, removing the index with\ndelete, then re-creating the index with\ncreate.\n\nIndexes with a single field cannot be created.",
"description":"API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"type":"string"
},
"access_token":{
"location":"query",
"description":"OAuth access token.",
"type":"string"
},
"quotaUser":{
"type":"string",
"location":"query",
"description":"Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters."
},
"pp":{
"location":"query",
"description":"Pretty-print response.",
"type":"boolean",
"default":"true"
},
"bearer_token":{
"type":"string",
"location":"query",
"description":"OAuth bearer token."
},
"oauth_token":{
"type":"string",
"location":"query",
"description":"OAuth 2.0 token for the current user."