From 10c0af9c4da2347d14fe2ea5bbbd5553f6206258 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 29 Feb 2020 10:25:34 -0800 Subject: [PATCH] feat!: removed SearchResources and SearchIamPolicies from v1p1beta1 client --- .../cloud/asset/v1p1beta1/asset_service.proto | 96 -- .../google-cloud-asset/protos/protos.d.ts | 456 ------- packages/google-cloud-asset/protos/protos.js | 1075 ----------------- .../google-cloud-asset/protos/protos.json | 114 -- .../src/v1p1beta1/asset_service_client.ts | 312 ----- .../asset_service_client_config.json | 10 - packages/google-cloud-asset/synth.metadata | 15 +- .../test/gapic-asset_service-v1p1beta1.ts | 114 -- 8 files changed, 4 insertions(+), 2188 deletions(-) diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto index 2083e45706c..c75ce7adf0e 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto @@ -34,22 +34,6 @@ service AssetService { option (google.api.default_host) = "cloudasset.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - // Searches resources which are accessible with .get permission. - rpc SearchResources(SearchResourcesRequest) returns (SearchResourcesResponse) { - option (google.api.http) = { - get: "/v1p1beta1/resources:search" - }; - option (google.api.method_signature) = "scope,query,asset_types"; - } - - // Searches IAM policies which are accessible with .getIamPolicy permission. - rpc SearchIamPolicies(SearchIamPoliciesRequest) returns (SearchIamPoliciesResponse) { - option (google.api.http) = { - get: "/v1p1beta1/iamPolicies:search" - }; - option (google.api.method_signature) = "scope,query"; - } - // Searches all the resources under a given accessible CRM scope // (project/folder/organization). This RPC gives callers // especially admins the ability to search all the resources under a scope, @@ -77,86 +61,6 @@ service AssetService { } } -// Search resource request. -message SearchResourcesRequest { - // Required. The relative name of an asset. The search is limited to the resources - // within the `scope`. The allowed value must be: - // * Organization number (such as "organizations/123") - // * Folder number(such as "folders/1234") - // * Project number (such as "projects/12345") - string scope = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The query statement. - string query = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of asset types that this request searches for. If empty, it will - // search all the supported asset types. - repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The page size for search result pagination. Page size is capped at 500 even - // if a larger value is given. If set to zero, server will pick an appropriate - // default. Returned results may be fewer than requested. When this happens, - // there could be more results as long as `next_page_token` is returned. - int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, then retrieve the next batch of results from the preceding call - // to this method. `page_token` must be the value of `next_page_token` from - // the previous response. The values of all other method parameters, must be - // identical to those in the previous call. - string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Search resource response. -message SearchResourcesResponse { - // A list of resource that match the search query. - repeated StandardResourceMetadata results = 1; - - // If there are more results than those appearing in this response, then - // `next_page_token` is included. To get the next set of results, call this - // method again using the value of `next_page_token` as `page_token`. - string next_page_token = 2; -} - -// Search IAM policies request. -message SearchIamPoliciesRequest { - // Required. The relative name of an asset. The search is limited to the resources - // within the `scope`. The allowed value must be: - // * Organization number (such as "organizations/123") - // * Folder number(such as "folders/1234") - // * Project number (such as "projects/12345") - string scope = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The query statement. - // Examples: - // * "policy:myuser@mydomain.com" - // * "policy:(myuser@mydomain.com viewer)" - string query = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The page size for search result pagination. Page size is capped at 500 even - // if a larger value is given. If set to zero, server will pick an appropriate - // default. Returned results may be fewer than requested. When this happens, - // there could be more results as long as `next_page_token` is returned. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If present, retrieve the next batch of results from the preceding call to - // this method. `page_token` must be the value of `next_page_token` from the - // previous response. The values of all other method parameters must be - // identical to those in the previous call. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Search IAM policies response. -message SearchIamPoliciesResponse { - // A list of IamPolicy that match the search query. Related information such - // as the associated resource is returned along with the policy. - repeated IamPolicySearchResult results = 1; - - // Set if there are more results than those appearing in this response; to get - // the next set of results, call this method again, using this value as the - // `page_token`. - string next_page_token = 2; -} - // Search all resources request. message SearchAllResourcesRequest { // Required. The relative name of an asset. The search is limited to the resources diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 3396171ee31..9788e56fd5c 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -3328,34 +3328,6 @@ export namespace google { */ public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssetService; - /** - * Calls SearchResources. - * @param request SearchResourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchResourcesResponse - */ - public searchResources(request: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback): void; - - /** - * Calls SearchResources. - * @param request SearchResourcesRequest message or plain object - * @returns Promise - */ - public searchResources(request: google.cloud.asset.v1p1beta1.ISearchResourcesRequest): Promise; - - /** - * Calls SearchIamPolicies. - * @param request SearchIamPoliciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse - */ - public searchIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback): void; - - /** - * Calls SearchIamPolicies. - * @param request SearchIamPoliciesRequest message or plain object - * @returns Promise - */ - public searchIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest): Promise; - /** * Calls SearchAllResources. * @param request SearchAllResourcesRequest message or plain object @@ -3387,20 +3359,6 @@ export namespace google { namespace AssetService { - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. - * @param error Error, if any - * @param [response] SearchResourcesResponse - */ - type SearchResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchResourcesResponse) => void; - - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. - * @param error Error, if any - * @param [response] SearchIamPoliciesResponse - */ - type SearchIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) => void; - /** * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. * @param error Error, if any @@ -3416,420 +3374,6 @@ export namespace google { type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) => void; } - /** Properties of a SearchResourcesRequest. */ - interface ISearchResourcesRequest { - - /** SearchResourcesRequest scope */ - scope?: (string|null); - - /** SearchResourcesRequest query */ - query?: (string|null); - - /** SearchResourcesRequest assetTypes */ - assetTypes?: (string[]|null); - - /** SearchResourcesRequest pageSize */ - pageSize?: (number|null); - - /** SearchResourcesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a SearchResourcesRequest. */ - class SearchResourcesRequest implements ISearchResourcesRequest { - - /** - * Constructs a new SearchResourcesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesRequest); - - /** SearchResourcesRequest scope. */ - public scope: string; - - /** SearchResourcesRequest query. */ - public query: string; - - /** SearchResourcesRequest assetTypes. */ - public assetTypes: string[]; - - /** SearchResourcesRequest pageSize. */ - public pageSize: number; - - /** SearchResourcesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new SearchResourcesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResourcesRequest instance - */ - public static create(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesRequest): google.cloud.asset.v1p1beta1.SearchResourcesRequest; - - /** - * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. - * @param message SearchResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. - * @param message SearchResourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResourcesRequest - * @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.cloud.asset.v1p1beta1.SearchResourcesRequest; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResourcesRequest - * @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.cloud.asset.v1p1beta1.SearchResourcesRequest; - - /** - * Verifies a SearchResourcesRequest 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 SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResourcesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchResourcesRequest; - - /** - * Creates a plain object from a SearchResourcesRequest message. Also converts values to other types if specified. - * @param message SearchResourcesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p1beta1.SearchResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchResourcesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SearchResourcesResponse. */ - interface ISearchResourcesResponse { - - /** SearchResourcesResponse results */ - results?: (google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]|null); - - /** SearchResourcesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a SearchResourcesResponse. */ - class SearchResourcesResponse implements ISearchResourcesResponse { - - /** - * Constructs a new SearchResourcesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesResponse); - - /** SearchResourcesResponse results. */ - public results: google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]; - - /** SearchResourcesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new SearchResourcesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResourcesResponse instance - */ - public static create(properties?: google.cloud.asset.v1p1beta1.ISearchResourcesResponse): google.cloud.asset.v1p1beta1.SearchResourcesResponse; - - /** - * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. - * @param message SearchResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p1beta1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. - * @param message SearchResourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResourcesResponse - * @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.cloud.asset.v1p1beta1.SearchResourcesResponse; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResourcesResponse - * @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.cloud.asset.v1p1beta1.SearchResourcesResponse; - - /** - * Verifies a SearchResourcesResponse 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 SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResourcesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchResourcesResponse; - - /** - * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. - * @param message SearchResourcesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p1beta1.SearchResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchResourcesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SearchIamPoliciesRequest. */ - interface ISearchIamPoliciesRequest { - - /** SearchIamPoliciesRequest scope */ - scope?: (string|null); - - /** SearchIamPoliciesRequest query */ - query?: (string|null); - - /** SearchIamPoliciesRequest pageSize */ - pageSize?: (number|null); - - /** SearchIamPoliciesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a SearchIamPoliciesRequest. */ - class SearchIamPoliciesRequest implements ISearchIamPoliciesRequest { - - /** - * Constructs a new SearchIamPoliciesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest); - - /** SearchIamPoliciesRequest scope. */ - public scope: string; - - /** SearchIamPoliciesRequest query. */ - public query: string; - - /** SearchIamPoliciesRequest pageSize. */ - public pageSize: number; - - /** SearchIamPoliciesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new SearchIamPoliciesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchIamPoliciesRequest instance - */ - public static create(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; - - /** - * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. - * @param message SearchIamPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. - * @param message SearchIamPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchIamPoliciesRequest - * @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.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; - - /** - * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchIamPoliciesRequest - * @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.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; - - /** - * Verifies a SearchIamPoliciesRequest 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 SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchIamPoliciesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest; - - /** - * Creates a plain object from a SearchIamPoliciesRequest message. Also converts values to other types if specified. - * @param message SearchIamPoliciesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchIamPoliciesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SearchIamPoliciesResponse. */ - interface ISearchIamPoliciesResponse { - - /** SearchIamPoliciesResponse results */ - results?: (google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]|null); - - /** SearchIamPoliciesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a SearchIamPoliciesResponse. */ - class SearchIamPoliciesResponse implements ISearchIamPoliciesResponse { - - /** - * Constructs a new SearchIamPoliciesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse); - - /** SearchIamPoliciesResponse results. */ - public results: google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]; - - /** SearchIamPoliciesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new SearchIamPoliciesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchIamPoliciesResponse instance - */ - public static create(properties?: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; - - /** - * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. - * @param message SearchIamPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. - * @param message SearchIamPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchIamPoliciesResponse - * @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.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; - - /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchIamPoliciesResponse - * @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.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; - - /** - * Verifies a SearchIamPoliciesResponse 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 SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchIamPoliciesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse; - - /** - * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. - * @param message SearchIamPoliciesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SearchIamPoliciesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a SearchAllResourcesRequest. */ interface ISearchAllResourcesRequest { diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index 01e518fdca4..9f2c7eccfac 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -7849,72 +7849,6 @@ return new this(rpcImpl, requestDelimited, responseDelimited); }; - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchResources}. - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @typedef SearchResourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} [response] SearchResourcesResponse - */ - - /** - * Calls SearchResources. - * @function searchResources - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object - * @param {google.cloud.asset.v1p1beta1.AssetService.SearchResourcesCallback} callback Node-style callback called with the error, if any, and SearchResourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.searchResources = function searchResources(request, callback) { - return this.rpcCall(searchResources, $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse, request, callback); - }, "name", { value: "SearchResources" }); - - /** - * Calls SearchResources. - * @function searchResources - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} request SearchResourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchIamPolicies}. - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @typedef SearchIamPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} [response] SearchIamPoliciesResponse - */ - - /** - * Calls SearchIamPolicies. - * @function searchIamPolicies - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object - * @param {google.cloud.asset.v1p1beta1.AssetService.SearchIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchIamPoliciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssetService.prototype.searchIamPolicies = function searchIamPolicies(request, callback) { - return this.rpcCall(searchIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse, request, callback); - }, "name", { value: "SearchIamPolicies" }); - - /** - * Calls SearchIamPolicies. - * @function searchIamPolicies - * @memberof google.cloud.asset.v1p1beta1.AssetService - * @instance - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} request SearchIamPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - /** * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService#searchAllResources}. * @memberof google.cloud.asset.v1p1beta1.AssetService @@ -7984,1015 +7918,6 @@ return AssetService; })(); - v1p1beta1.SearchResourcesRequest = (function() { - - /** - * Properties of a SearchResourcesRequest. - * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchResourcesRequest - * @property {string|null} [scope] SearchResourcesRequest scope - * @property {string|null} [query] SearchResourcesRequest query - * @property {Array.|null} [assetTypes] SearchResourcesRequest assetTypes - * @property {number|null} [pageSize] SearchResourcesRequest pageSize - * @property {string|null} [pageToken] SearchResourcesRequest pageToken - */ - - /** - * Constructs a new SearchResourcesRequest. - * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchResourcesRequest. - * @implements ISearchResourcesRequest - * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set - */ - function SearchResourcesRequest(properties) { - this.assetTypes = []; - 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]]; - } - - /** - * SearchResourcesRequest scope. - * @member {string} scope - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.scope = ""; - - /** - * SearchResourcesRequest query. - * @member {string} query - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.query = ""; - - /** - * SearchResourcesRequest assetTypes. - * @member {Array.} assetTypes - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.assetTypes = $util.emptyArray; - - /** - * SearchResourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.pageSize = 0; - - /** - * SearchResourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - */ - SearchResourcesRequest.prototype.pageToken = ""; - - /** - * Creates a new SearchResourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest instance - */ - SearchResourcesRequest.create = function create(properties) { - return new SearchResourcesRequest(properties); - }; - - /** - * Encodes the specified SearchResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scope != null && message.hasOwnProperty("scope")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); - if (message.query != null && message.hasOwnProperty("query")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.assetTypes != null && message.assetTypes.length) - for (var i = 0; i < message.assetTypes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified SearchResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesRequest} message SearchResourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesRequest.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.cloud.asset.v1p1beta1.SearchResourcesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.scope = reader.string(); - break; - case 2: - message.query = reader.string(); - break; - case 3: - if (!(message.assetTypes && message.assetTypes.length)) - message.assetTypes = []; - message.assetTypes.push(reader.string()); - break; - case 4: - message.pageSize = reader.int32(); - break; - case 5: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchResourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchResourcesRequest message. - * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResourcesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { - if (!Array.isArray(message.assetTypes)) - return "assetTypes: array expected"; - for (var i = 0; i < message.assetTypes.length; ++i) - if (!$util.isString(message.assetTypes[i])) - return "assetTypes: 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 SearchResourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesRequest} SearchResourcesRequest - */ - SearchResourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest) - return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesRequest(); - if (object.scope != null) - message.scope = String(object.scope); - if (object.query != null) - message.query = String(object.query); - if (object.assetTypes) { - if (!Array.isArray(object.assetTypes)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesRequest.assetTypes: array expected"); - message.assetTypes = []; - for (var i = 0; i < object.assetTypes.length; ++i) - message.assetTypes[i] = String(object.assetTypes[i]); - } - 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 SearchResourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.SearchResourcesRequest} message SearchResourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResourcesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.assetTypes = []; - if (options.defaults) { - object.scope = ""; - object.query = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.assetTypes && message.assetTypes.length) { - object.assetTypes = []; - for (var j = 0; j < message.assetTypes.length; ++j) - object.assetTypes[j] = message.assetTypes[j]; - } - 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 SearchResourcesRequest to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesRequest - * @instance - * @returns {Object.} JSON object - */ - SearchResourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchResourcesRequest; - })(); - - v1p1beta1.SearchResourcesResponse = (function() { - - /** - * Properties of a SearchResourcesResponse. - * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchResourcesResponse - * @property {Array.|null} [results] SearchResourcesResponse results - * @property {string|null} [nextPageToken] SearchResourcesResponse nextPageToken - */ - - /** - * Constructs a new SearchResourcesResponse. - * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchResourcesResponse. - * @implements ISearchResourcesResponse - * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set - */ - function SearchResourcesResponse(properties) { - this.results = []; - 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]]; - } - - /** - * SearchResourcesResponse results. - * @member {Array.} results - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @instance - */ - SearchResourcesResponse.prototype.results = $util.emptyArray; - - /** - * SearchResourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @instance - */ - SearchResourcesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchResourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse instance - */ - SearchResourcesResponse.create = function create(properties) { - return new SearchResourcesResponse(properties); - }; - - /** - * Encodes the specified SearchResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified SearchResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchResourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchResourcesResponse} message SearchResourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesResponse.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.cloud.asset.v1p1beta1.SearchResourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchResourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchResourcesResponse message. - * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); - if (error) - return "results." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchResourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchResourcesResponse} SearchResourcesResponse - */ - SearchResourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse) - return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchResourcesResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.asset.v1p1beta1.SearchResourcesResponse.results: object expected"); - message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchResourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.SearchResourcesResponse} message SearchResourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.results = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this SearchResourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchResourcesResponse - * @instance - * @returns {Object.} JSON object - */ - SearchResourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchResourcesResponse; - })(); - - v1p1beta1.SearchIamPoliciesRequest = (function() { - - /** - * Properties of a SearchIamPoliciesRequest. - * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchIamPoliciesRequest - * @property {string|null} [scope] SearchIamPoliciesRequest scope - * @property {string|null} [query] SearchIamPoliciesRequest query - * @property {number|null} [pageSize] SearchIamPoliciesRequest pageSize - * @property {string|null} [pageToken] SearchIamPoliciesRequest pageToken - */ - - /** - * Constructs a new SearchIamPoliciesRequest. - * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchIamPoliciesRequest. - * @implements ISearchIamPoliciesRequest - * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set - */ - function SearchIamPoliciesRequest(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]]; - } - - /** - * SearchIamPoliciesRequest scope. - * @member {string} scope - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - */ - SearchIamPoliciesRequest.prototype.scope = ""; - - /** - * SearchIamPoliciesRequest query. - * @member {string} query - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - */ - SearchIamPoliciesRequest.prototype.query = ""; - - /** - * SearchIamPoliciesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - */ - SearchIamPoliciesRequest.prototype.pageSize = 0; - - /** - * SearchIamPoliciesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - */ - SearchIamPoliciesRequest.prototype.pageToken = ""; - - /** - * Creates a new SearchIamPoliciesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest instance - */ - SearchIamPoliciesRequest.create = function create(properties) { - return new SearchIamPoliciesRequest(properties); - }; - - /** - * Encodes the specified SearchIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchIamPoliciesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query != null && message.hasOwnProperty("query")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.scope != null && message.hasOwnProperty("scope")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.scope); - return writer; - }; - - /** - * Encodes the specified SearchIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest} message SearchIamPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchIamPoliciesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchIamPoliciesRequest.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.cloud.asset.v1p1beta1.SearchIamPoliciesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: - message.scope = reader.string(); - break; - case 1: - message.query = 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 SearchIamPoliciesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchIamPoliciesRequest message. - * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchIamPoliciesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: 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 SearchIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} SearchIamPoliciesRequest - */ - SearchIamPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest) - return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest(); - if (object.scope != null) - message.scope = String(object.scope); - if (object.query != null) - message.query = String(object.query); - 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 SearchIamPoliciesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @static - * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} message SearchIamPoliciesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchIamPoliciesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.query = ""; - object.pageSize = 0; - object.pageToken = ""; - object.scope = ""; - } - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - return object; - }; - - /** - * Converts this SearchIamPoliciesRequest to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest - * @instance - * @returns {Object.} JSON object - */ - SearchIamPoliciesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchIamPoliciesRequest; - })(); - - v1p1beta1.SearchIamPoliciesResponse = (function() { - - /** - * Properties of a SearchIamPoliciesResponse. - * @memberof google.cloud.asset.v1p1beta1 - * @interface ISearchIamPoliciesResponse - * @property {Array.|null} [results] SearchIamPoliciesResponse results - * @property {string|null} [nextPageToken] SearchIamPoliciesResponse nextPageToken - */ - - /** - * Constructs a new SearchIamPoliciesResponse. - * @memberof google.cloud.asset.v1p1beta1 - * @classdesc Represents a SearchIamPoliciesResponse. - * @implements ISearchIamPoliciesResponse - * @constructor - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set - */ - function SearchIamPoliciesResponse(properties) { - this.results = []; - 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]]; - } - - /** - * SearchIamPoliciesResponse results. - * @member {Array.} results - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @instance - */ - SearchIamPoliciesResponse.prototype.results = $util.emptyArray; - - /** - * SearchIamPoliciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @instance - */ - SearchIamPoliciesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new SearchIamPoliciesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse=} [properties] Properties to set - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse instance - */ - SearchIamPoliciesResponse.create = function create(properties) { - return new SearchIamPoliciesResponse(properties); - }; - - /** - * Encodes the specified SearchIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchIamPoliciesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified SearchIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse} message SearchIamPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchIamPoliciesResponse.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.cloud.asset.v1p1beta1.SearchIamPoliciesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchIamPoliciesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchIamPoliciesResponse message. - * @function verify - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchIamPoliciesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); - if (error) - return "results." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a SearchIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} SearchIamPoliciesResponse - */ - SearchIamPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse) - return object; - var message = new $root.google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse.results: object expected"); - message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a SearchIamPoliciesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @static - * @param {google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse} message SearchIamPoliciesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchIamPoliciesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.results = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this SearchIamPoliciesResponse to JSON. - * @function toJSON - * @memberof google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse - * @instance - * @returns {Object.} JSON object - */ - SearchIamPoliciesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SearchIamPoliciesResponse; - })(); - v1p1beta1.SearchAllResourcesRequest = (function() { /** diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index c1e58442a51..17c44fa8aff 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -737,22 +737,6 @@ "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { - "SearchResources": { - "requestType": "SearchResourcesRequest", - "responseType": "SearchResourcesResponse", - "options": { - "(google.api.http).get": "/v1p1beta1/resources:search", - "(google.api.method_signature)": "scope,query,asset_types" - } - }, - "SearchIamPolicies": { - "requestType": "SearchIamPoliciesRequest", - "responseType": "SearchIamPoliciesResponse", - "options": { - "(google.api.http).get": "/v1p1beta1/iamPolicies:search", - "(google.api.method_signature)": "scope,query" - } - }, "SearchAllResources": { "requestType": "SearchAllResourcesRequest", "responseType": "SearchAllResourcesResponse", @@ -771,104 +755,6 @@ } } }, - "SearchResourcesRequest": { - "fields": { - "scope": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "query": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "assetTypes": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SearchResourcesResponse": { - "fields": { - "results": { - "rule": "repeated", - "type": "StandardResourceMetadata", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "SearchIamPoliciesRequest": { - "fields": { - "scope": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "query": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SearchIamPoliciesResponse": { - "fields": { - "results": { - "rule": "repeated", - "type": "IamPolicySearchResult", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, "SearchAllResourcesRequest": { "fields": { "scope": { diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 95d7889af6c..fce13d5f36c 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -141,16 +141,6 @@ export class AssetServiceClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this._descriptors.page = { - searchResources: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'results' - ), - searchIamPolicies: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'results' - ), searchAllResources: new gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -191,8 +181,6 @@ export class AssetServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const assetServiceStubMethods = [ - 'searchResources', - 'searchIamPolicies', 'searchAllResources', 'searchAllIamPolicies', ]; @@ -279,306 +267,6 @@ export class AssetServiceClient { // -- Service calls -- // ------------------- - searchResources( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, - options?: gax.CallOptions - ): Promise< - [ - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - ] - >; - searchResources( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - > - ): void; - /** - * Searches resources which are accessible with .get permission. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.scope - * Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: - * * Organization number (such as "organizations/123") - * * Folder number(such as "folders/1234") - * * Project number (such as "projects/12345") - * @param {string} [request.query] - * Optional. The query statement. - * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, it will - * search all the supported asset types. - * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. - * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from - * the previous response. The values of all other method parameters, must be - * identical to those in the previous call. - * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata}. - * The client library support 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [SearchResourcesRequest]{@link google.cloud.asset.v1p1beta1.SearchResourcesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [SearchResourcesResponse]{@link google.cloud.asset.v1p1beta1.SearchResourcesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - searchResources( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - >, - callback?: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - > - ): Promise< - [ - protosTypes.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesResponse - ] - > | void { - request = request || {}; - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - return this._innerApiCalls.searchResources(request, options, callback); - } - - /** - * Equivalent to {@link searchResources}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link searchResources} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.scope - * Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: - * * Organization number (such as "organizations/123") - * * Folder number(such as "folders/1234") - * * Project number (such as "projects/12345") - * @param {string} [request.query] - * Optional. The query statement. - * @param {string[]} [request.assetTypes] - * Optional. A list of asset types that this request searches for. If empty, it will - * search all the supported asset types. - * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. - * @param {string} [request.pageToken] - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `page_token` must be the value of `next_page_token` from - * the previous response. The values of all other method parameters, must be - * identical to those in the previous call. - * @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 [StandardResourceMetadata]{@link google.cloud.asset.v1p1beta1.StandardResourceMetadata} on 'data' event. - */ - searchResourcesStream( - request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest, - options?: gax.CallOptions - ): Transform { - request = request || {}; - options = options || {}; - const callSettings = new gax.CallSettings(options); - return this._descriptors.page.searchResources.createStream( - this._innerApiCalls.searchResources as gax.GaxCall, - request, - callSettings - ); - } - searchIamPolicies( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, - options?: gax.CallOptions - ): Promise< - [ - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - ] - >; - searchIamPolicies( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, - options: gax.CallOptions, - callback: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - > - ): void; - /** - * Searches IAM policies which are accessible with .getIamPolicy permission. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.scope - * Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: - * * Organization number (such as "organizations/123") - * * Folder number(such as "folders/1234") - * * Project number (such as "projects/12345") - * @param {string} [request.query] - * Optional. The query statement. - * Examples: - * * "policy:myuser@mydomain.com" - * * "policy:(myuser@mydomain.com viewer)" - * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. - * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding call to - * this method. `page_token` must be the value of `next_page_token` from the - * previous response. The values of all other method parameters must be - * identical to those in the previous call. - * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult}. - * The client library support 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [SearchIamPoliciesRequest]{@link google.cloud.asset.v1p1beta1.SearchIamPoliciesRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [SearchIamPoliciesResponse]{@link google.cloud.asset.v1p1beta1.SearchIamPoliciesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - searchIamPolicies( - request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - >, - callback?: Callback< - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - > - ): Promise< - [ - protosTypes.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest | null, - protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesResponse - ] - > | void { - request = request || {}; - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - return this._innerApiCalls.searchIamPolicies(request, options, callback); - } - - /** - * Equivalent to {@link searchIamPolicies}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link searchIamPolicies} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.scope - * Required. The relative name of an asset. The search is limited to the resources - * within the `scope`. The allowed value must be: - * * Organization number (such as "organizations/123") - * * Folder number(such as "folders/1234") - * * Project number (such as "projects/12345") - * @param {string} [request.query] - * Optional. The query statement. - * Examples: - * * "policy:myuser@mydomain.com" - * * "policy:(myuser@mydomain.com viewer)" - * @param {number} [request.pageSize] - * Optional. The page size for search result pagination. Page size is capped at 500 even - * if a larger value is given. If set to zero, server will pick an appropriate - * default. Returned results may be fewer than requested. When this happens, - * there could be more results as long as `next_page_token` is returned. - * @param {string} [request.pageToken] - * Optional. If present, retrieve the next batch of results from the preceding call to - * this method. `page_token` must be the value of `next_page_token` from the - * previous response. The values of all other method parameters must be - * identical to those in the previous call. - * @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 [IamPolicySearchResult]{@link google.cloud.asset.v1p1beta1.IamPolicySearchResult} on 'data' event. - */ - searchIamPoliciesStream( - request?: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest, - options?: gax.CallOptions - ): Transform { - request = request || {}; - options = options || {}; - const callSettings = new gax.CallSettings(options); - return this._descriptors.page.searchIamPolicies.createStream( - this._innerApiCalls.searchIamPolicies as gax.GaxCall, - request, - callSettings - ); - } searchAllResources( request: protosTypes.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json index d033cf28f2b..fe7cd34beeb 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client_config.json @@ -20,16 +20,6 @@ } }, "methods": { - "SearchResources": { - "timeout_millis": 15000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "SearchIamPolicies": { - "timeout_millis": 15000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, "SearchAllResources": { "timeout_millis": 15000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-asset/synth.metadata b/packages/google-cloud-asset/synth.metadata index 65fbc45acda..debdd2c1626 100644 --- a/packages/google-cloud-asset/synth.metadata +++ b/packages/google-cloud-asset/synth.metadata @@ -1,20 +1,13 @@ { - "updateTime": "2020-02-12T21:58:22.717995Z", + "updateTime": "2020-02-29T12:11:41.085915Z", "sources": [ - { - "git": { - "name": ".", - "remote": "git@github.com:googleapis/nodejs-asset.git", - "sha": "1672f14370c3d868439c09a8b2dda6ed4735f640" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2c17ac33b226194041155bb5340c3f34733f1b3a", - "internalRef": "294734008", - "log": "2c17ac33b226194041155bb5340c3f34733f1b3a\nAdd parameter to sample generated for UpdateInstance. Related to https://github.com/googleapis/python-redis/issues/4\n\nPiperOrigin-RevId: 294734008\n\nd5e8a8953f2acdfe96fb15e85eb2f33739623957\nMove bigquery datatransfer to gapic v2.\n\nPiperOrigin-RevId: 294703703\n\nefd36705972cfcd7d00ab4c6dfa1135bafacd4ae\nfix: Add two annotations that we missed.\n\nPiperOrigin-RevId: 294664231\n\n8a36b928873ff9c05b43859b9d4ea14cd205df57\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1beta2).\n\nPiperOrigin-RevId: 294459768\n\nc7a3caa2c40c49f034a3c11079dd90eb24987047\nFix: Define the \"bigquery.googleapis.com/Table\" resource in the BigQuery Storage API (v1).\n\nPiperOrigin-RevId: 294456889\n\n5006247aa157e59118833658084345ee59af7c09\nFix: Make deprecated fields optional\nFix: Deprecate SetLoggingServiceRequest.zone in line with the comments\nFeature: Add resource name method signatures where appropriate\n\nPiperOrigin-RevId: 294383128\n\neabba40dac05c5cbe0fca3a35761b17e372036c4\nFix: C# and PHP package/namespace capitalization for BigQuery Storage v1.\n\nPiperOrigin-RevId: 294382444\n\nf8d9a858a7a55eba8009a23aa3f5cc5fe5e88dde\nfix: artman configuration file for bigtable-admin\n\nPiperOrigin-RevId: 294322616\n\n0f29555d1cfcf96add5c0b16b089235afbe9b1a9\nAPI definition for (not-yet-launched) GCS gRPC.\n\nPiperOrigin-RevId: 294321472\n\nfcc86bee0e84dc11e9abbff8d7c3529c0626f390\nfix: Bigtable Admin v2\n\nChange LRO metadata from PartialUpdateInstanceMetadata\nto UpdateInstanceMetadata. (Otherwise, it will not build.)\n\nPiperOrigin-RevId: 294264582\n\n6d9361eae2ebb3f42d8c7ce5baf4bab966fee7c0\nrefactor: Add annotations to Bigtable Admin v2.\n\nPiperOrigin-RevId: 294243406\n\nad7616f3fc8e123451c8b3a7987bc91cea9e6913\nFix: Resource type in CreateLogMetricRequest should use logging.googleapis.com.\nFix: ListLogEntries should have a method signature for convenience of calling it.\n\nPiperOrigin-RevId: 294222165\n\n63796fcbb08712676069e20a3e455c9f7aa21026\nFix: Remove extraneous resource definition for cloudkms.googleapis.com/CryptoKey.\n\nPiperOrigin-RevId: 294176658\n\n" + "sha": "83c6f84035ee0f80eaa44d8b688a010461cc4080", + "internalRef": "297918498", + "log": "83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n7f910bcc4fc4704947ccfd3ceed015d16b9e00c2\nUpdate Dataproc v1beta2 client.\n\nPiperOrigin-RevId: 296451205\n\nde287524405a3dce124d301634731584fc0432d7\nFix: Reinstate method signatures that had been missed off some RPCs\nFix: Correct resource types for two fields\n\nPiperOrigin-RevId: 296435091\n\ne5bc9566ae057fb4c92f8b7e047f1c8958235b53\nDeprecate the endpoint_uris field, as it is unused.\n\nPiperOrigin-RevId: 296357191\n\n8c12e2b4dca94e12bff9f538bdac29524ff7ef7a\nUpdate Dataproc v1 client.\n\nPiperOrigin-RevId: 296336662\n\n17567c4a1ef0a9b50faa87024d66f8acbb561089\nRemoving erroneous comment, a la https://github.com/googleapis/java-speech/pull/103\n\nPiperOrigin-RevId: 296332968\n\n3eaaaf8626ce5b0c0bc7eee05e143beffa373b01\nAdd BUILD.bazel for v1 secretmanager.googleapis.com\n\nPiperOrigin-RevId: 296274723\n\ne76149c3d992337f85eeb45643106aacae7ede82\nMove securitycenter v1 to use generate from annotations.\n\nPiperOrigin-RevId: 296266862\n\n203740c78ac69ee07c3bf6be7408048751f618f8\nAdd StackdriverLoggingConfig field to Cloud Tasks v2 API.\n\nPiperOrigin-RevId: 296256388\n\ne4117d5e9ed8bbca28da4a60a94947ca51cb2083\nCreate a Bazel BUILD file for the google.actions.type export.\n\nPiperOrigin-RevId: 296212567\n\na9639a0a9854fd6e1be08bba1ac3897f4f16cb2f\nAdd secretmanager.googleapis.com v1 protos\n\nPiperOrigin-RevId: 295983266\n\nce4f4c21d9dd2bfab18873a80449b9d9851efde8\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295861722\n\ncb61d6c2d070b589980c779b68ffca617f789116\nasset: v1p1beta1 remove SearchResources and SearchIamPolicies\n\nPiperOrigin-RevId: 295855449\n\nab2685d8d3a0e191dc8aef83df36773c07cb3d06\nfix: Dataproc v1 - AutoscalingPolicy annotation\n\nThis adds the second resource name pattern to the\nAutoscalingPolicy resource.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 295738415\n\n8a1020bf6828f6e3c84c3014f2c51cb62b739140\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295286165\n\n5cfa105206e77670369e4b2225597386aba32985\nAdd service control related proto build rule.\n\nPiperOrigin-RevId: 295262088\n\nee4dddf805072004ab19ac94df2ce669046eec26\nmonitoring v3: Add prefix \"https://cloud.google.com/\" into the link for global access\ncl 295167522, get ride of synth.py hacks\n\nPiperOrigin-RevId: 295238095\n\nd9835e922ea79eed8497db270d2f9f85099a519c\nUpdate some minor docs changes about user event proto\n\nPiperOrigin-RevId: 295185610\n\n5f311e416e69c170243de722023b22f3df89ec1c\nfix: use correct PHP package name in gapic configuration\n\nPiperOrigin-RevId: 295161330\n\n6cdd74dcdb071694da6a6b5a206e3a320b62dd11\npubsub: v1 add client config annotations and retry config\n\nPiperOrigin-RevId: 295158776\n\n5169f46d9f792e2934d9fa25c36d0515b4fd0024\nAdded cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 295026522\n\n56b55aa8818cd0a532a7d779f6ef337ba809ccbd\nFix: Resource annotations for CreateTimeSeriesRequest and ListTimeSeriesRequest should refer to valid resources. TimeSeries is not a named resource.\n\nPiperOrigin-RevId: 294931650\n\n0646bc775203077226c2c34d3e4d50cc4ec53660\nRemove unnecessary languages from bigquery-related artman configuration files.\n\nPiperOrigin-RevId: 294809380\n\n8b78aa04382e3d4147112ad6d344666771bb1909\nUpdate backend.proto for schemes and protocol\n\nPiperOrigin-RevId: 294788800\n\n80b8f8b3de2359831295e24e5238641a38d8488f\nAdds artman config files for bigquerystorage endpoints v1beta2, v1alpha2, v1\n\nPiperOrigin-RevId: 294763931\n\n" } }, { diff --git a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts index 28e8691c20e..6a09509cdb1 100644 --- a/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic-asset_service-v1p1beta1.ts @@ -67,120 +67,6 @@ describe('v1p1beta1.AssetServiceClient', () => { }); assert(client); }); - describe('searchResources', () => { - it('invokes searchResources without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest = {}; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.searchResources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.searchResources(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('searchResourcesStream', () => { - it('invokes searchResourcesStream without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchResourcesRequest = {}; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.searchResources = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .searchResourcesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); - describe('searchIamPolicies', () => { - it('invokes searchIamPolicies without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest = {}; - // Mock response - const expectedResponse = {}; - // Mock Grpc layer - client._innerApiCalls.searchIamPolicies = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - client.searchIamPolicies(request, (err: FakeError, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - }); - describe('searchIamPoliciesStream', () => { - it('invokes searchIamPoliciesStream without error', done => { - const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Mock request - const request: protosTypes.google.cloud.asset.v1p1beta1.ISearchIamPoliciesRequest = {}; - // Mock response - const expectedResponse = {response: 'data'}; - // Mock Grpc layer - client._innerApiCalls.searchIamPolicies = ( - actualRequest: {}, - options: {}, - callback: Callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse); - }; - const stream = client - .searchIamPoliciesStream(request, {}) - .on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }) - .on('error', (err: FakeError) => { - done(err); - }); - stream.write(expectedResponse); - }); - }); describe('searchAllResources', () => { it('invokes searchAllResources without error', done => { const client = new assetserviceModule.v1p1beta1.AssetServiceClient({