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.Document.properties.fields.description

The following keys were added:
- schemas.GoogleFirestoreAdminV1CreateDatabaseMetadata.description
- schemas.GoogleFirestoreAdminV1CreateDatabaseMetadata.id
- schemas.GoogleFirestoreAdminV1CreateDatabaseMetadata.type
- schemas.GoogleFirestoreAdminV1DeleteDatabaseMetadata.description
- schemas.GoogleFirestoreAdminV1DeleteDatabaseMetadata.id
- schemas.GoogleFirestoreAdminV1DeleteDatabaseMetadata.type

The following keys were changed:
- schemas.FieldReference.properties.fieldPath.description
- schemas.Target.properties.targetId.description

#### firestore:v1beta2

The following keys were added:
- schemas.GoogleFirestoreAdminV1CreateDatabaseMetadata.description
- schemas.GoogleFirestoreAdminV1CreateDatabaseMetadata.id
- schemas.GoogleFirestoreAdminV1CreateDatabaseMetadata.type
- schemas.GoogleFirestoreAdminV1DeleteDatabaseMetadata.description
- schemas.GoogleFirestoreAdminV1DeleteDatabaseMetadata.id
- schemas.GoogleFirestoreAdminV1DeleteDatabaseMetadata.type

#### firestore:v1

The following keys were deleted:
- schemas.Document.properties.fields.description

The following keys were added:
- schemas.GoogleFirestoreAdminV1CreateDatabaseMetadata.description
- schemas.GoogleFirestoreAdminV1CreateDatabaseMetadata.id
- schemas.GoogleFirestoreAdminV1CreateDatabaseMetadata.type
- schemas.GoogleFirestoreAdminV1DeleteDatabaseMetadata.description
- schemas.GoogleFirestoreAdminV1DeleteDatabaseMetadata.id
- schemas.GoogleFirestoreAdminV1DeleteDatabaseMetadata.type

The following keys were changed:
- resources.projects.resources.databases.methods.restore.description
- schemas.FieldReference.properties.fieldPath.description
- schemas.GoogleFirestoreAdminV1Backup.description
- schemas.GoogleFirestoreAdminV1Database.description
- schemas.Target.properties.targetId.description
  • Loading branch information
