Skip to content

Commit

Permalink
feat(firestore)!: update the API
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This release has breaking changes.

#### firestore:v1beta1

The following keys were deleted:
- schemas.RunQueryResponse.properties.done.description
- schemas.RunQueryResponse.properties.done.type

The following keys were added:
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.description
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.flatPath
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.httpMethod
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.id
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameterOrder
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.description
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.location
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.pattern
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.required
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.type
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.path
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.request.$ref
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.response.$ref
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.scopes
- schemas.Aggregation.description
- schemas.Aggregation.id
- schemas.Aggregation.properties.alias.description
- schemas.Aggregation.properties.alias.type
- schemas.Aggregation.properties.count.$ref
- schemas.Aggregation.properties.count.description
- schemas.Aggregation.type
- schemas.AggregationResult.description
- schemas.AggregationResult.id
- schemas.AggregationResult.properties.aggregateFields.additionalProperties.$ref
- schemas.AggregationResult.properties.aggregateFields.description
- schemas.AggregationResult.properties.aggregateFields.type
- schemas.AggregationResult.type
- schemas.Count.description
- schemas.Count.id
- schemas.Count.properties.upTo.description
- schemas.Count.properties.upTo.format
- schemas.Count.properties.upTo.type
- schemas.Count.type
- schemas.RunAggregationQueryRequest.description
- schemas.RunAggregationQueryRequest.id
- schemas.RunAggregationQueryRequest.properties.newTransaction.$ref
- schemas.RunAggregationQueryRequest.properties.newTransaction.description
- schemas.RunAggregationQueryRequest.properties.readTime.description
- schemas.RunAggregationQueryRequest.properties.readTime.format
- schemas.RunAggregationQueryRequest.properties.readTime.type
- schemas.RunAggregationQueryRequest.properties.structuredAggregationQuery.$ref
- schemas.RunAggregationQueryRequest.properties.structuredAggregationQuery.description
- schemas.RunAggregationQueryRequest.properties.transaction.description
- schemas.RunAggregationQueryRequest.properties.transaction.format
- schemas.RunAggregationQueryRequest.properties.transaction.type
- schemas.RunAggregationQueryRequest.type
- schemas.RunAggregationQueryResponse.description
- schemas.RunAggregationQueryResponse.id
- schemas.RunAggregationQueryResponse.properties.readTime.description
- schemas.RunAggregationQueryResponse.properties.readTime.format
- schemas.RunAggregationQueryResponse.properties.readTime.type
- schemas.RunAggregationQueryResponse.properties.result.$ref
- schemas.RunAggregationQueryResponse.properties.result.description
- schemas.RunAggregationQueryResponse.properties.transaction.description
- schemas.RunAggregationQueryResponse.properties.transaction.format
- schemas.RunAggregationQueryResponse.properties.transaction.type
- schemas.RunAggregationQueryResponse.type
- schemas.StructuredAggregationQuery.description
- schemas.StructuredAggregationQuery.id
- schemas.StructuredAggregationQuery.properties.aggregations.description
- schemas.StructuredAggregationQuery.properties.aggregations.items.$ref
- schemas.StructuredAggregationQuery.properties.aggregations.type
- schemas.StructuredAggregationQuery.properties.structuredQuery.$ref
- schemas.StructuredAggregationQuery.properties.structuredQuery.description
- schemas.StructuredAggregationQuery.type

The following keys were changed:
- schemas.CompositeFilter.properties.filters.description
- schemas.CompositeFilter.properties.op.enumDescriptions

#### firestore:v1

The following keys were deleted:
- schemas.RunQueryResponse.properties.done.description
- schemas.RunQueryResponse.properties.done.type

