Skip to content

Commit

Permalink
feat(firestore): update the API
Browse files Browse the repository at this point in the history
#### firestore:v1beta1

The following keys were added:
- schemas.Document.properties.fields.description
- schemas.QueryPlan.description
- schemas.QueryPlan.id
- schemas.QueryPlan.properties.planInfo.additionalProperties.description
- schemas.QueryPlan.properties.planInfo.additionalProperties.type
- schemas.QueryPlan.properties.planInfo.description
- schemas.QueryPlan.properties.planInfo.type
- schemas.QueryPlan.type
- schemas.ResultSetStats.description
- schemas.ResultSetStats.id
- schemas.ResultSetStats.properties.queryPlan.$ref
- schemas.ResultSetStats.properties.queryPlan.description
- schemas.ResultSetStats.properties.queryStats.additionalProperties.description
- schemas.ResultSetStats.properties.queryStats.additionalProperties.type
- schemas.ResultSetStats.properties.queryStats.description
- schemas.ResultSetStats.properties.queryStats.type
- schemas.ResultSetStats.type
- schemas.RunAggregationQueryRequest.properties.mode.description
- schemas.RunAggregationQueryRequest.properties.mode.enum
- schemas.RunAggregationQueryRequest.properties.mode.enumDescriptions
- schemas.RunAggregationQueryRequest.properties.mode.type
- schemas.RunAggregationQueryResponse.properties.stats.$ref
- schemas.RunAggregationQueryResponse.properties.stats.description
- schemas.RunQueryRequest.properties.mode.description
- schemas.RunQueryRequest.properties.mode.enum
- schemas.RunQueryRequest.properties.mode.enumDescriptions
- schemas.RunQueryRequest.properties.mode.type
- schemas.RunQueryResponse.properties.stats.$ref
- schemas.RunQueryResponse.properties.stats.description

The following keys were changed:
- schemas.StructuredQuery.description

#### firestore:v1

The following keys were added:
- schemas.Document.properties.fields.description
- schemas.GoogleFirestoreAdminV1DatabaseSnapshot.description
- schemas.GoogleFirestoreAdminV1DatabaseSnapshot.id
- schemas.GoogleFirestoreAdminV1DatabaseSnapshot.properties.database.description
- schemas.GoogleFirestoreAdminV1DatabaseSnapshot.properties.database.type
- schemas.GoogleFirestoreAdminV1DatabaseSnapshot.properties.snapshotTime.description
- schemas.GoogleFirestoreAdminV1DatabaseSnapshot.properties.snapshotTime.format
- schemas.GoogleFirestoreAdminV1DatabaseSnapshot.properties.snapshotTime.type
- schemas.GoogleFirestoreAdminV1DatabaseSnapshot.type
- schemas.GoogleFirestoreAdminV1RestoreDatabaseRequest.properties.databaseSnapshot.$ref
- schemas.GoogleFirestoreAdminV1RestoreDatabaseRequest.properties.databaseSnapshot.description
- schemas.QueryPlan.description
- schemas.QueryPlan.id
- schemas.QueryPlan.properties.planInfo.additionalProperties.description
- schemas.QueryPlan.properties.planInfo.additionalProperties.type
- schemas.QueryPlan.properties.planInfo.description
- schemas.QueryPlan.properties.planInfo.type
- schemas.QueryPlan.type
- schemas.ResultSetStats.description
- schemas.ResultSetStats.id
- schemas.ResultSetStats.properties.queryPlan.$ref
- schemas.ResultSetStats.properties.queryPlan.description
- schemas.ResultSetStats.properties.queryStats.additionalProperties.description
- schemas.ResultSetStats.properties.queryStats.additionalProperties.type
- schemas.ResultSetStats.properties.queryStats.description
- schemas.ResultSetStats.properties.queryStats.type
- schemas.ResultSetStats.type
- schemas.RunAggregationQueryRequest.properties.mode.description
- schemas.RunAggregationQueryRequest.properties.mode.enum
- schemas.RunAggregationQueryRequest.properties.mode.enumDescriptions
- schemas.RunAggregationQueryRequest.properties.mode.type
- schemas.RunAggregationQueryResponse.properties.stats.$ref
- schemas.RunAggregationQueryResponse.properties.stats.description
- schemas.RunQueryRequest.properties.mode.description
- schemas.RunQueryRequest.properties.mode.enum
- schemas.RunQueryRequest.properties.mode.enumDescriptions
- schemas.RunQueryRequest.properties.mode.type
- schemas.RunQueryResponse.properties.stats.$ref
- schemas.RunQueryResponse.properties.stats.description

