diff --git a/protos/google/datastore/admin/v1/datastore_admin.proto b/protos/google/datastore/admin/v1/datastore_admin.proto index 744d97df7..79ca3df68 100644 --- a/protos/google/datastore/admin/v1/datastore_admin.proto +++ b/protos/google/datastore/admin/v1/datastore_admin.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,14 +34,10 @@ option ruby_package = "Google::Cloud::Datastore::Admin::V1"; // Google Cloud Datastore Admin API // -// // The Datastore Admin API provides several admin services for Cloud Datastore. // -// ----------------------------------------------------------------------------- -// ## Concepts -// -// Project, namespace, kind, and entity as defined in the Google Cloud Datastore -// API. +// Concepts: Project, namespace, kind, and entity as defined in the Google Cloud +// Datastore API. // // Operation: An Operation represents work being performed in the background. // @@ -49,50 +45,40 @@ option ruby_package = "Google::Cloud::Datastore::Admin::V1"; // specified as a combination of kinds and namespaces (either or both of which // may be all). // -// ----------------------------------------------------------------------------- -// ## Services -// -// # Export/Import +// Export/Import Service: // -// The Export/Import service provides the ability to copy all or a subset of +// - The Export/Import service provides the ability to copy all or a subset of // entities to/from Google Cloud Storage. -// -// Exported data may be imported into Cloud Datastore for any Google Cloud +// - Exported data may be imported into Cloud Datastore for any Google Cloud // Platform project. It is not restricted to the export source project. It is // possible to export from one project and then import into another. -// -// Exported data can also be loaded into Google BigQuery for analysis. -// -// Exports and imports are performed asynchronously. An Operation resource is +// - Exported data can also be loaded into Google BigQuery for analysis. +// - Exports and imports are performed asynchronously. An Operation resource is // created for each export/import. The state (including any errors encountered) // of the export/import may be queried via the Operation resource. // -// # Index +// Index Service: // -// The index service manages Cloud Datastore composite indexes. -// -// Index creation and deletion are performed asynchronously. +// - The index service manages Cloud Datastore composite indexes. +// - Index creation and deletion are performed asynchronously. // An Operation resource is created for each such asynchronous operation. // The state of the operation (including any errors encountered) // may be queried via the Operation resource. // -// # Operation +// Operation Service: // -// The Operations collection provides a record of actions performed for the +// - The Operations collection provides a record of actions performed for the // specified project (including any operations in progress). Operations are not // created directly but through calls on other collections or resources. -// -// An operation that is not yet done may be cancelled. The request to cancel is -// asynchronous and the operation may continue to run for some time after the +// - An operation that is not yet done may be cancelled. The request to cancel +// is asynchronous and the operation may continue to run for some time after the // request to cancel is made. -// -// An operation that is done may be deleted so that it is no longer listed as +// - An operation that is done may be deleted so that it is no longer listed as // part of the Operation collection. -// -// ListOperations returns all pending operations, but not completed operations. -// -// Operations are created by service DatastoreAdmin, -// but are accessed via service google.longrunning.Operations. +// - ListOperations returns all pending operations, but not completed +// operations. +// - Operations are created by service DatastoreAdmin, but are accessed via +// service google.longrunning.Operations. service DatastoreAdmin { option (google.api.default_host) = "datastore.googleapis.com"; option (google.api.oauth_scopes) = @@ -107,12 +93,14 @@ service DatastoreAdmin { // used once the associated operation is done. If an export operation is // cancelled before completion it may leave partial data behind in Google // Cloud Storage. - rpc ExportEntities(ExportEntitiesRequest) returns (google.longrunning.Operation) { + rpc ExportEntities(ExportEntitiesRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/projects/{project_id}:export" body: "*" }; - option (google.api.method_signature) = "project_id,labels,entity_filter,output_url_prefix"; + option (google.api.method_signature) = + "project_id,labels,entity_filter,output_url_prefix"; option (google.longrunning.operation_info) = { response_type: "ExportEntitiesResponse" metadata_type: "ExportEntitiesMetadata" @@ -124,12 +112,14 @@ service DatastoreAdmin { // progress can be monitored and managed via the Operation resource that is // created. If an ImportEntities operation is cancelled, it is possible // that a subset of the data has already been imported to Cloud Datastore. - rpc ImportEntities(ImportEntitiesRequest) returns (google.longrunning.Operation) { + rpc ImportEntities(ImportEntitiesRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/projects/{project_id}:import" body: "*" }; - option (google.api.method_signature) = "project_id,labels,input_url,entity_filter"; + option (google.api.method_signature) = + "project_id,labels,input_url,entity_filter"; option (google.longrunning.operation_info) = { response_type: "google.protobuf.Empty" metadata_type: "ImportEntitiesMetadata" @@ -138,9 +128,9 @@ service DatastoreAdmin { // Creates the specified index. // A newly created index's initial state is `CREATING`. On completion of the - // returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. - // If the index already exists, the call will return an `ALREADY_EXISTS` - // status. + // returned [google.longrunning.Operation][google.longrunning.Operation], the + // state will be `READY`. If the index already exists, the call will return an + // `ALREADY_EXISTS` status. // // During index creation, the process could result in an error, in which // case the index will move to the `ERROR` state. The process can be recovered @@ -165,7 +155,8 @@ service DatastoreAdmin { // An index can only be deleted if it is in a `READY` or `ERROR` state. On // successful execution of the request, the index will be in a `DELETING` // [state][google.datastore.admin.v1.Index.State]. And on completion of the - // returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. + // returned [google.longrunning.Operation][google.longrunning.Operation], the + // index will be removed. // // During index deletion, the process could result in an error, in which // case the index will move to the `ERROR` state. The process can be recovered @@ -283,8 +274,8 @@ message ExportEntitiesRequest { // // The resulting files will be nested deeper than the specified URL prefix. // The final output URL will be provided in the - // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That - // value should be used for subsequent ImportEntities operations. + // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + // field. That value should be used for subsequent ImportEntities operations. // // By nesting the data files deeper, the same Cloud Storage bucket can be used // in multiple ExportEntities operations without conflict. @@ -300,8 +291,9 @@ message ImportEntitiesRequest { // Client-assigned labels. map labels = 2; - // Required. The full resource URL of the external storage location. Currently, only - // Google Cloud Storage is supported. So input_url should be of the form: + // Required. The full resource URL of the external storage location. + // Currently, only Google Cloud Storage is supported. So input_url should be + // of the form: // `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where // `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is // an optional Cloud Storage namespace path (this is not a Cloud Datastore @@ -369,7 +361,9 @@ message ImportEntitiesMetadata { EntityFilter entity_filter = 4; // The location of the import metadata file. This will be the same value as - // the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. + // the + // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + // field. string input_url = 5; } @@ -427,7 +421,8 @@ message DeleteIndexRequest { string index_id = 3; } -// The request for [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex]. +// The request for +// [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex]. message GetIndexRequest { // Project ID against which to make the request. string project_id = 1; diff --git a/protos/google/datastore/admin/v1/index.proto b/protos/google/datastore/admin/v1/index.proto index 4eeffc7e4..60bb5af5f 100644 --- a/protos/google/datastore/admin/v1/index.proto +++ b/protos/google/datastore/admin/v1/index.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -60,7 +60,8 @@ message Index { // Required. The property name to index. string name = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED. + // Required. The indexed property's direction. Must not be + // DIRECTION_UNSPECIFIED. Direction direction = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -104,11 +105,17 @@ message Index { // Required. The entity kind to which this index applies. string kind = 4 [(google.api.field_behavior) = REQUIRED]; - // Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED. + // Required. The index's ancestor mode. Must not be + // ANCESTOR_MODE_UNSPECIFIED. AncestorMode ancestor = 5 [(google.api.field_behavior) = REQUIRED]; // Required. An ordered sequence of property names and their index attributes. - repeated IndexedProperty properties = 6 [(google.api.field_behavior) = REQUIRED]; + // + // Requires: + // + // * A maximum of 100 properties. + repeated IndexedProperty properties = 6 + [(google.api.field_behavior) = REQUIRED]; // Output only. The state of the index. State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/protos/google/datastore/admin/v1/migration.proto b/protos/google/datastore/admin/v1/migration.proto index f47cb70e1..e5f7477da 100644 --- a/protos/google/datastore/admin/v1/migration.proto +++ b/protos/google/datastore/admin/v1/migration.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/google/datastore/v1/datastore.proto b/protos/google/datastore/v1/datastore.proto index 4822048b6..533988d77 100644 --- a/protos/google/datastore/v1/datastore.proto +++ b/protos/google/datastore/v1/datastore.proto @@ -578,9 +578,12 @@ message ReadOptions { // [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction]. TransactionOptions new_transaction = 3; - // Reads entities as they were at the given time. This may not be older - // than 270 seconds. This value is only supported for Cloud Firestore in - // Datastore mode. + // Reads entities as they were at the given time. This value is only + // supported for Cloud Firestore in Datastore mode. + // + // This must be a microsecond precision timestamp within the past one hour, + // or if Point-in-Time Recovery is enabled, can additionally be a whole + // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 4; } } @@ -602,7 +605,10 @@ message TransactionOptions { // Options specific to read-only transactions. message ReadOnly { // Reads entities at the given time. - // This may not be older than 60 seconds. + // + // This must be a microsecond precision timestamp within the past one hour, + // or if Point-in-Time Recovery is enabled, can additionally be a whole + // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 1; } diff --git a/protos/google/datastore/v1/query.proto b/protos/google/datastore/v1/query.proto index 812bfbf05..40ade72a3 100644 --- a/protos/google/datastore/v1/query.proto +++ b/protos/google/datastore/v1/query.proto @@ -163,10 +163,58 @@ message AggregationQuery { [(google.api.field_behavior) = OPTIONAL]; } + // Sum of the values of the requested property. + // + // * Only numeric values will be aggregated. All non-numeric values + // including `NULL` are skipped. + // + // * If the aggregated values contain `NaN`, returns `NaN`. Infinity math + // follows IEEE-754 standards. + // + // * If the aggregated value set is empty, returns 0. + // + // * Returns a 64-bit integer if all aggregated numbers are integers and the + // sum result does not overflow. Otherwise, the result is returned as a + // double. Note that even if all the aggregated values are integers, the + // result is returned as a double if it cannot fit within a 64-bit signed + // integer. When this occurs, the returned value will lose precision. + // + // * When underflow occurs, floating-point aggregation is non-deterministic. + // This means that running the same query repeatedly without any changes to + // the underlying values could produce slightly different results each + // time. In those cases, values should be stored as integers over + // floating-point numbers. + message Sum { + // The property to aggregate on. + PropertyReference property = 1; + } + + // Average of the values of the requested property. + // + // * Only numeric values will be aggregated. All non-numeric values + // including `NULL` are skipped. + // + // * If the aggregated values contain `NaN`, returns `NaN`. Infinity math + // follows IEEE-754 standards. + // + // * If the aggregated value set is empty, returns `NULL`. + // + // * Always returns the result as a double. + message Avg { + // The property to aggregate on. + PropertyReference property = 1; + } + // The type of aggregation to perform, required. oneof operator { // Count aggregator. Count count = 1; + + // Sum aggregator. + Sum sum = 2; + + // Average aggregator. + Avg avg = 3; } // Optional. Optional name of the property to store the result of the @@ -342,8 +390,9 @@ message PropertyFilter { // // Requires: // - // * That `value` is a non-empty `ArrayValue` with at most 10 values. - // * No other `IN` or `NOT_IN` is in the same query. + // * That `value` is a non-empty `ArrayValue`, subject to disjunction + // limits. + // * No `NOT_IN` is in the same query. IN = 6; // The given `property` is not equal to the given `value`. @@ -359,7 +408,7 @@ message PropertyFilter { // Requires: // // * That `value` is an entity key. - // * No other `HAS_ANCESTOR` is in the same query. + // * All evaluated disjunctions must have the same `HAS_ANCESTOR` filter. HAS_ANCESTOR = 11; // The value of the `property` is not in the given array. @@ -367,7 +416,7 @@ message PropertyFilter { // Requires: // // * That `value` is a non-empty `ArrayValue` with at most 10 values. - // * No other `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query. + // * No other `OR`, `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query. // * That `field` comes first in the `order_by`. NOT_IN = 13; } diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 95e786a8c..6000d78f9 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -3826,6 +3826,12 @@ export namespace google { /** Aggregation count */ count?: (google.datastore.v1.AggregationQuery.Aggregation.ICount|null); + /** Aggregation sum */ + sum?: (google.datastore.v1.AggregationQuery.Aggregation.ISum|null); + + /** Aggregation avg */ + avg?: (google.datastore.v1.AggregationQuery.Aggregation.IAvg|null); + /** Aggregation alias */ alias?: (string|null); } @@ -3842,11 +3848,17 @@ export namespace google { /** Aggregation count. */ public count?: (google.datastore.v1.AggregationQuery.Aggregation.ICount|null); + /** Aggregation sum. */ + public sum?: (google.datastore.v1.AggregationQuery.Aggregation.ISum|null); + + /** Aggregation avg. */ + public avg?: (google.datastore.v1.AggregationQuery.Aggregation.IAvg|null); + /** Aggregation alias. */ public alias: string; /** Aggregation operator. */ - public operator?: "count"; + public operator?: ("count"|"sum"|"avg"); /** * Creates a new Aggregation instance using the specified properties. @@ -4024,6 +4036,200 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a Sum. */ + interface ISum { + + /** Sum property */ + property?: (google.datastore.v1.IPropertyReference|null); + } + + /** Represents a Sum. */ + class Sum implements ISum { + + /** + * Constructs a new Sum. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.AggregationQuery.Aggregation.ISum); + + /** Sum property. */ + public property?: (google.datastore.v1.IPropertyReference|null); + + /** + * Creates a new Sum instance using the specified properties. + * @param [properties] Properties to set + * @returns Sum instance + */ + public static create(properties?: google.datastore.v1.AggregationQuery.Aggregation.ISum): google.datastore.v1.AggregationQuery.Aggregation.Sum; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.AggregationQuery.Aggregation.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Sum.verify|verify} messages. + * @param message Sum message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.AggregationQuery.Aggregation.ISum, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationQuery.Aggregation.Sum; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationQuery.Aggregation.Sum; + + /** + * Verifies a Sum message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sum + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery.Aggregation.Sum; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @param message Sum + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.AggregationQuery.Aggregation.Sum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sum to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sum + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Avg. */ + interface IAvg { + + /** Avg property */ + property?: (google.datastore.v1.IPropertyReference|null); + } + + /** Represents an Avg. */ + class Avg implements IAvg { + + /** + * Constructs a new Avg. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.AggregationQuery.Aggregation.IAvg); + + /** Avg property. */ + public property?: (google.datastore.v1.IPropertyReference|null); + + /** + * Creates a new Avg instance using the specified properties. + * @param [properties] Properties to set + * @returns Avg instance + */ + public static create(properties?: google.datastore.v1.AggregationQuery.Aggregation.IAvg): google.datastore.v1.AggregationQuery.Aggregation.Avg; + + /** + * Encodes the specified Avg message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Avg.verify|verify} messages. + * @param message Avg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.AggregationQuery.Aggregation.IAvg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Avg message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Avg.verify|verify} messages. + * @param message Avg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.AggregationQuery.Aggregation.IAvg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Avg message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Avg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationQuery.Aggregation.Avg; + + /** + * Decodes an Avg message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Avg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationQuery.Aggregation.Avg; + + /** + * Verifies an Avg message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Avg message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Avg + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery.Aggregation.Avg; + + /** + * Creates a plain object from an Avg message. Also converts values to other types if specified. + * @param message Avg + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.AggregationQuery.Aggregation.Avg, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Avg to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Avg + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } } diff --git a/protos/protos.js b/protos/protos.js index 98f1b3f16..6e5cd37c8 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -9916,6 +9916,8 @@ * @memberof google.datastore.v1.AggregationQuery * @interface IAggregation * @property {google.datastore.v1.AggregationQuery.Aggregation.ICount|null} [count] Aggregation count + * @property {google.datastore.v1.AggregationQuery.Aggregation.ISum|null} [sum] Aggregation sum + * @property {google.datastore.v1.AggregationQuery.Aggregation.IAvg|null} [avg] Aggregation avg * @property {string|null} [alias] Aggregation alias */ @@ -9942,6 +9944,22 @@ */ Aggregation.prototype.count = null; + /** + * Aggregation sum. + * @member {google.datastore.v1.AggregationQuery.Aggregation.ISum|null|undefined} sum + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @instance + */ + Aggregation.prototype.sum = null; + + /** + * Aggregation avg. + * @member {google.datastore.v1.AggregationQuery.Aggregation.IAvg|null|undefined} avg + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @instance + */ + Aggregation.prototype.avg = null; + /** * Aggregation alias. * @member {string} alias @@ -9955,12 +9973,12 @@ /** * Aggregation operator. - * @member {"count"|undefined} operator + * @member {"count"|"sum"|"avg"|undefined} operator * @memberof google.datastore.v1.AggregationQuery.Aggregation * @instance */ Object.defineProperty(Aggregation.prototype, "operator", { - get: $util.oneOfGetter($oneOfFields = ["count"]), + get: $util.oneOfGetter($oneOfFields = ["count", "sum", "avg"]), set: $util.oneOfSetter($oneOfFields) }); @@ -9990,6 +10008,10 @@ writer = $Writer.create(); if (message.count != null && Object.hasOwnProperty.call(message, "count")) $root.google.datastore.v1.AggregationQuery.Aggregation.Count.encode(message.count, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.encode(message.sum, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.avg != null && Object.hasOwnProperty.call(message, "avg")) + $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.encode(message.avg, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.alias); return writer; @@ -10030,6 +10052,14 @@ message.count = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.decode(reader, reader.uint32()); break; } + case 2: { + message.sum = $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.decode(reader, reader.uint32()); + break; + } + case 3: { + message.avg = $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.decode(reader, reader.uint32()); + break; + } case 7: { message.alias = reader.string(); break; @@ -10078,6 +10108,26 @@ return "count." + error; } } + if (message.sum != null && message.hasOwnProperty("sum")) { + if (properties.operator === 1) + return "operator: multiple values"; + properties.operator = 1; + { + var error = $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.verify(message.sum); + if (error) + return "sum." + error; + } + } + if (message.avg != null && message.hasOwnProperty("avg")) { + if (properties.operator === 1) + return "operator: multiple values"; + properties.operator = 1; + { + var error = $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.verify(message.avg); + if (error) + return "avg." + error; + } + } if (message.alias != null && message.hasOwnProperty("alias")) if (!$util.isString(message.alias)) return "alias: string expected"; @@ -10101,6 +10151,16 @@ throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.count: object expected"); message.count = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.fromObject(object.count); } + if (object.sum != null) { + if (typeof object.sum !== "object") + throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.sum: object expected"); + message.sum = $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.fromObject(object.sum); + } + if (object.avg != null) { + if (typeof object.avg !== "object") + throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.avg: object expected"); + message.avg = $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.fromObject(object.avg); + } if (object.alias != null) message.alias = String(object.alias); return message; @@ -10126,6 +10186,16 @@ if (options.oneofs) object.operator = "count"; } + if (message.sum != null && message.hasOwnProperty("sum")) { + object.sum = $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.toObject(message.sum, options); + if (options.oneofs) + object.operator = "sum"; + } + if (message.avg != null && message.hasOwnProperty("avg")) { + object.avg = $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.toObject(message.avg, options); + if (options.oneofs) + object.operator = "avg"; + } if (message.alias != null && message.hasOwnProperty("alias")) object.alias = message.alias; return object; @@ -10365,6 +10435,422 @@ return Count; })(); + Aggregation.Sum = (function() { + + /** + * Properties of a Sum. + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @interface ISum + * @property {google.datastore.v1.IPropertyReference|null} [property] Sum property + */ + + /** + * Constructs a new Sum. + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @classdesc Represents a Sum. + * @implements ISum + * @constructor + * @param {google.datastore.v1.AggregationQuery.Aggregation.ISum=} [properties] Properties to set + */ + function Sum(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Sum property. + * @member {google.datastore.v1.IPropertyReference|null|undefined} property + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @instance + */ + Sum.prototype.property = null; + + /** + * Creates a new Sum instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.ISum=} [properties] Properties to set + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Sum} Sum instance + */ + Sum.create = function create(properties) { + return new Sum(properties); + }; + + /** + * Encodes the specified Sum message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Sum.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + $root.google.datastore.v1.PropertyReference.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Sum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sum message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Sum(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sum message. + * @function verify + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.datastore.v1.PropertyReference.verify(message.property); + if (error) + return "property." + error; + } + return null; + }; + + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Sum} Sum + */ + Sum.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation.Sum) + return object; + var message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Sum(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.Sum.property: object expected"); + message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); + } + return message; + }; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.Sum} message Sum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.property = null; + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); + return object; + }; + + /** + * Converts this Sum to JSON. + * @function toJSON + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @instance + * @returns {Object.} JSON object + */ + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sum + * @function getTypeUrl + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.datastore.v1.AggregationQuery.Aggregation.Sum"; + }; + + return Sum; + })(); + + Aggregation.Avg = (function() { + + /** + * Properties of an Avg. + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @interface IAvg + * @property {google.datastore.v1.IPropertyReference|null} [property] Avg property + */ + + /** + * Constructs a new Avg. + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @classdesc Represents an Avg. + * @implements IAvg + * @constructor + * @param {google.datastore.v1.AggregationQuery.Aggregation.IAvg=} [properties] Properties to set + */ + function Avg(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Avg property. + * @member {google.datastore.v1.IPropertyReference|null|undefined} property + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @instance + */ + Avg.prototype.property = null; + + /** + * Creates a new Avg instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.IAvg=} [properties] Properties to set + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Avg} Avg instance + */ + Avg.create = function create(properties) { + return new Avg(properties); + }; + + /** + * Encodes the specified Avg message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Avg.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.IAvg} message Avg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Avg.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + $root.google.datastore.v1.PropertyReference.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Avg message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Avg.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.IAvg} message Avg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Avg.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Avg message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Avg} Avg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Avg.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Avg(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Avg message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Avg} Avg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Avg.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Avg message. + * @function verify + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Avg.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.datastore.v1.PropertyReference.verify(message.property); + if (error) + return "property." + error; + } + return null; + }; + + /** + * Creates an Avg message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Avg} Avg + */ + Avg.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation.Avg) + return object; + var message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Avg(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.Avg.property: object expected"); + message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); + } + return message; + }; + + /** + * Creates a plain object from an Avg message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.Avg} message Avg + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Avg.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.property = null; + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); + return object; + }; + + /** + * Converts this Avg to JSON. + * @function toJSON + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @instance + * @returns {Object.} JSON object + */ + Avg.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Avg + * @function getTypeUrl + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Avg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.datastore.v1.AggregationQuery.Aggregation.Avg"; + }; + + return Avg; + })(); + return Aggregation; })(); diff --git a/protos/protos.json b/protos/protos.json index 2247c502a..e34eae8b0 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -900,7 +900,9 @@ "oneofs": { "operator": { "oneof": [ - "count" + "count", + "sum", + "avg" ] } }, @@ -909,6 +911,14 @@ "type": "Count", "id": 1 }, + "sum": { + "type": "Sum", + "id": 2 + }, + "avg": { + "type": "Avg", + "id": 3 + }, "alias": { "type": "string", "id": 7, @@ -928,6 +938,22 @@ } } } + }, + "Sum": { + "fields": { + "property": { + "type": "PropertyReference", + "id": 1 + } + } + }, + "Avg": { + "fields": { + "property": { + "type": "PropertyReference", + "id": 1 + } + } } } } diff --git a/samples/generated/v1/datastore.allocate_ids.js b/samples/generated/v1/datastore.allocate_ids.js index 57a33800a..2b5492b81 100644 --- a/samples/generated/v1/datastore.allocate_ids.js +++ b/samples/generated/v1/datastore.allocate_ids.js @@ -42,7 +42,7 @@ function main(projectId, keys) { * Required. A list of keys with incomplete key paths for which to allocate * IDs. No key may be reserved/read-only. */ - // const keys = 1234 + // const keys = [1,2,3,4] // Imports the Datastore library const {DatastoreClient} = require('@google-cloud/datastore').v1; diff --git a/samples/generated/v1/datastore.commit.js b/samples/generated/v1/datastore.commit.js index 9c3efa676..70ed210a3 100644 --- a/samples/generated/v1/datastore.commit.js +++ b/samples/generated/v1/datastore.commit.js @@ -47,7 +47,7 @@ function main(projectId) { * transaction identifier is returned by a call to * Datastore.BeginTransaction google.datastore.v1.Datastore.BeginTransaction. */ - // const transaction = 'Buffer.from('string')' + // const transaction = Buffer.from('string') /** * Options for beginning a new transaction for this request. * The transaction is committed when the request completes. If specified, @@ -67,7 +67,7 @@ function main(projectId) { * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single * entity. */ - // const mutations = 1234 + // const mutations = [1,2,3,4] // Imports the Datastore library const {DatastoreClient} = require('@google-cloud/datastore').v1; diff --git a/samples/generated/v1/datastore.lookup.js b/samples/generated/v1/datastore.lookup.js index 3fc79fb10..aa8742d87 100644 --- a/samples/generated/v1/datastore.lookup.js +++ b/samples/generated/v1/datastore.lookup.js @@ -45,7 +45,7 @@ function main(projectId, keys) { /** * Required. Keys of entities to look up. */ - // const keys = 1234 + // const keys = [1,2,3,4] // Imports the Datastore library const {DatastoreClient} = require('@google-cloud/datastore').v1; diff --git a/samples/generated/v1/datastore.reserve_ids.js b/samples/generated/v1/datastore.reserve_ids.js index 0a5c915aa..fc1eea72a 100644 --- a/samples/generated/v1/datastore.reserve_ids.js +++ b/samples/generated/v1/datastore.reserve_ids.js @@ -42,7 +42,7 @@ function main(projectId, keys) { * Required. A list of keys with complete key paths whose numeric IDs should * not be auto-allocated. */ - // const keys = 1234 + // const keys = [1,2,3,4] // Imports the Datastore library const {DatastoreClient} = require('@google-cloud/datastore').v1; diff --git a/samples/generated/v1/datastore.rollback.js b/samples/generated/v1/datastore.rollback.js index bdbbfaa2a..17927162c 100644 --- a/samples/generated/v1/datastore.rollback.js +++ b/samples/generated/v1/datastore.rollback.js @@ -42,7 +42,7 @@ function main(projectId, transaction) { * Required. The transaction identifier, returned by a call to * Datastore.BeginTransaction google.datastore.v1.Datastore.BeginTransaction. */ - // const transaction = 'Buffer.from('string')' + // const transaction = Buffer.from('string') // Imports the Datastore library const {DatastoreClient} = require('@google-cloud/datastore').v1; diff --git a/samples/generated/v1/datastore_admin.export_entities.js b/samples/generated/v1/datastore_admin.export_entities.js index 2b16823a2..757f63309 100644 --- a/samples/generated/v1/datastore_admin.export_entities.js +++ b/samples/generated/v1/datastore_admin.export_entities.js @@ -35,7 +35,7 @@ function main(projectId, outputUrlPrefix) { /** * Client-assigned labels. */ - // const labels = 1234 + // const labels = [1,2,3,4] /** * Description of what data from the project is included in the export. */ @@ -52,8 +52,8 @@ function main(projectId, outputUrlPrefix) { * considerations (https://cloud.google.com/storage/docs/naming#object-considerations). * The resulting files will be nested deeper than the specified URL prefix. * The final output URL will be provided in the - * google.datastore.admin.v1.ExportEntitiesResponse.output_url google.datastore.admin.v1.ExportEntitiesResponse.output_url field. That - * value should be used for subsequent ImportEntities operations. + * google.datastore.admin.v1.ExportEntitiesResponse.output_url google.datastore.admin.v1.ExportEntitiesResponse.output_url + * field. That value should be used for subsequent ImportEntities operations. * By nesting the data files deeper, the same Cloud Storage bucket can be used * in multiple ExportEntities operations without conflict. */ diff --git a/samples/generated/v1/datastore_admin.import_entities.js b/samples/generated/v1/datastore_admin.import_entities.js index 29ecd6fa5..8db576d2a 100644 --- a/samples/generated/v1/datastore_admin.import_entities.js +++ b/samples/generated/v1/datastore_admin.import_entities.js @@ -35,10 +35,11 @@ function main(projectId, inputUrl) { /** * Client-assigned labels. */ - // const labels = 1234 + // const labels = [1,2,3,4] /** - * Required. The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is * an optional Cloud Storage namespace path (this is not a Cloud Datastore diff --git a/samples/generated/v1/snippet_metadata_google.datastore.admin.v1.json b/samples/generated/v1/snippet_metadata_google.datastore.admin.v1.json new file mode 100644 index 000000000..a96b7eab4 --- /dev/null +++ b/samples/generated/v1/snippet_metadata_google.datastore.admin.v1.json @@ -0,0 +1,303 @@ +{ + "clientLibrary": { + "name": "nodejs-admin", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.datastore.admin.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "datastore_v1_generated_DatastoreAdmin_ExportEntities_async", + "title": "DatastoreAdmin exportEntities Sample", + "origin": "API_DEFINITION", + "description": " Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.", + "canonical": true, + "file": "datastore_admin.export_entities.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportEntities", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.ExportEntities", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "entity_filter", + "type": ".google.datastore.admin.v1.EntityFilter" + }, + { + "name": "output_url_prefix", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DatastoreAdminClient", + "fullName": "google.datastore.admin.v1.DatastoreAdminClient" + }, + "method": { + "shortName": "ExportEntities", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.ExportEntities", + "service": { + "shortName": "DatastoreAdmin", + "fullName": "google.datastore.admin.v1.DatastoreAdmin" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_DatastoreAdmin_ImportEntities_async", + "title": "DatastoreAdmin importEntities Sample", + "origin": "API_DEFINITION", + "description": " Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.", + "canonical": true, + "file": "datastore_admin.import_entities.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportEntities", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.ImportEntities", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "input_url", + "type": "TYPE_STRING" + }, + { + "name": "entity_filter", + "type": ".google.datastore.admin.v1.EntityFilter" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DatastoreAdminClient", + "fullName": "google.datastore.admin.v1.DatastoreAdminClient" + }, + "method": { + "shortName": "ImportEntities", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.ImportEntities", + "service": { + "shortName": "DatastoreAdmin", + "fullName": "google.datastore.admin.v1.DatastoreAdmin" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_DatastoreAdmin_CreateIndex_async", + "title": "DatastoreAdmin createIndex Sample", + "origin": "API_DEFINITION", + "description": " Creates the specified index. A newly created index's initial state is `CREATING`. On completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. If the index already exists, the call will return an `ALREADY_EXISTS` status. During index creation, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, removing the index with [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then re-creating the index with [create] [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. Indexes with a single property cannot be created.", + "canonical": true, + "file": "datastore_admin.create_index.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateIndex", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.CreateIndex", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "index", + "type": ".google.datastore.admin.v1.Index" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DatastoreAdminClient", + "fullName": "google.datastore.admin.v1.DatastoreAdminClient" + }, + "method": { + "shortName": "CreateIndex", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.CreateIndex", + "service": { + "shortName": "DatastoreAdmin", + "fullName": "google.datastore.admin.v1.DatastoreAdmin" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_DatastoreAdmin_DeleteIndex_async", + "title": "DatastoreAdmin deleteIndex Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing index. An index can only be deleted if it is in a `READY` or `ERROR` state. On successful execution of the request, the index will be in a `DELETING` [state][google.datastore.admin.v1.Index.State]. And on completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. During index deletion, the process could result in an error, in which case the index will move to the `ERROR` state. The process can be recovered by fixing the data that caused the error, followed by calling [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.", + "canonical": true, + "file": "datastore_admin.delete_index.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteIndex", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.DeleteIndex", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "index_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DatastoreAdminClient", + "fullName": "google.datastore.admin.v1.DatastoreAdminClient" + }, + "method": { + "shortName": "DeleteIndex", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.DeleteIndex", + "service": { + "shortName": "DatastoreAdmin", + "fullName": "google.datastore.admin.v1.DatastoreAdmin" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_DatastoreAdmin_GetIndex_async", + "title": "DatastoreAdmin getIndex Sample", + "origin": "API_DEFINITION", + "description": " Gets an index.", + "canonical": true, + "file": "datastore_admin.get_index.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIndex", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.GetIndex", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "index_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.datastore.admin.v1.Index", + "client": { + "shortName": "DatastoreAdminClient", + "fullName": "google.datastore.admin.v1.DatastoreAdminClient" + }, + "method": { + "shortName": "GetIndex", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.GetIndex", + "service": { + "shortName": "DatastoreAdmin", + "fullName": "google.datastore.admin.v1.DatastoreAdmin" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_DatastoreAdmin_ListIndexes_async", + "title": "DatastoreAdmin listIndexes Sample", + "origin": "API_DEFINITION", + "description": " Lists the indexes that match the specified filters. Datastore uses an eventually consistent query to fetch the list of indexes and may occasionally return stale results.", + "canonical": true, + "file": "datastore_admin.list_indexes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListIndexes", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.ListIndexes", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.datastore.admin.v1.ListIndexesResponse", + "client": { + "shortName": "DatastoreAdminClient", + "fullName": "google.datastore.admin.v1.DatastoreAdminClient" + }, + "method": { + "shortName": "ListIndexes", + "fullName": "google.datastore.admin.v1.DatastoreAdmin.ListIndexes", + "service": { + "shortName": "DatastoreAdmin", + "fullName": "google.datastore.admin.v1.DatastoreAdmin" + } + } + } + } + ] +} diff --git a/samples/generated/v1/snippet_metadata_google.datastore.v1.json b/samples/generated/v1/snippet_metadata_google.datastore.v1.json new file mode 100644 index 000000000..27ec516fc --- /dev/null +++ b/samples/generated/v1/snippet_metadata_google.datastore.v1.json @@ -0,0 +1,439 @@ +{ + "clientLibrary": { + "name": "nodejs-datastore", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.datastore.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "datastore_v1_generated_Datastore_Lookup_async", + "title": "datastore lookup Sample", + "origin": "API_DEFINITION", + "description": " Looks up entities by key.", + "canonical": true, + "file": "datastore.lookup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Lookup", + "fullName": "google.datastore.v1.Datastore.Lookup", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "read_options", + "type": ".google.datastore.v1.ReadOptions" + }, + { + "name": "keys", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.datastore.v1.LookupResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "Lookup", + "fullName": "google.datastore.v1.Datastore.Lookup", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_RunQuery_async", + "title": "datastore runQuery Sample", + "origin": "API_DEFINITION", + "description": " Queries for entities.", + "canonical": true, + "file": "datastore.run_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunQuery", + "fullName": "google.datastore.v1.Datastore.RunQuery", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "partition_id", + "type": ".google.datastore.v1.PartitionId" + }, + { + "name": "read_options", + "type": ".google.datastore.v1.ReadOptions" + }, + { + "name": "query", + "type": ".google.datastore.v1.Query" + }, + { + "name": "gql_query", + "type": ".google.datastore.v1.GqlQuery" + } + ], + "resultType": ".google.datastore.v1.RunQueryResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "RunQuery", + "fullName": "google.datastore.v1.Datastore.RunQuery", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_RunAggregationQuery_async", + "title": "datastore runAggregationQuery Sample", + "origin": "API_DEFINITION", + "description": " Runs an aggregation query.", + "canonical": true, + "file": "datastore.run_aggregation_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAggregationQuery", + "fullName": "google.datastore.v1.Datastore.RunAggregationQuery", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "partition_id", + "type": ".google.datastore.v1.PartitionId" + }, + { + "name": "read_options", + "type": ".google.datastore.v1.ReadOptions" + }, + { + "name": "aggregation_query", + "type": ".google.datastore.v1.AggregationQuery" + }, + { + "name": "gql_query", + "type": ".google.datastore.v1.GqlQuery" + } + ], + "resultType": ".google.datastore.v1.RunAggregationQueryResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "RunAggregationQuery", + "fullName": "google.datastore.v1.Datastore.RunAggregationQuery", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_BeginTransaction_async", + "title": "datastore beginTransaction Sample", + "origin": "API_DEFINITION", + "description": " Begins a new transaction.", + "canonical": true, + "file": "datastore.begin_transaction.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BeginTransaction", + "fullName": "google.datastore.v1.Datastore.BeginTransaction", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "transaction_options", + "type": ".google.datastore.v1.TransactionOptions" + } + ], + "resultType": ".google.datastore.v1.BeginTransactionResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "BeginTransaction", + "fullName": "google.datastore.v1.Datastore.BeginTransaction", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_Commit_async", + "title": "datastore commit Sample", + "origin": "API_DEFINITION", + "description": " Commits a transaction, optionally creating, deleting or modifying some entities.", + "canonical": true, + "file": "datastore.commit.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Commit", + "fullName": "google.datastore.v1.Datastore.Commit", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "mode", + "type": ".google.datastore.v1.CommitRequest.Mode" + }, + { + "name": "transaction", + "type": "TYPE_BYTES" + }, + { + "name": "single_use_transaction", + "type": ".google.datastore.v1.TransactionOptions" + }, + { + "name": "mutations", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.datastore.v1.CommitResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "Commit", + "fullName": "google.datastore.v1.Datastore.Commit", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_Rollback_async", + "title": "datastore rollback Sample", + "origin": "API_DEFINITION", + "description": " Rolls back a transaction.", + "canonical": true, + "file": "datastore.rollback.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Rollback", + "fullName": "google.datastore.v1.Datastore.Rollback", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "transaction", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.datastore.v1.RollbackResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "Rollback", + "fullName": "google.datastore.v1.Datastore.Rollback", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_AllocateIds_async", + "title": "datastore allocateIds Sample", + "origin": "API_DEFINITION", + "description": " Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted.", + "canonical": true, + "file": "datastore.allocate_ids.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AllocateIds", + "fullName": "google.datastore.v1.Datastore.AllocateIds", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "keys", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.datastore.v1.AllocateIdsResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "AllocateIds", + "fullName": "google.datastore.v1.Datastore.AllocateIds", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_ReserveIds_async", + "title": "datastore reserveIds Sample", + "origin": "API_DEFINITION", + "description": " Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore.", + "canonical": true, + "file": "datastore.reserve_ids.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReserveIds", + "fullName": "google.datastore.v1.Datastore.ReserveIds", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "keys", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.datastore.v1.ReserveIdsResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "ReserveIds", + "fullName": "google.datastore.v1.Datastore.ReserveIds", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + } + ] +} diff --git a/src/v1/datastore_admin_client.ts b/src/v1/datastore_admin_client.ts index 6698caf5a..2442e3c14 100644 --- a/src/v1/datastore_admin_client.ts +++ b/src/v1/datastore_admin_client.ts @@ -42,14 +42,10 @@ const version = require('../../../package.json').version; /** * Google Cloud Datastore Admin API * - * * The Datastore Admin API provides several admin services for Cloud Datastore. * - * ----------------------------------------------------------------------------- - * ## Concepts - * - * Project, namespace, kind, and entity as defined in the Google Cloud Datastore - * API. + * Concepts: Project, namespace, kind, and entity as defined in the Google Cloud + * Datastore API. * * Operation: An Operation represents work being performed in the background. * @@ -57,50 +53,40 @@ const version = require('../../../package.json').version; * specified as a combination of kinds and namespaces (either or both of which * may be all). * - * ----------------------------------------------------------------------------- - * ## Services - * - * # Export/Import + * Export/Import Service: * - * The Export/Import service provides the ability to copy all or a subset of + * - The Export/Import service provides the ability to copy all or a subset of * entities to/from Google Cloud Storage. - * - * Exported data may be imported into Cloud Datastore for any Google Cloud + * - Exported data may be imported into Cloud Datastore for any Google Cloud * Platform project. It is not restricted to the export source project. It is * possible to export from one project and then import into another. - * - * Exported data can also be loaded into Google BigQuery for analysis. - * - * Exports and imports are performed asynchronously. An Operation resource is + * - Exported data can also be loaded into Google BigQuery for analysis. + * - Exports and imports are performed asynchronously. An Operation resource is * created for each export/import. The state (including any errors encountered) * of the export/import may be queried via the Operation resource. * - * # Index + * Index Service: * - * The index service manages Cloud Datastore composite indexes. - * - * Index creation and deletion are performed asynchronously. + * - The index service manages Cloud Datastore composite indexes. + * - Index creation and deletion are performed asynchronously. * An Operation resource is created for each such asynchronous operation. * The state of the operation (including any errors encountered) * may be queried via the Operation resource. * - * # Operation + * Operation Service: * - * The Operations collection provides a record of actions performed for the + * - The Operations collection provides a record of actions performed for the * specified project (including any operations in progress). Operations are not * created directly but through calls on other collections or resources. - * - * An operation that is not yet done may be cancelled. The request to cancel is - * asynchronous and the operation may continue to run for some time after the + * - An operation that is not yet done may be cancelled. The request to cancel + * is asynchronous and the operation may continue to run for some time after the * request to cancel is made. - * - * An operation that is done may be deleted so that it is no longer listed as + * - An operation that is done may be deleted so that it is no longer listed as * part of the Operation collection. - * - * ListOperations returns all pending operations, but not completed operations. - * - * Operations are created by service DatastoreAdmin, - * but are accessed via service google.longrunning.Operations. + * - ListOperations returns all pending operations, but not completed + * operations. + * - Operations are created by service DatastoreAdmin, but are accessed via + * service google.longrunning.Operations. * @class * @memberof v1 */ @@ -484,9 +470,8 @@ export class DatastoreAdminClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.datastore.admin.v1.Index | Index}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.datastore.admin.v1.Index|Index}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.get_index.js * region_tag:datastore_v1_generated_DatastoreAdmin_GetIndex_async @@ -591,8 +576,8 @@ export class DatastoreAdminClient { * * The resulting files will be nested deeper than the specified URL prefix. * The final output URL will be provided in the - * {@link google.datastore.admin.v1.ExportEntitiesResponse.output_url|google.datastore.admin.v1.ExportEntitiesResponse.output_url} field. That - * value should be used for subsequent ImportEntities operations. + * {@link protos.google.datastore.admin.v1.ExportEntitiesResponse.output_url|google.datastore.admin.v1.ExportEntitiesResponse.output_url} + * field. That value should be used for subsequent ImportEntities operations. * * By nesting the data files deeper, the same Cloud Storage bucket can be used * in multiple ExportEntities operations without conflict. @@ -602,8 +587,7 @@ export class DatastoreAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.export_entities.js * region_tag:datastore_v1_generated_DatastoreAdmin_ExportEntities_async @@ -698,8 +682,7 @@ export class DatastoreAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.export_entities.js * region_tag:datastore_v1_generated_DatastoreAdmin_ExportEntities_async @@ -741,8 +724,9 @@ export class DatastoreAdminClient { * @param {number[]} request.labels * Client-assigned labels. * @param {string} request.inputUrl - * Required. The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is * an optional Cloud Storage namespace path (this is not a Cloud Datastore @@ -753,7 +737,7 @@ export class DatastoreAdminClient { * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). * * For more information, see - * {@link google.datastore.admin.v1.ExportEntitiesResponse.output_url|google.datastore.admin.v1.ExportEntitiesResponse.output_url}. + * {@link protos.google.datastore.admin.v1.ExportEntitiesResponse.output_url|google.datastore.admin.v1.ExportEntitiesResponse.output_url}. * @param {google.datastore.admin.v1.EntityFilter} request.entityFilter * Optionally specify which kinds/namespaces are to be imported. If provided, * the list must be a subset of the EntityFilter used in creating the export, @@ -765,8 +749,7 @@ export class DatastoreAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.import_entities.js * region_tag:datastore_v1_generated_DatastoreAdmin_ImportEntities_async @@ -861,8 +844,7 @@ export class DatastoreAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.import_entities.js * region_tag:datastore_v1_generated_DatastoreAdmin_ImportEntities_async @@ -893,14 +875,14 @@ export class DatastoreAdminClient { /** * Creates the specified index. * A newly created index's initial state is `CREATING`. On completion of the - * returned {@link google.longrunning.Operation|google.longrunning.Operation}, the state will be `READY`. - * If the index already exists, the call will return an `ALREADY_EXISTS` - * status. + * returned {@link protos.google.longrunning.Operation|google.longrunning.Operation}, the + * state will be `READY`. If the index already exists, the call will return an + * `ALREADY_EXISTS` status. * * During index creation, the process could result in an error, in which * case the index will move to the `ERROR` state. The process can be recovered * by fixing the data that caused the error, removing the index with - * {@link google.datastore.admin.v1.DatastoreAdmin.DeleteIndex|delete}, then + * {@link protos.google.datastore.admin.v1.DatastoreAdmin.DeleteIndex|delete}, then * re-creating the index with [create] * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. * @@ -919,8 +901,7 @@ export class DatastoreAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.create_index.js * region_tag:datastore_v1_generated_DatastoreAdmin_CreateIndex_async @@ -1015,8 +996,7 @@ export class DatastoreAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.create_index.js * region_tag:datastore_v1_generated_DatastoreAdmin_CreateIndex_async @@ -1048,13 +1028,14 @@ export class DatastoreAdminClient { * Deletes an existing index. * An index can only be deleted if it is in a `READY` or `ERROR` state. On * successful execution of the request, the index will be in a `DELETING` - * {@link google.datastore.admin.v1.Index.State|state}. And on completion of the - * returned {@link google.longrunning.Operation|google.longrunning.Operation}, the index will be removed. + * {@link protos.google.datastore.admin.v1.Index.State|state}. And on completion of the + * returned {@link protos.google.longrunning.Operation|google.longrunning.Operation}, the + * index will be removed. * * During index deletion, the process could result in an error, in which * case the index will move to the `ERROR` state. The process can be recovered * by fixing the data that caused the error, followed by calling - * {@link google.datastore.admin.v1.DatastoreAdmin.DeleteIndex|delete} again. + * {@link protos.google.datastore.admin.v1.DatastoreAdmin.DeleteIndex|delete} again. * * @param {Object} request * The request object that will be sent. @@ -1068,8 +1049,7 @@ export class DatastoreAdminClient { * The first element of the array is an object representing * a long running operation. Its `promise()` method returns a promise * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.delete_index.js * region_tag:datastore_v1_generated_DatastoreAdmin_DeleteIndex_async @@ -1165,8 +1145,7 @@ export class DatastoreAdminClient { * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.delete_index.js * region_tag:datastore_v1_generated_DatastoreAdmin_DeleteIndex_async @@ -1212,14 +1191,13 @@ export class DatastoreAdminClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link google.datastore.admin.v1.Index | Index}. + * The first element of the array is Array of {@link protos.google.datastore.admin.v1.Index|Index}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. * We recommend using `listIndexesAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listIndexes( @@ -1306,13 +1284,12 @@ export class DatastoreAdminClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing {@link google.datastore.admin.v1.Index | Index} on 'data' event. + * An object stream which emits an object representing {@link protos.google.datastore.admin.v1.Index|Index} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listIndexesAsync()` * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listIndexesStream( @@ -1354,12 +1331,11 @@ export class DatastoreAdminClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing - * {@link google.datastore.admin.v1.Index | Index}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.datastore.admin.v1.Index|Index}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore_admin.list_indexes.js * region_tag:datastore_v1_generated_DatastoreAdmin_ListIndexes_async diff --git a/src/v1/datastore_client.ts b/src/v1/datastore_client.ts index 55ac8c92b..19ddc994d 100644 --- a/src/v1/datastore_client.ts +++ b/src/v1/datastore_client.ts @@ -377,9 +377,8 @@ export class DatastoreClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.datastore.v1.LookupResponse | LookupResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.datastore.v1.LookupResponse|LookupResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore.lookup.js * region_tag:datastore_v1_generated_Datastore_Lookup_async @@ -495,9 +494,8 @@ export class DatastoreClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.datastore.v1.RunQueryResponse | RunQueryResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.datastore.v1.RunQueryResponse|RunQueryResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore.run_query.js * region_tag:datastore_v1_generated_Datastore_RunQuery_async @@ -613,9 +611,8 @@ export class DatastoreClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.datastore.v1.RunAggregationQueryResponse | RunAggregationQueryResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.datastore.v1.RunAggregationQueryResponse|RunAggregationQueryResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore.run_aggregation_query.js * region_tag:datastore_v1_generated_Datastore_RunAggregationQuery_async @@ -724,9 +721,8 @@ export class DatastoreClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.datastore.v1.BeginTransactionResponse | BeginTransactionResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.datastore.v1.BeginTransactionResponse|BeginTransactionResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore.begin_transaction.js * region_tag:datastore_v1_generated_Datastore_BeginTransaction_async @@ -836,12 +832,12 @@ export class DatastoreClient { * @param {Buffer} request.transaction * The identifier of the transaction associated with the commit. A * transaction identifier is returned by a call to - * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. + * {@link protos.google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. * @param {google.datastore.v1.TransactionOptions} request.singleUseTransaction * Options for beginning a new transaction for this request. * The transaction is committed when the request completes. If specified, - * {@link google.datastore.v1.TransactionOptions|TransactionOptions.mode} must be - * {@link google.datastore.v1.TransactionOptions.ReadWrite|TransactionOptions.ReadWrite}. + * {@link protos.google.datastore.v1.TransactionOptions|TransactionOptions.mode} must be + * {@link protos.google.datastore.v1.TransactionOptions.ReadWrite|TransactionOptions.ReadWrite}. * @param {number[]} request.mutations * The mutations to perform. * @@ -859,9 +855,8 @@ export class DatastoreClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.datastore.v1.CommitResponse | CommitResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.datastore.v1.CommitResponse|CommitResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore.commit.js * region_tag:datastore_v1_generated_Datastore_Commit_async @@ -965,13 +960,12 @@ export class DatastoreClient { * database. * @param {Buffer} request.transaction * Required. The transaction identifier, returned by a call to - * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. + * {@link protos.google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.datastore.v1.RollbackResponse | RollbackResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.datastore.v1.RollbackResponse|RollbackResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore.rollback.js * region_tag:datastore_v1_generated_Datastore_Rollback_async @@ -1080,9 +1074,8 @@ export class DatastoreClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.datastore.v1.AllocateIdsResponse | AllocateIdsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.datastore.v1.AllocateIdsResponse|AllocateIdsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore.allocate_ids.js * region_tag:datastore_v1_generated_Datastore_AllocateIds_async @@ -1191,9 +1184,8 @@ export class DatastoreClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.datastore.v1.ReserveIdsResponse | ReserveIdsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * The first element of the array is an object representing {@link protos.google.datastore.v1.ReserveIdsResponse|ReserveIdsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example include:samples/generated/v1/datastore.reserve_ids.js * region_tag:datastore_v1_generated_Datastore_ReserveIds_async