The following keys were added:
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.description
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.flatPath
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.httpMethod
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.id
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameterOrder
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.description
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.location
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.pattern
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.required
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.parameters.parent.type
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.path
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.request.$ref
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.response.$ref
- resources.projects.resources.databases.resources.documents.methods.runAggregationQuery.scopes
- schemas.Aggregation.description
- schemas.Aggregation.id
- schemas.Aggregation.properties.alias.description
- schemas.Aggregation.properties.alias.type
- schemas.Aggregation.properties.count.$ref
- schemas.Aggregation.properties.count.description
- schemas.Aggregation.type
- schemas.AggregationResult.description
- schemas.AggregationResult.id
- schemas.AggregationResult.properties.aggregateFields.additionalProperties.$ref
- schemas.AggregationResult.properties.aggregateFields.description
- schemas.AggregationResult.properties.aggregateFields.type
- schemas.AggregationResult.type
- schemas.Count.description
- schemas.Count.id
- schemas.Count.properties.upTo.description
- schemas.Count.properties.upTo.format
- schemas.Count.properties.upTo.type
- schemas.Count.type
- schemas.RunAggregationQueryRequest.description
- schemas.RunAggregationQueryRequest.id
- schemas.RunAggregationQueryRequest.properties.newTransaction.$ref
- schemas.RunAggregationQueryRequest.properties.newTransaction.description
- schemas.RunAggregationQueryRequest.properties.readTime.description
- schemas.RunAggregationQueryRequest.properties.readTime.format
- schemas.RunAggregationQueryRequest.properties.readTime.type
- schemas.RunAggregationQueryRequest.properties.structuredAggregationQuery.$ref
- schemas.RunAggregationQueryRequest.properties.structuredAggregationQuery.description
- schemas.RunAggregationQueryRequest.properties.transaction.description
- schemas.RunAggregationQueryRequest.properties.transaction.format
- schemas.RunAggregationQueryRequest.properties.transaction.type
- schemas.RunAggregationQueryRequest.type
- schemas.RunAggregationQueryResponse.description
- schemas.RunAggregationQueryResponse.id
- schemas.RunAggregationQueryResponse.properties.readTime.description
- schemas.RunAggregationQueryResponse.properties.readTime.format
- schemas.RunAggregationQueryResponse.properties.readTime.type
- schemas.RunAggregationQueryResponse.properties.result.$ref
- schemas.RunAggregationQueryResponse.properties.result.description
- schemas.RunAggregationQueryResponse.properties.transaction.description
- schemas.RunAggregationQueryResponse.properties.transaction.format
- schemas.RunAggregationQueryResponse.properties.transaction.type
- schemas.RunAggregationQueryResponse.type
- schemas.StructuredAggregationQuery.description
- schemas.StructuredAggregationQuery.id
- schemas.StructuredAggregationQuery.properties.aggregations.description
- schemas.StructuredAggregationQuery.properties.aggregations.items.$ref
- schemas.StructuredAggregationQuery.properties.aggregations.type
- schemas.StructuredAggregationQuery.properties.structuredQuery.$ref
- schemas.StructuredAggregationQuery.properties.structuredQuery.description
- schemas.StructuredAggregationQuery.type

The following keys were changed:
- resources.projects.resources.locations.methods.list.parameters.filter.description
- schemas.CompositeFilter.properties.filters.description
- schemas.CompositeFilter.properties.op.enumDescriptions
  • Loading branch information
