diff --git a/packages/google-maps-mapsplatformdatasets/README.md b/packages/google-maps-mapsplatformdatasets/README.md index a32e7fda217..14d892b0332 100644 --- a/packages/google-maps-mapsplatformdatasets/README.md +++ b/packages/google-maps-mapsplatformdatasets/README.md @@ -115,6 +115,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | --------------------------- | --------------------------------- | ------ | | Maps_platform_datasets.create_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.create_dataset.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | | Maps_platform_datasets.delete_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.delete_dataset.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | +| Maps_platform_datasets.fetch_dataset_errors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.fetch_dataset_errors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.fetch_dataset_errors.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | | Maps_platform_datasets.get_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | | Maps_platform_datasets.list_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.list_datasets.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | | Maps_platform_datasets.update_dataset_metadata | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.update_dataset_metadata.js,packages/google-maps-mapsplatformdatasets/samples/README.md) | diff --git a/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto index af76bab23c2..1ca5317f284 100644 --- a/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto +++ b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets.proto @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/maps/mapsplatformdatasets/v1/dataset.proto"; import "google/protobuf/field_mask.proto"; +import "google/rpc/status.proto"; option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1"; option go_package = "cloud.google.com/go/maps/mapsplatformdatasets/apiv1/mapsplatformdatasetspb;mapsplatformdatasetspb"; @@ -118,6 +119,40 @@ message ListDatasetsResponse { string next_page_token = 2; } +// Request to list detailed errors belonging to a dataset. +message FetchDatasetErrorsRequest { + // Required. The name of the dataset to list all the errors for. + // Format: projects/{project}/datasets/{dataset_id} + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "mapsplatformdatasets.googleapis.com/Dataset" + } + ]; + + // The maximum number of errors to return per page. + // + // The maximum value is 500; values above 500 will be capped to 500. + // + // If unspecified, at most 50 errors will be returned. + int32 page_size = 2; + + // The page token, received from a previous ListDatasetErrors call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// Response object of FetchDatasetErrors. +message FetchDatasetErrorsResponse { + // A token that can be sent as `page_token` to retrieve the next page. + // + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // The errors associated with a dataset. + repeated google.rpc.Status errors = 3; +} + // Request to delete a dataset. message DeleteDatasetRequest { // Required. The name of the dataset to delete. diff --git a/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets_service.proto b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets_service.proto index d96b1b3cdad..4b52ed68178 100644 --- a/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets_service.proto +++ b/packages/google-maps-mapsplatformdatasets/protos/google/maps/mapsplatformdatasets/v1/maps_platform_datasets_service.proto @@ -63,6 +63,15 @@ service MapsPlatformDatasets { option (google.api.method_signature) = "name"; } + // Gets all the errors of a dataset. + rpc FetchDatasetErrors(FetchDatasetErrorsRequest) + returns (FetchDatasetErrorsResponse) { + option (google.api.http) = { + get: "/v1/{dataset=projects/*/datasets/*}:fetchDatasetErrors" + }; + option (google.api.method_signature) = "dataset"; + } + // Lists all the datasets for the specified project. rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { option (google.api.http) = { diff --git a/packages/google-maps-mapsplatformdatasets/protos/protos.d.ts b/packages/google-maps-mapsplatformdatasets/protos/protos.d.ts index f9c1cb41c35..236830c0138 100644 --- a/packages/google-maps-mapsplatformdatasets/protos/protos.d.ts +++ b/packages/google-maps-mapsplatformdatasets/protos/protos.d.ts @@ -1055,6 +1055,218 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a FetchDatasetErrorsRequest. */ + interface IFetchDatasetErrorsRequest { + + /** FetchDatasetErrorsRequest dataset */ + dataset?: (string|null); + + /** FetchDatasetErrorsRequest pageSize */ + pageSize?: (number|null); + + /** FetchDatasetErrorsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a FetchDatasetErrorsRequest. */ + class FetchDatasetErrorsRequest implements IFetchDatasetErrorsRequest { + + /** + * Constructs a new FetchDatasetErrorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest); + + /** FetchDatasetErrorsRequest dataset. */ + public dataset: string; + + /** FetchDatasetErrorsRequest pageSize. */ + public pageSize: number; + + /** FetchDatasetErrorsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new FetchDatasetErrorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchDatasetErrorsRequest instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest): google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest; + + /** + * Encodes the specified FetchDatasetErrorsRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest.verify|verify} messages. + * @param message FetchDatasetErrorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchDatasetErrorsRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest.verify|verify} messages. + * @param message FetchDatasetErrorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchDatasetErrorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchDatasetErrorsRequest + * @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.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest; + + /** + * Decodes a FetchDatasetErrorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchDatasetErrorsRequest + * @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.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest; + + /** + * Verifies a FetchDatasetErrorsRequest 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 FetchDatasetErrorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchDatasetErrorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest; + + /** + * Creates a plain object from a FetchDatasetErrorsRequest message. Also converts values to other types if specified. + * @param message FetchDatasetErrorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchDatasetErrorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchDatasetErrorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchDatasetErrorsResponse. */ + interface IFetchDatasetErrorsResponse { + + /** FetchDatasetErrorsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** FetchDatasetErrorsResponse errors */ + errors?: (google.rpc.IStatus[]|null); + } + + /** Represents a FetchDatasetErrorsResponse. */ + class FetchDatasetErrorsResponse implements IFetchDatasetErrorsResponse { + + /** + * Constructs a new FetchDatasetErrorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse); + + /** FetchDatasetErrorsResponse nextPageToken. */ + public nextPageToken: string; + + /** FetchDatasetErrorsResponse errors. */ + public errors: google.rpc.IStatus[]; + + /** + * Creates a new FetchDatasetErrorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchDatasetErrorsResponse instance + */ + public static create(properties?: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse): google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse; + + /** + * Encodes the specified FetchDatasetErrorsResponse message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse.verify|verify} messages. + * @param message FetchDatasetErrorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchDatasetErrorsResponse message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse.verify|verify} messages. + * @param message FetchDatasetErrorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchDatasetErrorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchDatasetErrorsResponse + * @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.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse; + + /** + * Decodes a FetchDatasetErrorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchDatasetErrorsResponse + * @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.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse; + + /** + * Verifies a FetchDatasetErrorsResponse 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 FetchDatasetErrorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchDatasetErrorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse; + + /** + * Creates a plain object from a FetchDatasetErrorsResponse message. Also converts values to other types if specified. + * @param message FetchDatasetErrorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchDatasetErrorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchDatasetErrorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a DeleteDatasetRequest. */ interface IDeleteDatasetRequest { @@ -1214,6 +1426,20 @@ export namespace google { */ public getDataset(request: google.maps.mapsplatformdatasets.v1.IGetDatasetRequest): Promise; + /** + * Calls FetchDatasetErrors. + * @param request FetchDatasetErrorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchDatasetErrorsResponse + */ + public fetchDatasetErrors(request: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, callback: google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.FetchDatasetErrorsCallback): void; + + /** + * Calls FetchDatasetErrors. + * @param request FetchDatasetErrorsRequest message or plain object + * @returns Promise + */ + public fetchDatasetErrors(request: google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest): Promise; + /** * Calls ListDatasets. * @param request ListDatasetsRequest message or plain object @@ -1266,6 +1492,13 @@ export namespace google { */ type GetDatasetCallback = (error: (Error|null), response?: google.maps.mapsplatformdatasets.v1.Dataset) => void; + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|fetchDatasetErrors}. + * @param error Error, if any + * @param [response] FetchDatasetErrorsResponse + */ + type FetchDatasetErrorsCallback = (error: (Error|null), response?: google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse) => void; + /** * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|listDatasets}. * @param error Error, if any @@ -9211,6 +9444,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @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.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @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.protobuf.Any; + + /** + * Verifies an Any 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 Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Duration. */ interface IDuration { @@ -9405,4 +9741,117 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @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.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @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.rpc.Status; + + /** + * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } diff --git a/packages/google-maps-mapsplatformdatasets/protos/protos.js b/packages/google-maps-mapsplatformdatasets/protos/protos.js index 3afc2c881df..79c89f9dfa3 100644 --- a/packages/google-maps-mapsplatformdatasets/protos/protos.js +++ b/packages/google-maps-mapsplatformdatasets/protos/protos.js @@ -2691,6 +2691,504 @@ return ListDatasetsResponse; })(); + v1.FetchDatasetErrorsRequest = (function() { + + /** + * Properties of a FetchDatasetErrorsRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IFetchDatasetErrorsRequest + * @property {string|null} [dataset] FetchDatasetErrorsRequest dataset + * @property {number|null} [pageSize] FetchDatasetErrorsRequest pageSize + * @property {string|null} [pageToken] FetchDatasetErrorsRequest pageToken + */ + + /** + * Constructs a new FetchDatasetErrorsRequest. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a FetchDatasetErrorsRequest. + * @implements IFetchDatasetErrorsRequest + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest=} [properties] Properties to set + */ + function FetchDatasetErrorsRequest(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]]; + } + + /** + * FetchDatasetErrorsRequest dataset. + * @member {string} dataset + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @instance + */ + FetchDatasetErrorsRequest.prototype.dataset = ""; + + /** + * FetchDatasetErrorsRequest pageSize. + * @member {number} pageSize + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @instance + */ + FetchDatasetErrorsRequest.prototype.pageSize = 0; + + /** + * FetchDatasetErrorsRequest pageToken. + * @member {string} pageToken + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @instance + */ + FetchDatasetErrorsRequest.prototype.pageToken = ""; + + /** + * Creates a new FetchDatasetErrorsRequest instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest} FetchDatasetErrorsRequest instance + */ + FetchDatasetErrorsRequest.create = function create(properties) { + return new FetchDatasetErrorsRequest(properties); + }; + + /** + * Encodes the specified FetchDatasetErrorsRequest message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest} message FetchDatasetErrorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDatasetErrorsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified FetchDatasetErrorsRequest message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest} message FetchDatasetErrorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDatasetErrorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchDatasetErrorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest} FetchDatasetErrorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDatasetErrorsRequest.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.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchDatasetErrorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest} FetchDatasetErrorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDatasetErrorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchDatasetErrorsRequest message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchDatasetErrorsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a FetchDatasetErrorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest} FetchDatasetErrorsRequest + */ + FetchDatasetErrorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a FetchDatasetErrorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @static + * @param {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest} message FetchDatasetErrorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchDatasetErrorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this FetchDatasetErrorsRequest to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @instance + * @returns {Object.} JSON object + */ + FetchDatasetErrorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchDatasetErrorsRequest + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchDatasetErrorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest"; + }; + + return FetchDatasetErrorsRequest; + })(); + + v1.FetchDatasetErrorsResponse = (function() { + + /** + * Properties of a FetchDatasetErrorsResponse. + * @memberof google.maps.mapsplatformdatasets.v1 + * @interface IFetchDatasetErrorsResponse + * @property {string|null} [nextPageToken] FetchDatasetErrorsResponse nextPageToken + * @property {Array.|null} [errors] FetchDatasetErrorsResponse errors + */ + + /** + * Constructs a new FetchDatasetErrorsResponse. + * @memberof google.maps.mapsplatformdatasets.v1 + * @classdesc Represents a FetchDatasetErrorsResponse. + * @implements IFetchDatasetErrorsResponse + * @constructor + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse=} [properties] Properties to set + */ + function FetchDatasetErrorsResponse(properties) { + this.errors = []; + 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]]; + } + + /** + * FetchDatasetErrorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @instance + */ + FetchDatasetErrorsResponse.prototype.nextPageToken = ""; + + /** + * FetchDatasetErrorsResponse errors. + * @member {Array.} errors + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @instance + */ + FetchDatasetErrorsResponse.prototype.errors = $util.emptyArray; + + /** + * Creates a new FetchDatasetErrorsResponse instance using the specified properties. + * @function create + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @static + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse=} [properties] Properties to set + * @returns {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse} FetchDatasetErrorsResponse instance + */ + FetchDatasetErrorsResponse.create = function create(properties) { + return new FetchDatasetErrorsResponse(properties); + }; + + /** + * Encodes the specified FetchDatasetErrorsResponse message. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse.verify|verify} messages. + * @function encode + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @static + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse} message FetchDatasetErrorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDatasetErrorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.rpc.Status.encode(message.errors[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FetchDatasetErrorsResponse message, length delimited. Does not implicitly {@link google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @static + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse} message FetchDatasetErrorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDatasetErrorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchDatasetErrorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse} FetchDatasetErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDatasetErrorsResponse.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.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchDatasetErrorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse} FetchDatasetErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDatasetErrorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchDatasetErrorsResponse message. + * @function verify + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchDatasetErrorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errors[i]); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates a FetchDatasetErrorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse} FetchDatasetErrorsResponse + */ + FetchDatasetErrorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse) + return object; + var message = new $root.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse(); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse.errors: object expected"); + message.errors[i] = $root.google.rpc.Status.fromObject(object.errors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FetchDatasetErrorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @static + * @param {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse} message FetchDatasetErrorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchDatasetErrorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.rpc.Status.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this FetchDatasetErrorsResponse to JSON. + * @function toJSON + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @instance + * @returns {Object.} JSON object + */ + FetchDatasetErrorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchDatasetErrorsResponse + * @function getTypeUrl + * @memberof google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchDatasetErrorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse"; + }; + + return FetchDatasetErrorsResponse; + })(); + v1.DeleteDatasetRequest = (function() { /** @@ -3025,6 +3523,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|fetchDatasetErrors}. + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @typedef FetchDatasetErrorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse} [response] FetchDatasetErrorsResponse + */ + + /** + * Calls FetchDatasetErrors. + * @function fetchDatasetErrors + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest} request FetchDatasetErrorsRequest message or plain object + * @param {google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.FetchDatasetErrorsCallback} callback Node-style callback called with the error, if any, and FetchDatasetErrorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MapsPlatformDatasets.prototype.fetchDatasetErrors = function fetchDatasetErrors(request, callback) { + return this.rpcCall(fetchDatasetErrors, $root.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest, $root.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse, request, callback); + }, "name", { value: "FetchDatasetErrors" }); + + /** + * Calls FetchDatasetErrors. + * @function fetchDatasetErrors + * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets + * @instance + * @param {google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest} request FetchDatasetErrorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets|listDatasets}. * @memberof google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets @@ -24578,15 +25109,234 @@ */ /** - * Constructs a new FieldMask. + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + 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]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.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.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask + * @classdesc Represents an Any. + * @implements IAny * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @param {google.protobuf.IAny=} [properties] Properties to set */ - function FieldMask(properties) { - this.paths = []; + function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24594,78 +25344,89 @@ } /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any * @instance */ - FieldMask.prototype.paths = $util.emptyArray; + Any.prototype.type_url = ""; /** - * Creates a new FieldMask instance using the specified properties. + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. * @function create - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); + Any.create = function create(properties) { + return new Any(properties); }; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encode = function encode(message, writer) { + Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldMask message from the specified reader or buffer. + * Decodes an Any message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FieldMask.decode = function decode(reader, length) { + Any.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.protobuf.FieldMask(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); break; } default: @@ -24677,114 +25438,120 @@ }; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { + Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldMask message. + * Verifies an Any message. * @function verify - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FieldMask.verify = function verify(message) { + Any.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; return null; }; /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.protobuf.Any} Any */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; return message; }; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.FieldMask} message FieldMask + * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldMask.toObject = function toObject(message, options) { + Any.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** - * Converts this FieldMask to JSON. + * Converts this Any to JSON. * @function toJSON - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - FieldMask.prototype.toJSON = function toJSON() { + Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldMask + * Gets the default type url for Any * @function getTypeUrl - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Any * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldMask"; + return typeUrlPrefix + "/google.protobuf.Any"; }; - return FieldMask; + return Any; })(); protobuf.Duration = (function() { @@ -25206,6 +25973,290 @@ return protobuf; })(); + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + 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]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.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.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + return google; })(); diff --git a/packages/google-maps-mapsplatformdatasets/protos/protos.json b/packages/google-maps-mapsplatformdatasets/protos/protos.json index ef842537532..03552f08561 100644 --- a/packages/google-maps-mapsplatformdatasets/protos/protos.json +++ b/packages/google-maps-mapsplatformdatasets/protos/protos.json @@ -249,6 +249,39 @@ } } }, + "FetchDatasetErrorsRequest": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "mapsplatformdatasets.googleapis.com/Dataset" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "FetchDatasetErrorsResponse": { + "fields": { + "nextPageToken": { + "type": "string", + "id": 2 + }, + "errors": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 3 + } + } + }, "DeleteDatasetRequest": { "fields": { "name": { @@ -325,6 +358,24 @@ } ] }, + "FetchDatasetErrors": { + "requestType": "FetchDatasetErrorsRequest", + "responseType": "FetchDatasetErrorsResponse", + "options": { + "(google.api.http).get": "/v1/{dataset=projects/*/datasets/*}:fetchDatasetErrors", + "(google.api.method_signature)": "dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{dataset=projects/*/datasets/*}:fetchDatasetErrors" + } + }, + { + "(google.api.method_signature)": "dataset" + } + ] + }, "ListDatasets": { "requestType": "ListDatasetsRequest", "responseType": "ListDatasetsResponse", @@ -2578,6 +2629,18 @@ } } }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Duration": { "fields": { "seconds": { @@ -2594,6 +2657,35 @@ "fields": {} } } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } } } } diff --git a/packages/google-maps-mapsplatformdatasets/samples/README.md b/packages/google-maps-mapsplatformdatasets/samples/README.md index 8e326879cbb..192eed5155b 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/README.md +++ b/packages/google-maps-mapsplatformdatasets/samples/README.md @@ -14,6 +14,7 @@ * [Samples](#samples) * [Maps_platform_datasets.create_dataset](#maps_platform_datasets.create_dataset) * [Maps_platform_datasets.delete_dataset](#maps_platform_datasets.delete_dataset) + * [Maps_platform_datasets.fetch_dataset_errors](#maps_platform_datasets.fetch_dataset_errors) * [Maps_platform_datasets.get_dataset](#maps_platform_datasets.get_dataset) * [Maps_platform_datasets.list_datasets](#maps_platform_datasets.list_datasets) * [Maps_platform_datasets.update_dataset_metadata](#maps_platform_datasets.update_dataset_metadata) @@ -75,6 +76,23 @@ __Usage:__ +### Maps_platform_datasets.fetch_dataset_errors + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.fetch_dataset_errors.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.fetch_dataset_errors.js,samples/README.md) + +__Usage:__ + + +`node packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.fetch_dataset_errors.js` + + +----- + + + + ### Maps_platform_datasets.get_dataset View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.get_dataset.js). diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.fetch_dataset_errors.js b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.fetch_dataset_errors.js new file mode 100644 index 00000000000..c55fdb94725 --- /dev/null +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/maps_platform_datasets.fetch_dataset_errors.js @@ -0,0 +1,75 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(dataset) { + // [START mapsplatformdatasets_v1_generated_MapsPlatformDatasets_FetchDatasetErrors_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the dataset to list all the errors for. + * Format: projects/{project}/datasets/{dataset_id} + */ + // const dataset = 'abc123' + /** + * The maximum number of errors to return per page. + * The maximum value is 500; values above 500 will be capped to 500. + * If unspecified, at most 50 errors will be returned. + */ + // const pageSize = 1234 + /** + * The page token, received from a previous ListDatasetErrors call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Mapsplatformdatasets library + const {MapsPlatformDatasetsClient} = require('@googlemaps/maps-platform-datasets').v1; + + // Instantiates a client + const mapsplatformdatasetsClient = new MapsPlatformDatasetsClient(); + + async function callFetchDatasetErrors() { + // Construct request + const request = { + dataset, + }; + + // Run request + const iterable = mapsplatformdatasetsClient.fetchDatasetErrorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callFetchDatasetErrors(); + // [END mapsplatformdatasets_v1_generated_MapsPlatformDatasets_FetchDatasetErrors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata_google.maps.mapsplatformdatasets.v1.json b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata_google.maps.mapsplatformdatasets.v1.json index 3458e1e45d5..2440fb0a937 100644 --- a/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata_google.maps.mapsplatformdatasets.v1.json +++ b/packages/google-maps-mapsplatformdatasets/samples/generated/v1/snippet_metadata_google.maps.mapsplatformdatasets.v1.json @@ -139,6 +139,54 @@ } } }, + { + "regionTag": "mapsplatformdatasets_v1_generated_MapsPlatformDatasets_FetchDatasetErrors_async", + "title": "MapsPlatformDatasets fetchDatasetErrors Sample", + "origin": "API_DEFINITION", + "description": " Gets all the errors of a dataset.", + "canonical": true, + "file": "maps_platform_datasets.fetch_dataset_errors.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchDatasetErrors", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.FetchDatasetErrors", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsResponse", + "client": { + "shortName": "MapsPlatformDatasetsClient", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasetsClient" + }, + "method": { + "shortName": "FetchDatasetErrors", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets.FetchDatasetErrors", + "service": { + "shortName": "MapsPlatformDatasets", + "fullName": "google.maps.mapsplatformdatasets.v1.MapsPlatformDatasets" + } + } + } + }, { "regionTag": "mapsplatformdatasets_v1_generated_MapsPlatformDatasets_ListDatasets_async", "title": "MapsPlatformDatasets listDatasets Sample", diff --git a/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json b/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json index 8c635052284..04b58c2cfe0 100644 --- a/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json +++ b/packages/google-maps-mapsplatformdatasets/src/v1/gapic_metadata.json @@ -30,6 +30,13 @@ "deleteDataset" ] }, + "FetchDatasetErrors": { + "methods": [ + "fetchDatasetErrors", + "fetchDatasetErrorsStream", + "fetchDatasetErrorsAsync" + ] + }, "ListDatasets": { "methods": [ "listDatasets", @@ -62,6 +69,13 @@ "deleteDataset" ] }, + "FetchDatasetErrors": { + "methods": [ + "fetchDatasetErrors", + "fetchDatasetErrorsStream", + "fetchDatasetErrorsAsync" + ] + }, "ListDatasets": { "methods": [ "listDatasets", diff --git a/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client.ts b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client.ts index 7b59c02120b..b2519a17369 100644 --- a/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client.ts +++ b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client.ts @@ -208,6 +208,11 @@ export class MapsPlatformDatasetsClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { + fetchDatasetErrors: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'errors' + ), listDatasets: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -269,6 +274,7 @@ export class MapsPlatformDatasetsClient { 'createDataset', 'updateDatasetMetadata', 'getDataset', + 'fetchDatasetErrors', 'listDatasets', 'deleteDataset', ]; @@ -781,6 +787,210 @@ export class MapsPlatformDatasetsClient { return this.innerApiCalls.deleteDataset(request, options, callback); } + /** + * Gets all the errors of a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.dataset + * Required. The name of the dataset to list all the errors for. + * Format: projects/{project}/datasets/{dataset_id} + * @param {number} request.pageSize + * The maximum number of errors to return per page. + * + * The maximum value is 500; values above 500 will be capped to 500. + * + * If unspecified, at most 50 errors will be returned. + * @param {string} request.pageToken + * The page token, received from a previous ListDatasetErrors call. + * Provide this to retrieve the subsequent page. + * @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 protos.google.rpc.Status|Status}. + * 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 `fetchDatasetErrorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + fetchDatasetErrors( + request?: protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.rpc.IStatus[], + protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest | null, + protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse, + ] + >; + fetchDatasetErrors( + request: protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + | protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse + | null + | undefined, + protos.google.rpc.IStatus + > + ): void; + fetchDatasetErrors( + request: protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + callback: PaginationCallback< + protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + | protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse + | null + | undefined, + protos.google.rpc.IStatus + > + ): void; + fetchDatasetErrors( + request?: protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + | protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse + | null + | undefined, + protos.google.rpc.IStatus + >, + callback?: PaginationCallback< + protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + | protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse + | null + | undefined, + protos.google.rpc.IStatus + > + ): Promise< + [ + protos.google.rpc.IStatus[], + protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest | null, + protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + dataset: request.dataset ?? '', + }); + this.initialize(); + return this.innerApiCalls.fetchDatasetErrors(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.dataset + * Required. The name of the dataset to list all the errors for. + * Format: projects/{project}/datasets/{dataset_id} + * @param {number} request.pageSize + * The maximum number of errors to return per page. + * + * The maximum value is 500; values above 500 will be capped to 500. + * + * If unspecified, at most 50 errors will be returned. + * @param {string} request.pageToken + * The page token, received from a previous ListDatasetErrors call. + * Provide this to retrieve the subsequent page. + * @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 protos.google.rpc.Status|Status} 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 `fetchDatasetErrorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + fetchDatasetErrorsStream( + request?: protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + dataset: request.dataset ?? '', + }); + const defaultCallSettings = this._defaults['fetchDatasetErrors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.fetchDatasetErrors.createStream( + this.innerApiCalls.fetchDatasetErrors as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `fetchDatasetErrors`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.dataset + * Required. The name of the dataset to list all the errors for. + * Format: projects/{project}/datasets/{dataset_id} + * @param {number} request.pageSize + * The maximum number of errors to return per page. + * + * The maximum value is 500; values above 500 will be capped to 500. + * + * If unspecified, at most 50 errors will be returned. + * @param {string} request.pageToken + * The page token, received from a previous ListDatasetErrors call. + * Provide this to retrieve the subsequent page. + * @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 {@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 protos.google.rpc.Status|Status}. 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 {@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/maps_platform_datasets.fetch_dataset_errors.js + * region_tag:mapsplatformdatasets_v1_generated_MapsPlatformDatasets_FetchDatasetErrors_async + */ + fetchDatasetErrorsAsync( + request?: protos.google.maps.mapsplatformdatasets.v1.IFetchDatasetErrorsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + dataset: request.dataset ?? '', + }); + const defaultCallSettings = this._defaults['fetchDatasetErrors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.fetchDatasetErrors.asyncIterate( + this.innerApiCalls['fetchDatasetErrors'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } /** * Lists all the datasets for the specified project. * diff --git a/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client_config.json b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client_config.json index 9a072527d2f..b0117ebb28f 100644 --- a/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client_config.json +++ b/packages/google-maps-mapsplatformdatasets/src/v1/maps_platform_datasets_client_config.json @@ -47,6 +47,11 @@ "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, + "FetchDatasetErrors": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, "ListDatasets": { "timeout_millis": 60000, "retry_codes_name": "unavailable", diff --git a/packages/google-maps-mapsplatformdatasets/test/gapic_maps_platform_datasets_v1.ts b/packages/google-maps-mapsplatformdatasets/test/gapic_maps_platform_datasets_v1.ts index 01b26f808fe..409159786a2 100644 --- a/packages/google-maps-mapsplatformdatasets/test/gapic_maps_platform_datasets_v1.ts +++ b/packages/google-maps-mapsplatformdatasets/test/gapic_maps_platform_datasets_v1.ts @@ -869,6 +869,306 @@ describe('v1.MapsPlatformDatasetsClient', () => { }); }); + describe('fetchDatasetErrors', () => { + it('invokes fetchDatasetErrors without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest', + ['dataset'] + ); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.rpc.Status()), + generateSampleMessage(new protos.google.rpc.Status()), + generateSampleMessage(new protos.google.rpc.Status()), + ]; + client.innerApiCalls.fetchDatasetErrors = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchDatasetErrors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDatasetErrors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDatasetErrors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDatasetErrors without error using callback', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest', + ['dataset'] + ); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.rpc.Status()), + generateSampleMessage(new protos.google.rpc.Status()), + generateSampleMessage(new protos.google.rpc.Status()), + ]; + client.innerApiCalls.fetchDatasetErrors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchDatasetErrors( + request, + (err?: Error | null, result?: protos.google.rpc.IStatus[] | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDatasetErrors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDatasetErrors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDatasetErrors with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest', + ['dataset'] + ); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchDatasetErrors = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.fetchDatasetErrors(request), expectedError); + const actualRequest = ( + client.innerApiCalls.fetchDatasetErrors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDatasetErrors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDatasetErrorsStream without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest', + ['dataset'] + ); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.rpc.Status()), + generateSampleMessage(new protos.google.rpc.Status()), + generateSampleMessage(new protos.google.rpc.Status()), + ]; + client.descriptors.page.fetchDatasetErrors.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.fetchDatasetErrorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.rpc.Status[] = []; + stream.on('data', (response: protos.google.rpc.Status) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.fetchDatasetErrors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.fetchDatasetErrors, request) + ); + assert( + (client.descriptors.page.fetchDatasetErrors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes fetchDatasetErrorsStream with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest', + ['dataset'] + ); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchDatasetErrors.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchDatasetErrorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.rpc.Status[] = []; + stream.on('data', (response: protos.google.rpc.Status) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.fetchDatasetErrors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.fetchDatasetErrors, request) + ); + assert( + (client.descriptors.page.fetchDatasetErrors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with fetchDatasetErrors without error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest', + ['dataset'] + ); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.rpc.Status()), + generateSampleMessage(new protos.google.rpc.Status()), + generateSampleMessage(new protos.google.rpc.Status()), + ]; + client.descriptors.page.fetchDatasetErrors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.rpc.IStatus[] = []; + const iterable = client.fetchDatasetErrorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchDatasetErrors.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.fetchDatasetErrors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with fetchDatasetErrors with error', async () => { + const client = + new mapsplatformdatasetsModule.v1.MapsPlatformDatasetsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.maps.mapsplatformdatasets.v1.FetchDatasetErrorsRequest', + ['dataset'] + ); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchDatasetErrors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchDatasetErrorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.rpc.IStatus[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchDatasetErrors.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.fetchDatasetErrors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + describe('listDatasets', () => { it('invokes listDatasets without error', async () => { const client =