The following keys were changed:
- resources.projects.resources.databases.resources.collectionGroups.resources.fields.methods.list.description
- schemas.StructuredQuery.description
  • Loading branch information
yoshi-automation authored and bcoe committed Feb 2, 2024
1 parent 34aea86 commit ccbb1f0
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 8 deletions.
97 changes: 94 additions & 3 deletions discovery/firestore-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@
]
},
"list": {
"description": "Lists the field configuration and metadata for this database. Currently, FirestoreAdmin.ListFields only supports listing fields that have been explicitly overridden. To issue this query, call FirestoreAdmin.ListFields with the filter set to `indexConfig.usesAncestorConfig:false or `ttlConfig:*`.",
"description": "Lists the field configuration and metadata for this database. Currently, FirestoreAdmin.ListFields only supports listing fields that have been explicitly overridden. To issue this query, call FirestoreAdmin.ListFields with the filter set to `indexConfig.usesAncestorConfig:false` or `ttlConfig:*`.",
"flatPath": "v1/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/fields",
"httpMethod": "GET",
"id": "firestore.projects.databases.collectionGroups.fields.list",
Expand Down Expand Up @@ -1672,7 +1672,7 @@
}
}
},
"revision": "20231103",
"revision": "20240117",
"rootUrl": "https://firestore.googleapis.com/",
"schemas": {
"Aggregation": {
Expand Down Expand Up @@ -2016,6 +2016,7 @@
"additionalProperties": {
"$ref": "Value"
},
"description": "The document'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 field names, 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 a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `\"foo\" : { map_value: { \"x&y\" : { string_value: \"hello\" }}}` would be represented by the field path `` foo.`x&y` ``. 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`. For example, `foo_bar_17`. 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 ``.",
"type": "object"
},
"name": {
Expand Down Expand Up @@ -2526,6 +2527,22 @@
},
"type": "object"
},
"GoogleFirestoreAdminV1DatabaseSnapshot": {
"description": "A consistent snapshot of a database at a specific point in time.",
"id": "GoogleFirestoreAdminV1DatabaseSnapshot",
"properties": {
"database": {
"description": "Required. A name of the form `projects/{project_id}/databases/{database_id}`",
"type": "string"
},
"snapshotTime": {
"description": "Required. The timestamp at which the database snapshot is taken. The requested timestamp must be a whole minute within the PITR window.",
"format": "google-datetime",
"type": "string"
}
},
"type": "object"
},
"GoogleFirestoreAdminV1DeleteDatabaseMetadata": {
"description": "Metadata related to the delete database operation.",
"id": "GoogleFirestoreAdminV1DeleteDatabaseMetadata",
Expand Down Expand Up @@ -3212,6 +3229,10 @@
"databaseId": {
"description": "Required. The ID to use for the database, which will become the final component of the database's resource name. This database id must not be associated with an existing database. This value should be 4-63 characters. Valid characters are /a-z-/ with first character a letter and the last a letter or a number. Must not be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. \"(default)\" database id is also valid.",
"type": "string"
},
"databaseSnapshot": {
"$ref": "GoogleFirestoreAdminV1DatabaseSnapshot",
"description": "Database snapshot to restore from. The source database must exist and have enabled PITR. The restored database will be created in the same location as the source database."
}
},
"type": "object"
Expand Down Expand Up @@ -3691,6 +3712,21 @@
},
"type": "object"
},
"QueryPlan": {
"description": "Plan for the query.",
"id": "QueryPlan",
"properties": {
"planInfo": {
"additionalProperties": {
"description": "Properties of the object.",
"type": "any"
},
"description": "Planning phase information for the query. It will include: { \"indexes_used\": [ {\"query_scope\": \"Collection\", \"properties\": \"(foo ASC, __name__ ASC)\"}, {\"query_scope\": \"Collection\", \"properties\": \"(bar ASC, __name__ ASC)\"} ] }",
"type": "object"
}
},
"type": "object"
},
"QueryTarget": {
"description": "A target specified by a query.",
"id": "QueryTarget",
Expand Down Expand Up @@ -3730,6 +3766,25 @@
},
"type": "object"
},
"ResultSetStats": {
"description": "Planning and execution statistics for the query.",
"id": "ResultSetStats",
"properties": {
"queryPlan": {
"$ref": "QueryPlan",
"description": "Plan for the query."
},
"queryStats": {
"additionalProperties": {
"description": "Properties of the object.",
"type": "any"
},
"description": "Aggregated statistics from the execution of the query. This will only be present when the request specifies `PROFILE` mode. For example, a query will return the statistics including: { \"results_returned\": \"20\", \"documents_scanned\": \"20\", \"indexes_entries_scanned\": \"10050\", \"total_execution_time\": \"100.7 msecs\" }",
"type": "object"
}
},
"type": "object"
},
"RollbackRequest": {
"description": "The request for Firestore.Rollback.",
"id": "RollbackRequest",
Expand All @@ -3746,6 +3801,20 @@
"description": "The request for Firestore.RunAggregationQuery.",
"id": "RunAggregationQueryRequest",
"properties": {
"mode": {
"description": "Optional. The mode in which the query request is processed. This field is optional, and when not provided, it defaults to `NORMAL` mode where no additional statistics will be returned with the query results.",
"enum": [
"NORMAL",
"PLAN",
"PROFILE"
],
"enumDescriptions": [
"The default mode. Only the query results are returned.",
"This mode returns only the query plan, without any results or execution statistics information.",
"This mode returns both the query plan and the execution statistics along with the results."
],
"type": "string"
},
"newTransaction": {
"$ref": "TransactionOptions",
"description": "Starts a new transaction as part of the query, defaulting to read-only. The new transaction ID will be returned as the first response in the stream."
Expand Down Expand Up @@ -3780,6 +3849,10 @@
"$ref": "AggregationResult",
"description": "A single aggregation result. Not present when reporting partial progress."
},
"stats": {
"$ref": "ResultSetStats",
"description": "Query plan and execution statistics. Note that the returned stats are subject to change as Firestore evolves. This is only present when the request specifies a mode other than `NORMAL` and is sent only once with the last response in the stream."
},
"transaction": {
"description": "The transaction that was started as part of this request. Only present on the first response when the request requested to start a new transaction.",
"format": "byte",
Expand All @@ -3792,6 +3865,20 @@
"description": "The request for Firestore.RunQuery.",
"id": "RunQueryRequest",
"properties": {
"mode": {
"description": "Optional. The mode in which the query request is processed. This field is optional, and when not provided, it defaults to `NORMAL` mode where no additional statistics will be returned with the query results.",
"enum": [
"NORMAL",
"PLAN",
"PROFILE"
],
"enumDescriptions": [
"The default mode. Only the query results are returned.",
"This mode returns only the query plan, without any results or execution statistics information.",
"This mode returns both the query plan and the execution statistics along with the results."
],
"type": "string"
},
"newTransaction": {
"$ref": "TransactionOptions",
"description": "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."
Expand Down Expand Up @@ -3835,6 +3922,10 @@
"format": "int32",
"type": "integer"
},
"stats": {
"$ref": "ResultSetStats",
"description": "Query plan and execution statistics. Note that the returned stats are subject to change as Firestore evolves. This is only present when the request specifies a mode other than `NORMAL` and is sent only once with the last response in the stream."
},
"transaction": {
"description": "The transaction that was started as part of this request. Can only be set in the first response, and only if RunQueryRequest.new_transaction was set in the request. If set, no other fields will be set in this response.",
"format": "byte",
Expand Down Expand Up @@ -3889,7 +3980,7 @@
"type": "object"
},
"StructuredQuery": {
"description": "A Firestore query.",
"description": "A Firestore query. The query stages are executed in the following order: 1. from 2. where 3. select 4. order_by + start_at + end_at 5. offset 6. limit",
"id": "StructuredQuery",
"properties": {
"endAt": {
Expand Down
75 changes: 73 additions & 2 deletions discovery/firestore-v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@
}
}
},
"revision": "20231002",
"revision": "20240117",
"rootUrl": "https://firestore.googleapis.com/",
"schemas": {
"Aggregation": {
Expand Down Expand Up @@ -1294,6 +1294,7 @@
"additionalProperties": {
"$ref": "Value"
},
"description": "The document'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 field names, 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 a dot-delimited (`.`) string of segments. Each segment is either a simple field name (defined below) or a quoted field name. For example, the structured field `\"foo\" : { map_value: { \"x&y\" : { string_value: \"hello\" }}}` would be represented by the field path `` foo.`x&y` ``. 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`. For example, `foo_bar_17`. 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 ``.",
"type": "object"
},
"name": {
Expand Down Expand Up @@ -2252,6 +2253,21 @@
},
"type": "object"
},
"QueryPlan": {
"description": "Plan for the query.",
"id": "QueryPlan",
"properties": {
"planInfo": {
"additionalProperties": {
"description": "Properties of the object.",
"type": "any"
},
"description": "Planning phase information for the query. It will include: { \"indexes_used\": [ {\"query_scope\": \"Collection\", \"properties\": \"(foo ASC, __name__ ASC)\"}, {\"query_scope\": \"Collection\", \"properties\": \"(bar ASC, __name__ ASC)\"} ] }",
"type": "object"
}
},
"type": "object"
},
"QueryTarget": {
"description": "A target specified by a query.",
"id": "QueryTarget",
Expand Down Expand Up @@ -2291,6 +2307,25 @@
},
"type": "object"
},
"ResultSetStats": {
"description": "Planning and execution statistics for the query.",
"id": "ResultSetStats",
"properties": {
"queryPlan": {
"$ref": "QueryPlan",
"description": "Plan for the query."
},
"queryStats": {
"additionalProperties": {
"description": "Properties of the object.",
"type": "any"
},
"description": "Aggregated statistics from the execution of the query. This will only be present when the request specifies `PROFILE` mode. For example, a query will return the statistics including: { \"results_returned\": \"20\", \"documents_scanned\": \"20\", \"indexes_entries_scanned\": \"10050\", \"total_execution_time\": \"100.7 msecs\" }",
"type": "object"
}
},
"type": "object"
},
"RollbackRequest": {
"description": "The request for Firestore.Rollback.",
"id": "RollbackRequest",
Expand All @@ -2307,6 +2342,20 @@
"description": "The request for Firestore.RunAggregationQuery.",
"id": "RunAggregationQueryRequest",
"properties": {
"mode": {
"description": "Optional. The mode in which the query request is processed. This field is optional, and when not provided, it defaults to `NORMAL` mode where no additional statistics will be returned with the query results.",
"enum": [
"NORMAL",
"PLAN",
"PROFILE"
],
"enumDescriptions": [
"The default mode. Only the query results are returned.",
"This mode returns only the query plan, without any results or execution statistics information.",
"This mode returns both the query plan and the execution statistics along with the results."
],
"type": "string"
},
"newTransaction": {
"$ref": "TransactionOptions",
"description": "Starts a new transaction as part of the query, defaulting to read-only. The new transaction ID will be returned as the first response in the stream."
Expand Down Expand Up @@ -2341,6 +2390,10 @@
"$ref": "AggregationResult",
"description": "A single aggregation result. Not present when reporting partial progress."
},
"stats": {
"$ref": "ResultSetStats",
"description": "Query plan and execution statistics. Note that the returned stats are subject to change as Firestore evolves. This is only present when the request specifies a mode other than `NORMAL` and is sent only once with the last response in the stream."
},
"transaction": {
"description": "The transaction that was started as part of this request. Only present on the first response when the request requested to start a new transaction.",
"format": "byte",
Expand All @@ -2353,6 +2406,20 @@
"description": "The request for Firestore.RunQuery.",
"id": "RunQueryRequest",
"properties": {
"mode": {
"description": "Optional. The mode in which the query request is processed. This field is optional, and when not provided, it defaults to `NORMAL` mode where no additional statistics will be returned with the query results.",
"enum": [
"NORMAL",
"PLAN",
"PROFILE"
],
"enumDescriptions": [
"The default mode. Only the query results are returned.",
"This mode returns only the query plan, without any results or execution statistics information.",
"This mode returns both the query plan and the execution statistics along with the results."
],
"type": "string"
},
"newTransaction": {
"$ref": "TransactionOptions",
"description": "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."
Expand Down Expand Up @@ -2396,6 +2463,10 @@
"format": "int32",
"type": "integer"
},
"stats": {
"$ref": "ResultSetStats",
"description": "Query plan and execution statistics. Note that the returned stats are subject to change as Firestore evolves. This is only present when the request specifies a mode other than `NORMAL` and is sent only once with the last response in the stream."
},
"transaction": {
"description": "The transaction that was started as part of this request. Can only be set in the first response, and only if RunQueryRequest.new_transaction was set in the request. If set, no other fields will be set in this response.",
"format": "byte",
Expand Down Expand Up @@ -2450,7 +2521,7 @@
"type": "object"
},
"StructuredQuery": {
"description": "A Firestore query.",
"description": "A Firestore query. The query stages are executed in the following order: 1. from 2. where 3. select 4. order_by + start_at + end_at 5. offset 6. limit",
"id": "StructuredQuery",
"properties": {
"endAt": {
Expand Down
Loading

0 comments on commit ccbb1f0

Please sign in to comment.