yoshi-automation authored and bcoe committed Apr 11, 2022
1 parent 20d22bb commit a1f99fd
Show file tree
Hide file tree
Showing 4 changed files with 775 additions and 29 deletions.
146 changes: 138 additions & 8 deletions discovery/firestore-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,35 @@
"https://www.googleapis.com/auth/datastore"
]
},
"runAggregationQuery": {
"description": "Runs an aggregation query. Rather than producing Document results like Firestore.RunQuery, this API allows running an aggregation to produce a series of AggregationResult server-side. High-Level Example: ``` -- Return the number of documents in table given a filter. SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); ```",
"flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}:runAggregationQuery",
"httpMethod": "POST",
"id": "firestore.projects.databases.documents.runAggregationQuery",
"parameterOrder": [
"parent"
],
"parameters": {
"parent": {
"description": "Required. 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`",
"location": "path",
"pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.*$",
"required": true,
"type": "string"
}
},
"path": "v1/{+parent}:runAggregationQuery",
"request": {
"$ref": "RunAggregationQueryRequest"
},
"response": {
"$ref": "RunAggregationQueryResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/datastore"
]
},
"runQuery": {
"description": "Runs a query.",
"flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}:runQuery",
Expand Down Expand Up @@ -1282,7 +1311,7 @@
],
"parameters": {
"filter": {
"description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in [AIP-160](https://google.aip.dev/160).",
"description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like `\"displayName=tokyo\"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).",
"location": "query",
"type": "string"
},
Expand Down Expand Up @@ -1319,9 +1348,38 @@
}
}
},
"revision": "20220319",
"revision": "20220402",
"rootUrl": "https://firestore.googleapis.com/",
"schemas": {
"Aggregation": {
"description": "Defines a aggregation that produces a single result.",
"id": "Aggregation",
"properties": {
"alias": {
"description": "Required. The name of the field to store the result of the aggregation into. Requires: * Must be present. * Must be unique across all aggregation aliases. * Conform to existing document field name limitations.",
"type": "string"
},
"count": {
"$ref": "Count",
"description": "Count aggregator."
}
},
"type": "object"
},
"AggregationResult": {
"description": "The result of a single bucket from a Firestore aggregation query. The keys of `aggregate_fields` are the same for all results in an aggregation query, unlike document queries which can have different fields present for each result.",
"id": "AggregationResult",
"properties": {
"aggregateFields": {
"additionalProperties": {
"$ref": "Value"
},
"description": "The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. The key is the alias assigned to the aggregation function on input and the size of this map equals the number of aggregation functions in the query.",
"type": "object"
}
},
"type": "object"
},
"ArrayValue": {
"description": "An array value.",
"id": "ArrayValue",
Expand Down Expand Up @@ -1516,7 +1574,7 @@
"id": "CompositeFilter",
"properties": {
"filters": {
"description": "The list of filters to combine. Must contain at least one filter.",
"description": "The list of filters to combine. Requires: * At least one filter is present.",
"items": {
"$ref": "Filter"
},
Expand All @@ -1530,13 +1588,25 @@
],
"enumDescriptions": [
"Unspecified. This value must not be used.",
"The results are required to satisfy each of the combined filters."
"Documents are required to satisfy all of the combined filters."
],
"type": "string"
}
},
"type": "object"
},
"Count": {
"description": "Count of documents that match the query. The `COUNT(*)` aggregation function operates on the entire document so it does not require a field reference.",
"id": "Count",
"properties": {
"upTo": {
"description": "Optional. Optional constraint on the maximum number of documents to count. This provides a way to set an upper bound on the number of documents to scan, limiting latency and cost. High-Level Example: ``` SELECT COUNT_UP_TO(1000) FROM ( SELECT * FROM k ); ``` Requires: * Must be greater than zero when present.",
"format": "int32",
"type": "integer"
}
},
"type": "object"
},
"Cursor": {
"description": "A position in a query result set.",
"id": "Cursor",
Expand Down Expand Up @@ -2815,6 +2885,52 @@
},
"type": "object"
},
"RunAggregationQueryRequest": {
"description": "The request for Firestore.RunAggregationQuery.",
"id": "RunAggregationQueryRequest",
"properties": {
"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."
},
"readTime": {
"description": "Executes the query at the given timestamp. Requires: * Cannot be more than 270 seconds in the past.",
"format": "google-datetime",
"type": "string"
},
"structuredAggregationQuery": {
"$ref": "StructuredAggregationQuery",
"description": "An aggregation query."
},
"transaction": {
"description": "Run the aggregation within an already active transaction. The value here is the opaque transaction ID to execute the query in.",
"format": "byte",
"type": "string"
}
},
"type": "object"
},
"RunAggregationQueryResponse": {
"description": "The response for Firestore.RunAggregationQuery.",
"id": "RunAggregationQueryResponse",
"properties": {
"readTime": {
"description": "The time at which the aggregate value is valid for.",
"format": "google-datetime",
"type": "string"
},
"result": {
"$ref": "AggregationResult",
"description": "A single aggregation result. Not present when reporting partial progress or when the query produced zero results."
},
"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",
"type": "string"
}
},
"type": "object"
},
"RunQueryRequest": {
"description": "The request for Firestore.RunQuery.",
"id": "RunQueryRequest",
Expand Down Expand Up @@ -2848,10 +2964,6 @@
"$ref": "Document",
"description": "A query result, not set when reporting partial progress."
},
"done": {
"description": "If present, Firestore has completely finished the request and no more documents will be returned.",
"type": "boolean"
},
"readTime": {
"description": "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.",
"format": "google-datetime",
Expand Down Expand Up @@ -2897,6 +3009,24 @@
},
"type": "object"
},
"StructuredAggregationQuery": {
"description": "Firestore query for running an aggregation over a StructuredQuery.",
"id": "StructuredAggregationQuery",
"properties": {
"aggregations": {
"description": "Optional. Series of aggregations to apply on top of the `structured_query`.",
"items": {
"$ref": "Aggregation"
},
"type": "array"
},
"structuredQuery": {
"$ref": "StructuredQuery",
"description": "Nested structured query."
}
},
"type": "object"
},
"StructuredQuery": {
"description": "A Firestore query.",
"id": "StructuredQuery",
Expand Down

0 comments on commit a1f99fd

Please sign in to comment.