yoshi-automation authored and sofisl committed Sep 22, 2023
1 parent 22bb1f7 commit 13d1762
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 25 deletions.
25 changes: 18 additions & 7 deletions discovery/firestore-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
]
},
"restore": {
"description": "Create a new database by restore from an existing backup. The new database must be in the same cloud region or multi-region location as the existing backup. This behaves similar to FirestoreAdmin.CreateDatabase except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing backup. The long-running operation can be used to track the progress of the restore, with the Operation's metadata field type being the RestoreDatabaseMetadata. The response type is the Database if the restore was successful. The new database is not readable or writeable until the LRO has completed. Cancelling the returned operation will stop the restore and delete the in-progress database, if the restore is still active.",
"description": "Creates a new database by restoring from an existing backup. The new database must be in the same cloud region or multi-region location as the existing backup. This behaves similar to FirestoreAdmin.CreateDatabase except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing backup. The long-running operation can be used to track the progress of the restore, with the Operation's metadata field type being the RestoreDatabaseMetadata. The response type is the Database if the restore was successful. The new database is not readable or writeable until the LRO has completed.",
"flatPath": "v1/projects/{projectsId}/databases:restore",
"httpMethod": "POST",
"id": "firestore.projects.databases.restore",
Expand Down Expand Up @@ -1672,7 +1672,7 @@
}
}
},
"revision": "20230806",
"revision": "20230905",
"rootUrl": "https://firestore.googleapis.com/",
"schemas": {
"Aggregation": {
Expand Down Expand Up @@ -2016,7 +2016,6 @@
"additionalProperties": {
"$ref": "Value"
},
"description": "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`. 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 ``.",
"type": "object"
},
"name": {
Expand Down Expand Up @@ -2229,7 +2228,7 @@
"id": "FieldReference",
"properties": {
"fieldPath": {
"description": "The relative path of the document being referenced. Requires: * Conform to document field name limitations.",
"description": "A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.",
"type": "string"
}
},
Expand Down Expand Up @@ -2298,7 +2297,7 @@
"type": "object"
},
"GoogleFirestoreAdminV1Backup": {
"description": "A Backup of a Cloud Firestore Database. The backup contains all documents and index configurations for the given database at specific point in time.",
"description": "A Backup of a Cloud Firestore Database. The backup contains all documents and index configurations for the given database at a specific point in time.",
"id": "GoogleFirestoreAdminV1Backup",
"properties": {
"database": {
Expand Down Expand Up @@ -2390,14 +2389,20 @@
},
"type": "object"
},
"GoogleFirestoreAdminV1CreateDatabaseMetadata": {
"description": "Metadata related to the create database operation.",
"id": "GoogleFirestoreAdminV1CreateDatabaseMetadata",
"properties": {},
"type": "object"
},
"GoogleFirestoreAdminV1DailyRecurrence": {
"description": "Represent a recurring schedule that runs at a specific time every day. The time zone is UTC.",
"id": "GoogleFirestoreAdminV1DailyRecurrence",
"properties": {},
"type": "object"
},
"GoogleFirestoreAdminV1Database": {
"description": "A Cloud Firestore Database. Currently only one database is allowed per cloud project; this database must have a `database_id` of '(default)'.",
"description": "A Cloud Firestore Database.",
"id": "GoogleFirestoreAdminV1Database",
"properties": {
"appEngineIntegrationMode": {
Expand Down Expand Up @@ -2521,6 +2526,12 @@
},
"type": "object"
},
"GoogleFirestoreAdminV1DeleteDatabaseMetadata": {
"description": "Metadata related to the delete database operation.",
"id": "GoogleFirestoreAdminV1DeleteDatabaseMetadata",
"properties": {},
"type": "object"
},
"GoogleFirestoreAdminV1ExportDocumentsMetadata": {
"description": "Metadata for google.longrunning.Operation results from FirestoreAdmin.ExportDocuments.",
"id": "GoogleFirestoreAdminV1ExportDocumentsMetadata",
Expand Down Expand Up @@ -3934,7 +3945,7 @@
"type": "string"
},
"targetId": {
"description": "The target ID that identifies the target on the stream. Must be a positive number and non-zero.",
"description": "The target ID that identifies the target on the stream. Must be a positive number and non-zero. If `target_id` is 0 (or unspecified), the server will assign an ID for this target and return that in a `TargetChange::ADD` event. Once a target with `target_id=0` is added, all subsequent targets must also have `target_id=0`. If an `AddTarget` request with `target_id != 0` is sent to the server after a target with `target_id=0` is added, the server will immediately send a response with a `TargetChange::Remove` event. Note that if the client sends multiple `AddTarget` requests without an ID, the order of IDs returned in `TargetChage.target_ids` are undefined. Therefore, clients should provide a target ID instead of relying on the server to assign one. If `target_id` is non-zero, there must not be an existing active target on this stream with the same ID.",
"format": "int32",
"type": "integer"
}
Expand Down
19 changes: 15 additions & 4 deletions discovery/firestore-v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@
}
}
},
"revision": "20230806",
"revision": "20230905",
"rootUrl": "https://firestore.googleapis.com/",
"schemas": {
"Aggregation": {
Expand Down Expand Up @@ -1294,7 +1294,6 @@
"additionalProperties": {
"$ref": "Value"
},
"description": "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`. 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 ``.",
"type": "object"
},
"name": {
Expand Down Expand Up @@ -1507,7 +1506,7 @@
"id": "FieldReference",
"properties": {
"fieldPath": {
"description": "The relative path of the document being referenced. Requires: * Conform to document field name limitations.",
"description": "A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.",
"type": "string"
}
},
Expand Down Expand Up @@ -1575,6 +1574,18 @@
},
"type": "object"
},
"GoogleFirestoreAdminV1CreateDatabaseMetadata": {
"description": "Metadata related to the create database operation.",
"id": "GoogleFirestoreAdminV1CreateDatabaseMetadata",
"properties": {},
"type": "object"
},
"GoogleFirestoreAdminV1DeleteDatabaseMetadata": {
"description": "Metadata related to the delete database operation.",
"id": "GoogleFirestoreAdminV1DeleteDatabaseMetadata",
"properties": {},
"type": "object"
},
"GoogleFirestoreAdminV1Progress": {
"description": "Describes the progress of the operation. Unit of work is generic and must be interpreted based on where Progress is used.",
"id": "GoogleFirestoreAdminV1Progress",
Expand Down Expand Up @@ -2528,7 +2539,7 @@
"type": "string"
},
"targetId": {
"description": "The target ID that identifies the target on the stream. Must be a positive number and non-zero.",
"description": "The target ID that identifies the target on the stream. Must be a positive number and non-zero. If `target_id` is 0 (or unspecified), the server will assign an ID for this target and return that in a `TargetChange::ADD` event. Once a target with `target_id=0` is added, all subsequent targets must also have `target_id=0`. If an `AddTarget` request with `target_id != 0` is sent to the server after a target with `target_id=0` is added, the server will immediately send a response with a `TargetChange::Remove` event. Note that if the client sends multiple `AddTarget` requests without an ID, the order of IDs returned in `TargetChage.target_ids` are undefined. Therefore, clients should provide a target ID instead of relying on the server to assign one. If `target_id` is non-zero, there must not be an existing active target on this stream with the same ID.",
"format": "int32",
"type": "integer"
}
Expand Down
14 changes: 13 additions & 1 deletion discovery/firestore-v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
}
}
},
"revision": "20230806",
"revision": "20230905",
"rootUrl": "https://firestore.googleapis.com/",
"schemas": {
"Empty": {
Expand All @@ -424,6 +424,18 @@
"properties": {},
"type": "object"
},
"GoogleFirestoreAdminV1CreateDatabaseMetadata": {
"description": "Metadata related to the create database operation.",
"id": "GoogleFirestoreAdminV1CreateDatabaseMetadata",
"properties": {},
"type": "object"
},
"GoogleFirestoreAdminV1DeleteDatabaseMetadata": {
"description": "Metadata related to the delete database operation.",
"id": "GoogleFirestoreAdminV1DeleteDatabaseMetadata",
"properties": {},
"type": "object"
},
"GoogleFirestoreAdminV1Progress": {
"description": "Describes the progress of the operation. Unit of work is generic and must be interpreted based on where Progress is used.",
"id": "GoogleFirestoreAdminV1Progress",
Expand Down
21 changes: 13 additions & 8 deletions src/apis/firestore/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,6 @@ export namespace firestore_v1 {
* 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.
*/
createTime?: string | null;
/**
* 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`. 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 ``.
*/
fields?: {[key: string]: Schema$Value} | null;
/**
* The resource name of the document, for example `projects/{project_id\}/databases/{database_id\}/documents/{document_path\}`.
Expand Down Expand Up @@ -508,7 +505,7 @@ export namespace firestore_v1 {
*/
export interface Schema$FieldReference {
/**
* The relative path of the document being referenced. Requires: * Conform to document field name limitations.
* A reference to a field in a document. Requires: * MUST be a dot-delimited (`.`) string of segments, where each segment conforms to document field name limitations.
*/
fieldPath?: string | null;
}
Expand Down Expand Up @@ -563,7 +560,7 @@ export namespace firestore_v1 {
unaryFilter?: Schema$UnaryFilter;
}
/**
* A Backup of a Cloud Firestore Database. The backup contains all documents and index configurations for the given database at specific point in time.
* A Backup of a Cloud Firestore Database. The backup contains all documents and index configurations for the given database at a specific point in time.
*/
export interface Schema$GoogleFirestoreAdminV1Backup {
/**
Expand Down Expand Up @@ -624,12 +621,16 @@ export namespace firestore_v1 {
*/
weeklyRecurrence?: Schema$GoogleFirestoreAdminV1WeeklyRecurrence;
}
/**
* Metadata related to the create database operation.
*/
export interface Schema$GoogleFirestoreAdminV1CreateDatabaseMetadata {}
/**
* Represent a recurring schedule that runs at a specific time every day. The time zone is UTC.
*/
export interface Schema$GoogleFirestoreAdminV1DailyRecurrence {}
/**
* A Cloud Firestore Database. Currently only one database is allowed per cloud project; this database must have a `database_id` of '(default)'.
* A Cloud Firestore Database.
*/
export interface Schema$GoogleFirestoreAdminV1Database {
/**
Expand Down Expand Up @@ -689,6 +690,10 @@ export namespace firestore_v1 {
*/
versionRetentionPeriod?: string | null;
}
/**
* Metadata related to the delete database operation.
*/
export interface Schema$GoogleFirestoreAdminV1DeleteDatabaseMetadata {}
/**
* Metadata for google.longrunning.Operation results from FirestoreAdmin.ExportDocuments.
*/
Expand Down Expand Up @@ -1626,7 +1631,7 @@ export namespace firestore_v1 {
*/
resumeToken?: string | null;
/**
* The target ID that identifies the target on the stream. Must be a positive number and non-zero.
* The target ID that identifies the target on the stream. Must be a positive number and non-zero. If `target_id` is 0 (or unspecified), the server will assign an ID for this target and return that in a `TargetChange::ADD` event. Once a target with `target_id=0` is added, all subsequent targets must also have `target_id=0`. If an `AddTarget` request with `target_id != 0` is sent to the server after a target with `target_id=0` is added, the server will immediately send a response with a `TargetChange::Remove` event. Note that if the client sends multiple `AddTarget` requests without an ID, the order of IDs returned in `TargetChage.target_ids` are undefined. Therefore, clients should provide a target ID instead of relying on the server to assign one. If `target_id` is non-zero, there must not be an existing active target on this stream with the same ID.
*/
targetId?: number | null;
}
Expand Down Expand Up @@ -2500,7 +2505,7 @@ export namespace firestore_v1 {
}

/**
* Create a new database by restore from an existing backup. The new database must be in the same cloud region or multi-region location as the existing backup. This behaves similar to FirestoreAdmin.CreateDatabase except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing backup. The long-running operation can be used to track the progress of the restore, with the Operation's metadata field type being the RestoreDatabaseMetadata. The response type is the Database if the restore was successful. The new database is not readable or writeable until the LRO has completed. Cancelling the returned operation will stop the restore and delete the in-progress database, if the restore is still active.
* Creates a new database by restoring from an existing backup. The new database must be in the same cloud region or multi-region location as the existing backup. This behaves similar to FirestoreAdmin.CreateDatabase except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing backup. The long-running operation can be used to track the progress of the restore, with the Operation's metadata field type being the RestoreDatabaseMetadata. The response type is the Database if the restore was successful. The new database is not readable or writeable until the LRO has completed.
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
Expand Down

0 comments on commit 13d1762

Please sign in to comment.